ClickPay provides you with multiple methods for using ApplePay, for easy-to-use integration, and even more easy implementation for developers.
for a better understanding, you can check What is ApplePay? this is a highly recommended step.
TABLE OF CONTENTS
Postman Endpoint Example
For the purposes of this article, you will need to use the following postman endpoint example for testing and integrating; for proceeding with this, please click here.
Payment Flow
Once the customer clicks on the ApplePay "PAY" button, this would trigger the ApplePay wallet on the OS to pop up. After that, the customer will have to choose one of the saved cards on the wallet to initiate the payment using it.
A request would be sent to ApplePay once the customer selects the card, which will return the ApplePay token parts that are required by ClickPay ApplePay Payment request endpoint. This would allow the payment to be initiated using the token sent from the merchant server side to the ClickPay side. Check the ApplePay documentation for a better understanding of the flow.
In other words, the payment flow of this endpoint is summarized as shown below:
- ApplePay button would trigger the Wallet Screen to Popup
- Choosing a card would return an apple_pay_token
- The applepay_token would be sent to the merchant server-side.
- Merchant server-side would make the ApplePay payment request.
ApplePay Payment
Sample Request Payload
As the payment page is on your side (merchant side), you must send a payment request using the transaction API after receiving the card details from your payment page. You will need to include the card and customer details in the payment request.
Post | {{domain}}/payment/request |
Sample Response Payload
{
"tran_ref": "TST2222801314561",
"merchant_id": 31237,
"profile_id": 47125,
"cart_id": "cart_88888",
"cart_description": "Sample Payment",
"cart_currency": "SAR",
"cart_amount": "1",
"tran_currency": "SAR",
"tran_total": "133.00",
"tran_type": "Sale",
"customer_details": {
"name": "John Smith",
"email": "[email protected]",
"street1": "404, 11th st, void",
"city": "Riyadh",
"country": "SA",
"phone": "96633333101",
"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
}