It is the method by which the payment transaction will be started. The payment transaction is initiated by directing to the “paymentUrl” address returned at the end of the transaction. With the conclusion of the payment transaction, the customer is directed to the address transmitted with the “callbackUrl” parameter. The final result information regarding the payment is sent to the notification address determined by the external institution via the IPN service. In addition, the result of the payment can be inquired with the payment query service.
When initiating the payment process, a payment method can be targeted directly or the user can choose the method that suits him / her among the available options.
All payment options are defined by a separate method code. If the payment transaction is initiated with a method code, the user is directed directly to the relevant payment method and makes the transaction. If the method code is transmitted as “0”, the user can choose the appropriate one from among the available payment options.
You can access the list of payment method codes through your management panel..
Method | Endpoint | Content-Type |
---|---|---|
POST | {{baseURL}}/paymapi/v1/transaction/create |
application/json |
Parameter | Type | Required | Description |
---|---|---|---|
credentials | obj | yes | API credentials |
apiKey | str | yes | API key. This information is located in your administration panel. |
hash | str | yes | The hash value generated for this transaction.. See: Hash generation for payment |
paymentMethodCode | int | no | Payment method code: It determines the method the customer will pay with. See: Payment Method Codes |
orderId | str | yes | Order-specific, unique ID value |
orderTotal | flt | yes | Total payment amount |
currencyCode | str | yes | ISO 4217, three-digit currency code |
items | obj arr | yes | List of products subject to order |
name | str | yes | Name of the product |
stockCode | str | no | Stock code of the product |
quantity | int | yes | Product quantity |
price | flt | yes | Product price |
customer | obj | yes | Object containing customer information |
id | str | no | Customer-specific unique ID value |
name | str | yes | Customer name |
surname | str | yes | Customer surname |
str | yes | Customer email address | |
telephone | str | yes | Customer phone number (12-digit phone number with country code) |
ssn | str | * | Customer ID number |
address | str | * | Customer address |
city | str | * | City |
country | str | * | Country |
zipCode | str | * | Zip code |
ipAddr | str | yes | IP address |
callbackUrl | str | yes | URL to which the customer will be directed as a result of the payment |
*Required for some payment methods. If it is not sent, it is tried to initiate the payment with the default information.
{
"credentials":{
"apiKey":"your-api-key",
"hash":"hash-for-transaction"
},
"paymentMethodCode":0,
"orderId":"order-id",
"orderTotal":52.5,
"currencyCode":"TRY",
"items":[
{
"name":"product-name",
"stockCode" :"stock-code",
"quantity":10,
"price":5.25
}
],
"customer" :{
"id": "customer-id",
"name": "customer-name",
"surname": "customer-surname",
"email": "customer@email",
"telephone": "customer-telephone",
"ssn": "customer-ssn",
"address": "customer-address",
"city": "customer-city",
"country": "customer-country",
"zipCode": "customer-zipcode",
"ipAddr": "customer-ip"
},
"callbackUrl":"your-callback-url"
}
Parameter | Type | Description |
---|---|---|
data | obj | Data object |
paymentId | int | ID value for payment |
uuid | str | UUID value for payment |
paymentUrl | str | Payment URL to which you should refer your customer |
statusCode | int | Transaction status code |
statusMsg | str | Transaction status message |
{
"data": {
"paymentId": 305,
"uuid": "edc44396-e946-40e5-b530-8475bd624db2",
"paymentUrl": "{{baseURL}}/payment/edc44396-e946-40e5-b530-8475bd624db2"
},
"statusCode": 100,
"statusMsg": "OK"
}
After the payment link (paymentUrl) has been delivered, the payment is expected to be initiated in ~ 10 minutes. Payment transactions that are not initiated during this period will expire and the payment link will become invalid.
The SHA1 algorithm is applied by adding “apiKey” + “orderId” + “secretKey” parameters, respectively. The hash value obtained is encoded as a base64 string.
base64(sha1(apiKey + orderId + secretKey))
Hash computing differs for each service.