Paynet API
Search…
Payment Confirmation
v1/transaction/charge
The service that the credit card payment process is finalized and the relevant amount is withdrawn from the credit card.This service is initializes by Paynet.js or Paynet-custom.js in custom form and embedded form integrations. To use this service, session_id and token_id information that Paynet.js posted to your server are required.
You should perform basic authentication with secret_key to use payment service. See more
https://api.paynet.com.tr/v1/transaction/charge
Request Parameters
Response Parameters
Request
Response
Service Url
Parameter Name
Type
Required
Description
session_id
string
Yes
Parameter that Paynet.js attacht to your form.
token_id
string
Yes
Parameter that Paynet.js attacht to your form.
amount
string
Yes
The amount parameter sent to this service is compared with the amount that set with the data-amount parameter when starting the payment process in embedded form or custom forms integration. If the amounts do not match, the payment process cannot be completed and the payment service returns an error. The amount sent to this service should be the same as the amount that set with data-amount in embedded form integration, and the amount set with dataamount in custom forms integration should be multiplied by 100.
transaction_type
char
Yes
Sale or pre-authorization. 1 for sale, 3 for pre-authorisations. The default value is sale.
add_comission_amount
bool
Yes
It is compared with the value that set with the dataadd_commission_amount parameter when starting the payment process in embedded form or custom forms integration. If the values do not match, the payment process cannot be completed, the payment service returns an error.
ratio_code
string
Yes
When starting the payment process in embedded form or custom forms integrations, it is compared with the value that set with the dataratio_code parameter. If the values do not match, the payment process cannot be completed, the payment service returns an error. If the ratio code will not be used, this parameter can be sent as an empty string.
installments
string
Yes
When starting the payment process embedded or custom form integrations, it is compared with the value set with the data-installments parameter. If the values do not match, the payment process cannot be completed, the payment service returns an error. If installment limitation will not be used with this parameter, the value of the parameter can be sent as an empty string.
no_instalment
bool
Yes
When starting the payment process in embedded form or custom form integrations, it is compared with the value set with the data-no_instalment parameter. If the values do not match, the payment process cannot be completed, the payment service returns an error.This value can be set as true or false.
tds_required
bool
Yes
When starting the payment process in embedded form or custom form integrations, it is compared with the value set with the data-tds_required parameter. If the values do not match, the payment process cannot be completed, the payment service returns an error.This value can be set as true or false.
reference_no
string
No
A reference number to be sent by you to associate with the transaction, such as order number, invoice number. If you send the reference number with a unique value, you can check the status of the transaction through the check transaction service, in cases where you cannot get a response from the charge transaction service. In this way, we will be protected from duplicate transaction. In the example below, the session_id and token_id are taken and sent to the payment confirmation service.
is_escrow
bool
No
If you want the transaction to be approved by the company, you should send "true". If the parameter has not been sent, "false" is accepted.
agent_customer_name
string
No
The parameter which you write in this area will be seen as the "Customer's Name". You may write your firm name which you want to be seen by your customer
iban
string
No
It should be entered with a country code (ex "TR") with 26 characters in total.
Parameter Name
Type
Description
id
string
Transaction Id.
xact_id
string
Encrypted Transaction Id.
xact_date
datetime
Transaction Date.
transaction_type
char
1: sale
pos_type
char
5: Paynet POS
is_tds
bool
If the transaction performed with 3D,this value return as true.
agent_id
string
Paynet agent code of the dealer that performed the transaction.
user_id
string
Returns default as PaynetJ.
email
string
Mail address.
phone
string
Phone number.
bank_id
char
The bank's code in the Paynet system.
bank_name
string
The bank's name in the Paynet system.
campaign_url
string
The url showing the banks' plus installment and installment postpone selection screen. Call us for more detail information.
instalment
int
Installment count.See More
ratio
float
Rate that used during transaction.
ratio_code
string
Ratio code that used during transaction.
card_no_masked
string
Masked card number.
card_holder
string
Card owner.
amount
decimal
Amount that withdrawn from credit card.
net_amount
decimal
Amount without commission.
comission
decimal
Comission.
comission_tax
decimal
Comission tax.
end_user_commission
decimal
End user comission.
end_user_ratio
float
User ratio code that used during checkout.
currency
char
Currency.
authorization_code
string
Bank confirmation code.
reference_code
string
Bank reference code.
order_id
string
Bank order no.
user_unique_id
string
Unique id that given to user by member workplace.It’s necessary If card saving will perform at first time.Unique value(card_owner_id) assigns to user by Paynet after completion first card saving operation. You must store this value on your system by associating it with your user. Afterwards you should use the card_owner_id variable given by Paynet instead of user_unique_id for the saved card operations.
card_owner_id
string
Unique card holder information that has been generated by Paynet residing on user_unique_id after the first card saving process. This value is also used in subsequent card saving and recieving payment processes.
card_hash
string
Hash value of card number.
card_bank_id
string
The code of the stored card in the Paynet system.
card_logo_url
string
Logo image of the card.
is_succeed
bool
It returns true if the transaction successful. If the transaction is successful, it returns as http 200 and and is_succeed return as true. If the bank does not approve transaciton, it returns http 200 and is_succed return as false is_save_card_succeed: Returns true if the card save operation is successful. Its default value is false.
is_save_card_succeed
bool
Returns true if the card save operation is successful. Its default value is false.
save_card_result_message
string
Result message of card save operation.
paynet_error_id
string
Paynet system error code.
paynet_error_message
string
Paynet system error code.
bank_error_id
string
Bank error code.
bank_error_message
string
Bank error message.
bank_error_short_desc
string
Bank error message.
bank_error_long_desc
string
Bank error message
agent_reference_no
string
Reference number that used in the payment process. It is same as with reference_no.
object_name
string
Transaction.
code
string
System result code . See more
message
string
System message.
ratio_code_method
string
Please contact our support team for more detailed information.
md_status
int
3D payment confirmation transaction result.
company_cost_ratio
float
Value of Parent company service fee.
company_commission
decimal
The amount of service fee to be charged to the parent company as a result of this transaction.
company_commission_with_tax
decimal
As a result of this transaction, the amount of service fee with VAT, to be deducted to the parent company.
company_net_amount
decimal
Net amount to pay parent company.
plus_installment
string
Plus installment count.
card_type
char
Card Type. See More
card_brand_name
string
Brand of Card Bank (VISA, MASTERCARD, AMEX).
1
{
2
"session_id": "js_*****FBWZ/****/tZjhkI8ecXG3HsTm8H76A6I1apMT*****",
3
"token_id": "3C72FBF6-****-****-****-CA2CE9AAE900",
4
"reference_no": "",
5
"transaction_type": 1,
6
"add_comission_amount": "true",
7
"no_instalment": "false",
8
"tds_required": "true",
9
"installments": "0,3,6,8,9",
10
"ratio_code": "",
11
"amount": 1256000
12
}
Copied!
1
{
2
"id": 2526145,
3
"xact_id": "xk_EAAAAFZ59jeB/zqMRhd0yygDgbCmqfeCJCPOmJSNDIIxBYQ5",
4
"xact_date": "2020-01-30T14:38:44.6478544+03:00",
5
"transaction_type": 1,
6
"pos_type": 5,
7
"is_tds": true,
8
"agent_id": "1001",
9
"user_id": "PaynetApi",
10
"email": null,
11
"phone": null,
12
"bank_id": "AXSS",
13
"bank_name": "Axess",
14
"instalment": 0,
15
"ratio": 0.025,
16
"card_no_masked": "435508******4358",
17
"card_holder": "TEST",
18
"amount": 80,
19
"net_amount": 78,
20
"comission": 2,
21
"comission_tax": 0,
22
"currency": "TRY",
23
"authorization_code": "aut-1022",
24
"reference_code": "ref-1022",
25
"order_id": "order-1022",
26
"is_succeed": true,
27
"paynet_error_id": "",
28
"paynet_error_message": "",
29
"bank_error_id": "",
30
"bank_error_message": "",
31
"bank_error_short_desc": "",
32
"bank_error_long_desc": "",
33
"agent_reference_no": "1000",
34
"xact": "2526145",
35
"campaign_url": "",
36
"end_user_comission": 0,
37
"end_user_ratio": 0,
38
"ratio_code": "",
39
"ratio_code_method": "",
40
"is_save_card_succeed": true,
41
"save_card_result_message": "Kart saklama islemi basarili",
42
"card_owner_id": "2ce0bd9d-aeb3-4af0-9dd6-cf294e72f9cb",
43
"user_unique_id": "31",
44
"card_hash": "pch_Ie_StuwWK-dFd6H6FtZpWeqs-xq-",
45
"card_bank_id": "AXSS",
46
"company_cost_ratio": "0.1",
47
"company_commission":""
48
"company_commission_with_tax":
49
"company_net_amount":""
50
"plus_installment":""
51
"card_type":""
52
"card_brand_name":""
53
"card_logo_url": "https://pts-statics.paynet.com.tr/img/banklogo/small/AXSS.png",
54
"md_status": -1,
55
"object_name": "transaction",
56
"code": 0,
57
"message": "Başarılı İşlem"
58
}
Copied!
System
URL
Live System
https://api.paynet.com.tr/v1/transaction/charge
Test System
​https://pts-api.paynet.com.tr/v1/transaction/charge
In the example below, the session_id and token_id are taken and sent to the payment confirmation service.
1
<?php
2
3
$secret_key = "sck_pcs_rMnxDSW/43243434/YAzXXXXXXXXXXXX";
4
$PostURL = "https://pts-api.paynet.com.tr/v1/transaction/charge";
5
6
$session_id = $_REQUEST["session_id"];
7
$token_id = $_REQUEST["token_id"];
8
9
10
$params = array(
11
'session_id' => $session_id,
12
'token_id' => $token_id,
13
'transaction_type' => 1,
14
'amount' => '1500',
15
'add_comission_amount' => false,
16
'ratio_code' => '',
17
'installments' => '',
18
'no_instalment' => false,
19
'tds_required' => true
20
);
21
22
$options = array(
23
'http' => array(
24
'header' =>"Accept: application/json; charset=UTF-8\r\n".
25
"Content-type: application/json; charset=UTF-8\r\n".
26
"Authorization: Basic ".$secret_key,
27
'method' => 'POST',
28
'content' => json_encode($params),
29
'ignore_errors' => true
30
),
31
);
32
33
$context = stream_context_create($options);
34
$result = json_decode(@file_get_contents($PostURL, false, $context));
35
36
if($result->is_succeed == true)
37
{
38
echo "Başarılı";
39
}
40
else
41
{
42
echo "Başarısız";
43
}
44
45
?>
Copied!
Last modified 3mo ago
Copy link