Apple Pay Direct Payment Request
PayTabs provides you with a collection of API endpoints which used to process all payments, regardless of if they are through either your own payment pages, the managed payment pages, or if you are using the hosted payment pages.
Be Aware Of
Be aware that Apple Pay MUST be enabled in your PayTabs profile in order to perform any payments using it, so kindly make sure to contact [email protected] or your account manager requesting to enable Apple Pay.
This guide is dedicated to the clarification of how you can integrate with Apple Pay wallet directly to be used on your own mobile application or even our Managed Form and Own Form. There are multiple ways to use Apple Pay, for easy-to-use integration, and even more easy implementation for developers.
Tip
For a better understanding, you can checkHow to integrate the ApplePay Payment Method?this is a highly recommended step.
The Endpoint and Related Postman Collectionβ
In this tutorial, we will rely on the ApplePay API Endpoint, mentioned on PayTabs API endpoints postman collection, which you can access fromPayTabs Postman APIs Collection. The endpoint will need to be accessed with a POST request on the below-mentioned URLPOST | {{domain}}/payment/request |
---|
Be Aware Of
Please note that not using the proper endpoint URL {domain} will lead to authentication issues within your responses. To find the your proper domain you can read ourWhat is my (Region)/(endpoint URL)?tutorial article.
- KSA
- UAE
- Egypt
- Oman
- Jordan
- Kuwait
- Global
https://secure.paytabs.sa/payment/request
https://secure.paytabs.com/payment/request
https://secure-egypt.paytabs.com/payment/request
https://secure-oman.paytabs.com/payment/request
https://secure-jordan.paytabs.com/payment/request
https://secure-kuwait.paytabs.com/payment/request
https://secure-global.paytabs.com/payment/request
Request Parametersβ
To initiate a direct payment request using this endpoint, there are minimum required parameters that need to be passed with valid information. The specification of both required parameters and all the other optional parameters/features that can be used are clarified below:- The Minimum Required Parameters
- The Available Optional Parameters
Parameter | Data Type | Min | Max | Required |
---|---|---|---|---|
| INT | Accept only valid profile number. | β | |
The merchant Profile ID you can get from your PayTabs dashboard. For more information please check our How to get your account information from PT2 Dashboard? solution article. To know more about this parameter please click here. | ||||
| ||||
| INT | Valid string from this enum list: sale auth void release capture refund register | β | |
The identification of the type of the transaction. To know more about these types please check our What is the "tran_type" (transaction type)? solution article. To know more about this parameter please click here. | ||||
| ||||
| STRING | Valid string from this list ecom recurring moto | β | |
The identification of the category/class this transaction will follow, such as eCommerce, Recurring, etc. To know more about these types please check our What is the "tran_class" (transaction class)? solution article. To know more about this parameter please click here. | ||||
| ||||
| STRING | 1 | 64 | β |
Indicates the cart/order id at the merchant end, to easily relate the PayTabs transaction to. To know more about this parameter please click here. | ||||
| ||||
| STRING | 1 | 128 | β |
Indicates the cart/order description at the merchant end, to easily relate the PayTabs transaction to. To know more about this parameter please click here. | ||||
| ||||
| STRING | 1 | 128 | β |
Indicates the transaction currency, which the customer will be charged with. To know more about this parameter please click here. | ||||
| ||||
| DECIMAL | 0.01 | 9999999999.99 | β |
Indicates the amount of the transaction the customer is about to be charged. Both min and max values are subjected to the merchant transaction limits. To know more about this parameter please click here. | ||||
| ||||
| Object | β | ||
Indicates the customer details for this payment. If provided, the payment page will be prefilled with the provided data. To know more about this parameter please click here. | ||||
| ||||
Nested Parameter | Data Type | Min | Max | Required |
| STRING | 3 | 128 | β |
| STRING | N/A | N/A | β |
| STRING | N/A | N/A | β |
| STRING | 3 | 128 | β |
| STRING | 3 | 128 | β |
| STRING | 2 | 2 | β |
| STRING | N/A | N/A | β |
| STRING | N/A | N/A | β |
| Object | N/A | β | |
An object that contains the user's payment credentials. | ||||
| ||||
Nested Parameter | Data Type | Min | Max | Required |
| Object | N/A | N/A | β |
Information about the card used in the transaction. | ||||
| ||||
Nested Parameter | Data Type | Min | Max | Required |
| String | N/A | N/A | β |
A string, suitable for display, that is the name of the payment network backing the card. | ||||
| ||||
| String | N/A | N/A | β |
A string, suitable for display, that is the name of the used card type. | ||||
| ||||
| String | N/A | N/A | β |
A string, suitable for display, that describes the card. | ||||
| ||||
| STRING | N/A | N/A | β |
A unique identifier for this payment. | ||||
| ||||
| Object | N/A | N/A | β |
An object containing the encrypted payment data. | ||||
| ||||
Nested Parameter | Data Type | Min | Max | Required |
| String | N/A | N/A | β |
Encrypted payment data You may need to check the $1 for the decrypted payment data keys and values. | ||||
| ||||
| String | N/A | N/A | β |
Signature of the payment and header data The signature includes the signing certificate, its intermediate CA certificate, and information about the signing algorithm. | ||||
| ||||
| Object | N/A | N/A | β |
Additional version-dependent information you use to decrypt and verify the payment You may need to check $1 . | ||||
| ||||
Nested Parameter | Data Type | Min | Max | Required |
| String | N/A | N/A | β |
Hash of the X.509 encoded public key bytes of the merchantβs certificate. | ||||
| ||||
| String | N/A | N/A | β |
Ephemeral public key bytes EC_v1 ONLY. | ||||
| ||||
| String | N/A | N/A | β |
Transaction identifier, generated on the device. | ||||
| ||||
| String | N/A | N/A | β |
Version information about the payment token The token uses EC_v1 for ECC-encrypted data and RSA_v1 for RSA-encrypted data. | ||||
|
Parameter | Data Type | Min | Max | Required |
---|---|---|---|---|
| STRING | N/A | 255 Characters (Valid URL) | β |
The callback response is a server-to-server POST response that is sent (to a pre-defined HTTPS URL) with the full detailed transaction information once the payment process has ended (whether the customer cancels, paid, or failed to pay). It does not depend on the customer's actions; the response will be sent anyway. What is the Return URL vs the Callback URL? To know more about this parameter please click here. | ||||
| ||||
| Object | β | ||
Indicates the customer shipping details for this payment. If provided, the payment page will be prefilled with the provided data.. | ||||
| ||||
Nested Parameter | Data Type | Min | Max | Required |
| STRING | 3 | 128 | β |
| STRING | N/A | N/A | β |
| STRING | N/A | N/A | β |
| STRING | 3 | 128 | β |
| STRING | 3 | 128 | β |
| STRING | 2 | 2 | β |
| STRING | N/A | N/A | β |
| STRING | N/A | N/A | β |
| Object | β | ||
For more customizations, you can pass to the Transaction API request your own "user-defined fields" up to 9 fields, and accordingly, you would receive those fields in the callback response. To know more about this parameter please click here. | ||||
| ||||
Nested Parameter | Data Type | Min | Max | Required |
| STRING | 1 | 255 | β |
| STRING | 1 | 255 | β |
| STRING | 1 | 255 | β |
| STRING | 1 | 255 | β |
| STRING | 1 | 255 | β |
| STRING | 1 | 255 | β |
| STRING | 1 | 255 | β |
| STRING | 1 | 255 | β |
| STRING | 1 | 255 | β |
Request & Response Payload Samplesβ
This section is dedicated give you a sample API request payload using the above mentioned required parameters, along with showing you the response payload received upon using the request payload.- Required Parameters Sample Payloads
- Required Parameters Sample Payloads
The below sample request payload will show you how you can pass the above-mentioned required parameter/s, which are needed to be passed with valid values to perform a request. Along with the response payload received after using this request payload.
- Sample Request Payload
- Sample Response Payload
{
"profile_id": 47125,
"tran_type": "sale",
"tran_class": "ecom",
"cart_id": "cart_88888",
"cart_description": "Sample Payment",
"cart_currency": "{{currency}}",
"cart_amount": "1",
"return": "none",
"customer_details": {
"name": "John Smith",
"email": "[email protected]",
"street1": "404, 11th st, void",
"city": "Dubai",
"country": "AE",
"phone": "97333333101",
"ip": "99.99.00.00"
},
"apple_pay_token": {
"paymentMethod": {
"network": "Visa",
"type": "Debit",
"displayName": "Visa 4228"
},
"transactionIdentifier": "D32A2C43FCC4314A668FFDB95B0F38D0BEF0B2F6AC8569CC433607BA51D25301",
"paymentData": {
"data": "P\/l0iLnWAj393LZyMjdblyJHo8zUrAv2i73tcSnFkLDCFkuk35oh5+CCA7G6rBFXD0O6iu3kS3cE+yW3uhS88vI7jqMMG4bnJ0GdJUckJ6P7o++IurHG0bIHhOlu8gqL\/1Bd73sHAKp4eK8GRQ0muRQGPwpTUf82J6mvntA\/QhQ3b4Bd2ycn0N5T31XA8okVdNi++8TBuFgflz+61arcrtd7cIQ2lHmqOSk65qV\/EdxpOGAzEjnexgk640cvvfp0rufusssFsgNeW\/0sWniqWqmF64XeA3W2W6rlFThtYOjivbkjeB5fpZaa+fVYKehOF9v4z0\/XENOmVzLFVUqS\/Ba2NKeuMeBt3uporjg4o7rWaguCubz73qYkxSs+KxULy9b+yn692RvarmlNiE92dQ6XIAX1ASUAtMktYNU9nPg=",
"signature": "MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIID5jCCA4ugAwIBAgIIaGD2mdnMpw8wCgYIKoZIzj0EAwIwejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMC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/9Bft2Q91TaKOvvGcgV5Ct4n4mPebWZ+Y1UENj53pwv4CMDIt1UQhsKMFd2xd8zg7kGf9F3wsIW2WT8ZyaYISb1T4en0bmcubCYkhYQaZDwmSHQAAMYIBjDCCAYgCAQEwgYYwejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTAghoYPaZ2cynDzANBglghkgBZQMEAgEFAKCBlTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yMDA2MTYwOTQ5MDlaMCoGCSqGSIb3DQEJNDEdMBswDQYJYIZIAWUDBAIBBQChCgYIKoZIzj0EAwIwLwYJKoZIhvcNAQkEMSIEILdZb7ICrNx5ZgvQt3OlTdlF57svjNEbx7YslS+w4DPyMAoGCCqGSM49BAMCBEcwRQIgZFY0mdI63DwtrciRA3xRWPCL+QD2KXPWPUC8b2azEKkCIQCb90ECiwGTt4TOm194OCo9wusSNlZipzmy1XBPohv8sAAAAAAAAA==",
"header": {
"publicKeyHash": "dQ1T3uh4uMRK7OAynypjLF7V9NWdL49JVKIHU+jDsww=",
"ephemeralPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEcPy\/H\/285E6ruf9Y4Yn3D41MdtLFRqdGVPoXr6wWpWk\/cBr31AZSVWCorIu4HT92GNy5efMcinrAyev2Mwy+zg==",
"transactionId": "d32a2c43fcc4314a668ffdb95b0f38d0bef0b2f6ac8569cc433607ba51d25301"
},
"version": "EC_v1"
}
}
}
{
"tran_ref": "TST2222801314561",
"merchant_id": 31237,
"profile_id": 47125,
"cart_id": "cart_88888",
"cart_description": "Sample Payment",
"cart_currency": "EGP",
"cart_amount": "1",
"tran_currency": "EGP",
"tran_total": "133.00",
"tran_type": "Sale",
"customer_details": {
"name": "John Smith",
"email": "[email protected]",
"street1": "404, 11th st, void",
"city": "Dubai",
"country": "AE",
"phone": "97333333101",
"ip": "99.99.00.00"
},
"payment_result": {
"response_status": "A",
"response_code": "G43489",
"response_message": "Authorised",
"acquirer_message": "00:Approved",
"acquirer_rrn": "220210096025",
"transaction_time": "2022-08-16T09:51:29Z"
},
"payment_info": {
"payment_method": "ApplePay",
"card_type": "Debit",
"card_scheme": "Visa",
"payment_description": "Visa 4228",
"expiryMonth": 12,
"expiryYear": 2023
},
"serviceId": 2
}
The below sample request payload will show you how you can pass the above-mentioned required parameter/s, which are needed to be passed with valid values to perform a request. Along with the response payload received after using this request payload.
- Sample Request Payload
- Sample Response Payload
{
"profile_id": 47125,
"tran_type": "sale",
"tran_class": "ecom",
"cart_id": "cart_88888",
"cart_description": "Sample Payment",
"cart_currency": "{{currency}}",
"cart_amount": "1",
"return": "none",
"customer_details": {
"name": "John Smith",
"email": "[email protected]",
"street1": "404, 11th st, void",
"city": "Dubai",
"country": "AE",
"phone": "97333333101",
"ip": "99.99.00.00"
},
"apple_pay_token": {
"paymentMethod": {
"network": "Visa",
"type": "Debit",
"displayName": "Visa 4228"
},
"transactionIdentifier": "D32A2C43FCC4314A668FFDB95B0F38D0BEF0B2F6AC8569CC433607BA51D25301",
"paymentData": {
"data": "P\/l0iLnWAj393LZyMjdblyJHo8zUrAv2i73tcSnFkLDCFkuk35oh5+CCA7G6rBFXD0O6iu3kS3cE+yW3uhS88vI7jqMMG4bnJ0GdJUckJ6P7o++IurHG0bIHhOlu8gqL\/1Bd73sHAKp4eK8GRQ0muRQGPwpTUf82J6mvntA\/QhQ3b4Bd2ycn0N5T31XA8okVdNi++8TBuFgflz+61arcrtd7cIQ2lHmqOSk65qV\/EdxpOGAzEjnexgk640cvvfp0rufusssFsgNeW\/0sWniqWqmF64XeA3W2W6rlFThtYOjivbkjeB5fpZaa+fVYKehOF9v4z0\/XENOmVzLFVUqS\/Ba2NKeuMeBt3u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Xr6wWpWk\/cBr31AZSVWCorIu4HT92GNy5efMcinrAyev2Mwy+zg==",
"transactionId": "d32a2c43fcc4314a668ffdb95b0f38d0bef0b2f6ac8569cc433607ba51d25301"
},
"version": "EC_v1"
}
}
}
{
"tran_ref": "TST2222801314561",
"merchant_id": 31237,
"profile_id": 47125,
"cart_id": "cart_88888",
"cart_description": "Sample Payment",
"cart_currency": "EGP",
"cart_amount": "1",
"tran_currency": "EGP",
"tran_total": "133.00",
"tran_type": "Sale",
"customer_details": {
"name": "John Smith",
"email": "[email protected]",
"street1": "404, 11th st, void",
"city": "Dubai",
"country": "AE",
"phone": "97333333101",
"ip": "99.99.00.00"
},
"payment_result": {
"response_status": "A",
"response_code": "G43489",
"response_message": "Authorised",
"acquirer_message": "00:Approved",
"acquirer_rrn": "220210096025",
"transaction_time": "2022-08-16T09:51:29Z"
},
"payment_info": {
"payment_method": "ApplePay",
"card_type": "Debit",
"card_scheme": "Visa",
"payment_description": "Visa 4228",
"expiryMonth": 12,
"expiryYear": 2023
},
"serviceId": 2
}
The Payment Flow Experienceβ
Reaching this point, you are now able to initiate an ApplePay payment via the direct API request, the payment flow would vary than the normal payment flow you would be used to so hereβs how it works:- Triggering Apple Pay Wallet: When the customer clicks the Apple Pay βPAYβ button, the Apple Pay wallet will pop up on the operating system.
- Selecting a Card: The customer must select one of the saved cards in the wallet to initiate the payment.
- Generating Apple Pay Token: Upon card selection, a request is sent to Apple Pay, which returns the necessary token parts required by the PayTabs Apple Pay Payment request endpoint.
- Initiating Payment: The payment is initiated using the token sent from the merchantβs server to the PayTabs server.
Tip
For a detailed understanding of the flow, refer to the Apple Pay documentation.
As a Summary of Payment Flow:
- The Apple Pay button triggers the Wallet Screen to pop up.
- Selecting a card returns an applepay_token.
- The applepay_token is sent to the merchantβs server side.
- The merchantβs server makes the Apple Pay payment request.
Tip
Please note that requesting the token and Apple Pay details from the Apple Pay side is beyond the scope of PayTabs. However, we recommend referring to the following documentation for guidance on the Apple side: