Provizyon
Non-secure ve 3D secure provizyon işlemlerini yapmak için daha önce oluşturulmuş olan card token bilgisi ile aşağıda istenen değerler gönderilmelidir. Eğer işlem 3D secure yapılmak istenir ise doğrulaması yapılan kartlardan tutar çekimi yapmak için ‘threeDSessionId’ parametresi set edilerek bu servis çağırılmalıdır.
POSThttps://testpfapi.rubikpara.com/v1/Payments/provision
Request
Headers
ClientIpAddress array[string]
ConversationId string
MerchantNumber string
Nonce string
PublicKey string
Signature string
ConversationId string
MerchantNumber string
Nonce string
PublicKey string
Signature string
Body
{
"amount": 20,
"pointAmount": 20,
"cardToken": "string",
"currency": "string",
"paymentType": "Auth",
"integrationMode": "Unknown",
"installmentCount": 0,
"threeDSessionId": "string",
"originalOrderId": "string",
"languageCode": "string",
"merchantCustomerName": "string",
"merchantCustomerPhoneNumber": "string",
"description": "string",
"cardHolderName": "string",
"gateway": "string"
}
Response
Body
{
"isSucceed": "boolean",
"errorCode": "string or null",
"errorMessage": "string or null",
"conversationId": "string or null",
"orderId": "string or null"
}
Örnek Kodlar
Dikkat
Bu servisten dönen orderId değerini diğer servislerde kullanmak üzere tutunuz!!
- Axios
- Java
- PHP
- C#
- Go
- Python
- cURL
const axios = require('axios').default; const options = { method: 'POST', url: 'https://testpfapi.rubikpara.com/v1/Payments/provision', headers: { PublicKey: 'SkDP+k0jpMPDOzjcQ2dTcg==', Nonce: '', Signature: '', ConversationId: 'test123456', ClientIpAddress: '192.1.1.1', MerchantNumber: '1100000001', 'Content-Type': 'application/json', Accept: 'application/json' }, data: { amount: 20, pointAmount: 0, cardToken: '', currency: 'TRY', paymentType: 'Auth', integrationMode: 'Api', installmentCount: 0, threeDSessionId: '',// 3D Doğrulama Servisinden alınacak originalOrderId: '',// Provizyon Servisinden alınacak languageCode: 'TR', merchantCustomerName: 'test', merchantCustomerPhoneNumber: '5554443322', description: 'string', cardHolderName: 'test test', gateway: 'test' } }; try { const { data } = await axios.request(options); console.log(data); } catch (error) { console.error(error); }
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{
"amount": 20,
"pointAmount": 0,
"cardToken": "",
"CardHolderName": "test test",
"currency": "TRY",
"paymentType": "Auth",
"installmentCount": 0,
"threeDSessionId": "",// 3D Doğrulama Servisinden alınacak
"originalOrderId": "",// Provizyon Servisinden alınacak
"LanguageCode":"TR",
"CustomerName":"test",
"CustomerPhoneNumber":"5554443322",
"Description":"test"
}");
Request request = new Request.Builder()
.url("https://testpfapi.rubikpara.com/v1/Payments/provision")
.method("POST", body)
.addHeader("publicKey", "SkDP+k0jpMPDOzjcQ2dTcg==")
.addHeader("nonce", "")
.addHeader("signature", "")
.addHeader("conversationId", "test123456")
.addHeader("clientIpAddress", "192.1.1.1")
.addHeader("merchantNumber", "1100000001")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://testpfapi.rubikpara.com/v1/Payments/provision",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 20,
'pointAmount' => 0,
'cardToken' => '',
'currency' => 'TRY',
'paymentType' => 'Auth',
'integrationMode' => 'Api',
'installmentCount' => 0,
'threeDSessionId' => '',// 3D Doğrulama Servisinden alınacak
'originalOrderId' => '',// Provizyon Servisinden alınacak
'languageCode' => 'TR',
'merchantCustomerName' => 'test',
'merchantCustomerPhoneNumber' => '5554443322',
'description' => 'string',
'cardHolderName' => 'test test',
'gateway' => 'string'
]),
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"ClientIpAddress: 192.1.1.1",
"Content-Type: application/json",
"ConversationId: test123456",
"MerchantNumber: 1100000001",
"Nonce: ",
"PublicKey: SkDP+k0jpMPDOzjcQ2dTcg==",
"Signature: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://testpfapi.rubikpara.com/v1/Payments/provision"),
Headers =
{
{ "PublicKey", "SkDP+k0jpMPDOzjcQ2dTcg==" },
{ "Nonce", "" },
{ "Signature", "" },
{ "ConversationId", "test123456" },
{ "ClientIpAddress", "192.1.1.1" },
{ "MerchantNumber", "1100000001" },
{ "Accept", "application/json" },
},
Content = new StringContent("{
"amount": 20,
"pointAmount": 0,
"cardToken": "",
"currency": "TRY",
"paymentType": "Auth",
"integrationMode": "Api",
"installmentCount": 0,
"threeDSessionId": "",// 3D Doğrulama Servisinden alınacak
"originalOrderId": "",// Provizyon Servisinden alınacak
"languageCode": "TR",
"merchantCustomerName": "test",
"merchantCustomerPhoneNumber": "5554443322",
"description": "string",
"cardHolderName": "test test",
"gateway": "string"
}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://testpfapi.rubikpara.com/v1/Payments/provision"
payload := strings.NewReader("{
"amount": 20,
"pointAmount": 0,
"cardToken": "",
"currency": "TRY",
"paymentType": "Auth",
"integrationMode": "Api",
"installmentCount": 0,
"threeDSessionId": "",// 3D Doğrulama Servisinden alınacak
"originalOrderId": "",// Provizyon Servisinden alınacak
"languageCode": "TR",
"merchantCustomerName": "test",
"merchantCustomerPhoneNumber": "5554443322",
"description": "string",
"cardHolderName": "test test",
"gateway": "string"
}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("PublicKey", "SkDP+k0jpMPDOzjcQ2dTcg==")
req.Header.Add("Nonce", "")
req.Header.Add("Signature", "")
req.Header.Add("ConversationId", "test123456")
req.Header.Add("ClientIpAddress", "192.1.1.1")
req.Header.Add("MerchantNumber", "1100000001")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import http.client
conn = http.client.HTTPSConnection("https://testpfapi.rubikpara.com")
payload = "{
"amount": 20,
"pointAmount": 0,
"cardToken": "",
"currency": "TRY",
"paymentType": "Auth",
"integrationMode": "Api",
"installmentCount": 0,
"threeDSessionId": "",// 3D Doğrulama Servisinden alınacak
"originalOrderId": "",// Provizyon Servisinden alınacak
"languageCode": "TR",
"merchantCustomerName": "test",
"merchantCustomerPhoneNumber": "5554443322",
"description": "string",
"cardHolderName": "test test",
"gateway": "string"
}"
headers = {
'PublicKey': "SkDP+k0jpMPDOzjcQ2dTcg==",
'Nonce': "",
'Signature': "",
'ConversationId': "test123456",
'ClientIpAddress': "192.1.1.1",
'MerchantNumber': "1100000001",
'Content-Type': "application/json",
'Accept': "application/json"
}
conn.request("POST", "/v1/Payments/provision", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl --request POST --url https://testpfapi.rubikpara.com/v1/Payments/provision --header 'Accept: application/json' --header 'ClientIpAddress: 192.1.1.1' --header 'Content-Type: application/json' --header 'ConversationId: test123456' --header 'MerchantNumber: 1100000001' --header 'Nonce: ' --header 'PublicKey: SkDP+k0jpMPDOzjcQ2dTcg==' --header 'Signature: ' --data '{
"amount": 20,
"pointAmount": 0,
"cardToken": "",
"currency": "TRY",
"paymentType": "Auth",
"integrationMode": "Api",
"installmentCount": 0,
"threeDSessionId": "",// 3D Doğrulama Servisinden alınacak
"originalOrderId": "",// Provizyon servisinden alınacak
"languageCode": "TR",
"merchantCustomerName": "test",
"merchantCustomerPhoneNumber": "5554443322",
"description": "string",
"cardHolderName": "test test",
"gateway": "string"
}'