TR EN


Sale using Saved Card [TOKEN]



- Sale Transaction with saved card can be done easily by passing the TOKEN in the request to API.
- To have installments, there is installments parameter can accept values from 1 or more, but to do this procedure, you should know the available predefined installments.


Request parameters
merchant: required
merchant name which you created in your Payfull account.

type: required
Transaction type should be Sale.

total: required
Total amount of the payment EX: 10.23 .

cc_token: required
The card TOKEN

currency: required
Currency can be TRY/USD/EUR/GBP

installments: required
Installments number, for no installment use 1

language: required
Response message language can be en / tr

client_ip: required
The client IP who uses the application which sends the request to the API.

payment_title: required
For each sale transaction you have to give a name for it EX: sell cup transaction

bank_id: optional
If you like to use specific bank, this parameter will tell the API about its ID
If there are installments, it will be required

gateway: optional
For each bank there is different gateway in installment mode EX: asseco / iyzico / payU ...etc
if there are installments, it will be required

customer_firstname: required
Firstname of the buyer

customer_lastname: required
Lastname of the buyer

customer_email: required
Email of the buyer

customer_phone: required
Phone number of the buyer

customer_tc: optional
TC number of the buyer

passive_data: optional
This parameter can take any passive data, then API will save it and return it to the caller in the response.

hash: required
Generated hash code on the caller side

To generate the hash code please follow the steps below:
  • - Arrange the parameters alphabetically from A to Z
  • - Create a parameters string which has the length for each parameters with its value side by side
  • - Create the sha256 hash code from the parameters string and pass the merchant password as Shared secret key
  • - Add the hash code to the request parameters


Sample request


merchant: merchant name
type: Sale
total: 23.02
cc_token: A5NVH5VFTXE3XT3DUTVJMTD2BR2U7K5LBS2UNOXFTA5W2BII
currency: TRY
installments: 1
language: tr
client_ip: 192.168.1.1
payment_title: just payemnt title
bank_id: Akbank
gateway: 160
customer_firstname: ALI
customer_lastname: MUHAMAD
customer_email: alitestemail@gmail.com
customer_phone: 5394659832
customer_tc: 12590326514
passive_data: just any passive data
hash: 14339MjuG01015018



Sample Response


{
"type":"Sale",
"status":1,
"transaction_id":"T4U_7dd053f6b8_d9a58906b",
"ErrorMSG":"Success Transaction",
"ErrorCode":"00",
"passive_data":" just any passive data",
"original_currency":"TRY",
"total":23.02,
"currency":"TRY",
"conversion_rate":1,
"bank_id":"Akbank",
"use3d":0,
"installments":1,
"time":"08-09-2016 02:53:25"
}


PHP Example