Rootline enables you to accept Apple Pay on the web using Rootline’s checkout.
Apple Pay offers customers a seamless checkout on compatible devices. When the customer clicks the Apple Pay button, they are presented with the Apple Pay Payment sheet. In this Payment Sheet the customer can select their preferred card and confirm the payment with Face ID, Touch ID or their passcode. Apple Pay is PSD2 SCA compliant.
Rootline supports Mastercard, Maestro, Visa and Vpay on Apple Pay.
An Apple Pay payment requires a capture call to collect the authorized amount from the customer’s card.
Seamless redirect from your website to process Apple Pay
Redirect the customer directly to Rootline to start the Apple Pay payment process. To only display Apple Pay as an payment method in the Rootline checkout you will need to provide the display_payment_methods
field in the payments request and set it to ["applepay"]
. If display_payment_methods
is not set, all payment methods will be shown.
Example request:
{
"account_id": "acc_12347Sifdo36cdycbsw4Pum",
"amount": {
"currency": "EUR",
"quantity": "20.00"
},
"reference": "test_reference",
"statement_descriptor":"Bank statement text",
"return_url":"https://www.my_return_url.com",
"display_payment_methods" : ["applepay"]
}
The API will return a next_action
object with a checkout_url
.
{
"payment_id": "pmt_UXRFkdU6kdAtO6ceGdxmW",
"created_at": "2023-09-12T08:22:25.864452Z",
"account_id": "acc_12347Sifdo36cdycbsw4Pum",
"reference": "test_reference",
"amount": {
"currency": "EUR",
"quantity": "20.00"
},
"checkout_status": "open",
"authorizations": [],
"authentications": [],
"next_action": {
"checkout_url": "http://payment-api.rootline.com/payments/pmt_UXRFkdU6kdAtO6ceGdxmW/checkout"
},
"statement_descriptor":"Bank statement text",
"return_url": "https://www.my_return_url.com",
"display_payment_methods" : ["mastercard]
}
Redirect the customer to the checkout_url
that Rootline provides.
Capture an Apple Pay payment
When an Apple Pay payment has succeeded, you now have an authorized or reserved amount on the customer’s card. To collect the authorized funds from your customer’s bank account you need to capture the payment. We suggest that you capture the payment when the service has rendered or the goods have been shipped.
To capture the payment you need to send a request to the Payments API /payments/{payment_id}/capture
{
"reference": "your_reference"
}
The API response will give you a capture ID.
{
"id": "cap_XRhfaT3KvQoUR9D4BevMU",
"object": "capture",
"created_at": "2024-10-21T14:43:10.258222Z",
"reference": "your_reference"
}
Rootline will schedule the capture. Once the capture is successfully scheduled, you will receive the capture.scheduled webhook with the capture ID from the API response. You can consider the capture request to be successful at this point, and Rootline will send the request through the network to the customer’s bank.
Cancel and refunds
A payment can be canceled when the payment succeeded with an approved authorization attempt, and when it has not been captured yet.
After the payment is captured, the funds will be transferred out of the customer’s account. To reverse that, you will need to make a refund call on the payment.
Cancel an Apple Pay payment
You can cancel an Apple Pay payment in case the service or goods can’t be fulfilled and the payment has not been captured yet.
To cancel the payment you need to send a request to the Payments API /payments/{payment_id}/cancel
{
"reference": "your_reference"
}
The API response will give you a cancel ID.
{
"id": "can_XRhfaT3KvQoUR9D4BevMU",
"object": "cancel",
"created_at": "2024-10-21T14:43:10.258222Z",
"reference": "your_reference"
}
Rootline will schedule the cancel request. Once Rootline scheduled the cancel successfully you will receive the cancel.scheduled webhook with the cancel ID from the API response.
Refund an Apple Pay payment
Once a payment is captured and you need to refund the payment you will be able to do so using the Payments API /payments/{payment_id}/refund
{
"reference": "your_reference"
}
The API response will give you a refund ID.
{
"id": "ref_XRhfaT3KvQoUR9D4BevMV",
"object": "refund",
"created_at": "2024-10-21T15:05:04.836408Z",
"reference": "your_reference"
}
Rootline will schedule the refund request. Once Rootline scheduled the refund successfully you will receive the refund.scheduled webhook with the refund ID from the API response.
Statement descriptor
The statement descriptor has a maximum length of 22 characters.
The statement descriptor starts with “RTL*” followed by your merchant name and the statement descriptor you can provide with the payment request. Characters exceeding the character limit will not be shown on the statement descriptor.
Example of a statement descriptor:
"RTL*MerchantName MyStatementDescriptor" has a length of 38 characters.
For Apple Pay payments the customer will see “RTL*MerchantName MySta” on their statement.
Testing Apple Pay
To test Apple Pay on the staging environment you need an Apple Pay compatible device and a Sandbox Tester Account, more details can be found on Apple’s Developer website.