Payment with YKB WorldPay
To get paid with YKB WorldPay, the first step is to initiate a payment on Craftgate.
Afterward, the payment process is completed by the user through World Pay mobile application. Later, for WEB2QR
and WEB2APP
flow, merchant is triggered with the payment status information who has been given callback URL
address in the payment initiation request. For APP2APP
flow user redirect to redirectUrl
which has been set in init request by merchant.
After redirection, merchant calls complete service and finishes payment.
If you want to receive payment with WorldPay shopping loan, the value of YKB_WORLD_PAY_SHOPPING_LOAN
in paymentProvider
field and the value of shoppingLoanProductCode
in additionalParams
must be passed.
Payment initiation with YKB WorldPay
URL
The endpoint and http method information to make a payment with YKB WorldPay are stated below.
Payment initiation request parameters
Total basket price. The sum of the item prices in the basket must be equal to total basket price.
The final amount to be paid from the card by calculating differences such as commissions and discounts. The amount to be collected from the wallet is also included in this amount. If there is an interest in the transaction, the amount with the interest added should be entered in this parameter.
Represents the POS that payment will be collected.
"boomerang" value that can be sent with the request and received with the response. It can be used to associate different requests with each other. Usually, the order number is used that is stored in merchant own system.
It is generally used as a payment order number or basket number on the merchant side. You can search with this value later by using reporting services.
The URL to be used to send the result returned from the bank to the merchant
It is generally used to keep information specific to the payment channel on the merchant side. You can search with this value later by using reporting services.
ID of the buyer that is returned from member creation.
Order id parameter to be transmitted to the bank when receiving the payment. Since it is optional, it is recommended not to send it and the orderId value is generated by Craftgate.
IP of the buyer.
Payment items related to payment. You must send at least one payment item and the sum of prices must be equal to the price
field.
Additional parameters related to payment
WorldPay installment information. If not sent, payment processed as pos commission settings
Parameters that can be sent for Fraud check. (See. Fraud Check Parameters)
Response Parameters
The parameters returned as a result of the payment transaction with World Pay are subject to the rules specified in the
Response Formats section of the API documentation home page. In the absence of a systematic or
fictional error, the sub-parameters of the object returned in the data
parameter are as follows:
Available for web flow. WorldPay HTML that will be shown to user. Return value must be base64-decoded.
ID of the payment
Show html content to customer when status SHOW_HTML_CONTENT
Additional information about payment.
Parameters Forwarded to Callback URL
The following parameters are forwarded as form variables using the HTTP POST method. The parameters included in the
request to callbackUrl
by Craftgate after validation are as follows:
Represents World Pay verification status. Returns SUCCESS
or FAILURE
.
Value of theconversationId
parameter sent in the payment initiation
ID of the payment which is sent when the verification is successful.
Sent as a parameter, n case the bank or end user triggers the 3DS verification step again and the payment has been verified before. Status parameter will be FAILURE
and callbackStatus parameter will be ALREADY_RETURNED
. In case this field comes with the value of ALREADY_RETURNED
, the status of the payment should be checked in your system and no action should be taken if it is completed.
Returns this security parameter when response status success. Need to send this value in complete step.
Response parameters hash value with Sha-256 Hex algorithm. You can find details below on "Creating Hash Value".
Creating Hash Value
You can make hash validation response with your hash value. You need to use Sha-256 Hex Algorithm to create hash value.
- You can reach 32 characters key value from following: Merchant Panel -> Yönetim -> Üye İşyeri Ayarları -> "Üye İşyeri Callback Key"
- You need to prepare input value as in order. Also you need to put "###" as delimiter between parameters.
- For null values please put empty string ("").
threedSecureCallbackKey###status###paymentId###conversationData###conversationId###callbackStatus
Example of hashing procedure for following response is below. Assume that Üye İşyeri Callback Key value as "merchantCallbackKeySandbox".
{
"status": "SUCCESS",
"conversationId": "d1811bb0-25a2-40c7-ba71-c8b605259611",
"paymentId": 317832,
"callbackStatus": null,
"conversationData": null,
"hash": "919401dcdd7f45bb258759d783e7e88d2ea60144925fb90520ad78e64eb5b427"
}
Input value for hashing should be like:
TjaHHdMbguUSonMEUr4tR42IC0UEtHPb###SUCCESS###317832######d1811bb0-25a2-40c7-ba71-c8b605259611###
You can hash this value via Sha-256 Hex algorithm with Üye İşyeri Callback Key value. Result must be equal with hash value which contains in response.
Sample Codes
You can review the sample codes in the open source Craftgate API clients.
Payment initiation with YKB WorldPay
YKB WorldPay Payment Complete
For APP2APP flow, after bank redirection this service should be calling from merchant. Then payment finishes.
URL
The endpoint and http method information used to complete POS APM payment are stated below.
Complete Payment Request Params
POS APM Ödeme başlatma isteğinin cevabında yer alan ödeme ID değeri
Response Parameters
Parameters returned as a result of payment are also subject to the rules specified in
the Response Formats section of the API documentation home page. In the absence of a systematic
or fictional error, the sub-parameters of the object returned in the data
parameter are as follows:
ID of the payment.
The date that payment is created
Basket price of the payment
Paid price of the payment
Wallet price of the payment
Buyer member ID of the payment
Installment number
Value of theconversationId
parameter sent in the payment request
externalId
value that sent in payment request by merchant
See: Payment Types
See: Payment Status
paymentChannel
value sent by the merchant in the payment request
Indicates whether the payment is 3D Secure payment
Interest rate to calculate paid price that buyer will pay
Interest amount. Equal to the difference between paidPrice
and price
values
Bank commission rate
Bank commission rate amount
Card user key that represents the card holder.
Card token that represents the card.
Indicates whether the payment was made with a stored card
Exist for the payments fully or partially collected from the card. First 8 digits of the card
Exist for the payments fully or partially collected from the card. Last 4 digits of the card
Card holder name surname
Card holder name surname retrieved from bank. The return value might be null for PF poses
authCode value retrieved from bank related to the payment. The return value might be null for PF poses
hostReference value retrieved from bank related to the payment
transId value retrieved from bank related to the payment. The return value might be null for PF poses
orderId value retrieved from bank related to the payment
Card Association
Brand of card. Exist for the payments fully or partially collected from the card
Value of theposAlias
parameter sent in the payment request
POS info that payment is received
Loyalty info that used in payment (See: Reward Usage)
Fraud Check Id if fraud rule matches (See: Fraud Checks)
Fraud Check Action if fraud rule matches (See: Fraud Actions)
It includes the transaction information sent when making the payment request, and the pricing and money transfer information of the payment based on these transactions
Additional data related to the payment
Sample Codes
You can review the sample codes in the open source Craftgate API clients.