Skip to main content
Version: 1.0.0

App

Apple Pay purchase operation

To make purchase with Apple Pay from App, you need to send request Merchant Validation and Order Creation, and then send request Payment confirmation Apple Pay.

Merchant Validation and Order Creation (api/apple/validate)

Production url: https://****.procard-ltd.com/api/apple/validate

POST parameters:

ParameterTypeDescriptionValue
operationStringType of transactionPurchase
merchant_idStringMerchant identifier
amountFloatThe amount of the transaction. Example 500.00
signatureStringIn order to confirm the validity of the data, a verification signature must be generated and transmitted in the HMAC_SHA512 request using the SecretKey merchant.
The string to be HMAC_SHA512 is generated by concatenating the parameters merchant_id, order_id, amount, currency_iso, description separated by “;” (semicolon) in UTF-8 encoding.
The order of parameters during concatenation is important!
order_idStringUnique transaction number on the merchant side. If the operation is duplicated, the merchant receives an error.
currency_isoStringCurrency of paymentUAH
descriptionStringPurpose of payment. It is displayed on the payment page when entering payment details. Displayed in the account statement and registries
add_paramsArrayAn array with additional parameters. Additional parameters are then returned to the merchant in a callback call
callback_urlStringURL to which information about the result of the payment will be sent

The following parameters come in response:

ParameterTypeDescription
order_keyIntegerOrder ID in the payment system
codeStringAnswer code (0 - success)
messageStringDecoding of the response code

Payment confirmation Apple Pay (api/apple/payment)

Production url: https://****.procard-ltd.com/api/apple/payment

The system itself determines which authentication path goes with or without 3DS depending on the data received from Apple.

POST parameters:

ParameterTypeDescription
order_keyStringOrder ID in the payment system
apple_pay_payment_dataStringBase64 encoded Apple Pay payment token
apple_pay_payment_data_decryptedStringThe parameter is passed instead of apple_pay_payment_data if payment with a decrypted token is used. Base64 encoded Apple Pay payment token

The answer comes:

ParameterTypeDescriptionValue
transactionStatusStringTransaction StatusApproved - Successfully
Declined - Renouncement
reasonStringText reason for rejection
reasonCodeStringFailure Error Code
rrnStringReference Retrieval Number

After calling this method, a callback comes to the backend trader.

Request for payment with decrypted token example:

{
"order_key": "9910ae2538be76b828f63a08f14ddf4a267d5148713cb2bb2742848fd622cfd266d86cab7f44b",
"apple_pay_payment_data_decrypted": "ewoiYXBwbGljYXRpb25QcmltYXJ5QWNjb3VudE51bWJlciI6ICI0MDEyMDAwMDAwMDAzMTE5IiwKImFwcGxpY2F0aW9uRXhwaXJhdGlvbkRhdGUiOiAiMjgxMTMwIiwKImN1cnJlbmN5Q29kZSI6ICI5ODAiLAoidHJhbnNhY3Rpb25BbW91bnQiOiAxMDAwMCwKImRldmljZU1hbnVmYWN0dXJlcklkZW50aWZpZXIiOiAiMDQwMDEwMDMwMjczIiwKInBheW1lbnREYXRhVHlwZSI6ICIzRFNlY3VyZSIsCiJwYXltZW50RGF0YSI6ewoib25saW5lUGF5bWVudENyeXB0b2dyYW0iOiIxMjMiLAoiZWNpSW5kaWNhdG9yIjoiNSIKfQp9Cg=="
}

Decrypted token structure:

ParameterTypeDescription
applicationPrimaryAccountNumberStringThe tokenized card number
applicationExpirationDateStringExpiration date of the card (YYMMDD format)
currencyCodeStringCurrency of payment
transactionAmountFloatThe amount of the transaction. Example 500.00
deviceManufacturerIdentifierStringUnique identifier for the device manufacturer
paymentDataTypeStringType of payment data
paymentData
onlinePaymentCryptogramStringA cryptogram for secure online transactions
eciIndicatorStringElectronic Commerce Indicator, shows the security level of the transaction

Decrypted token example:

{
"applicationPrimaryAccountNumber": "4012000000003119",
"applicationExpirationDate": "281130",
"currencyCode": "980",
"transactionAmount": 10000,
"deviceManufacturerIdentifier": "040010030273",
"paymentDataType": "3DSecure",
"paymentData": {
"onlinePaymentCryptogram": "123",
"eciIndicator": "5"
}
}