Apple Pay

Learn how to accept Apple Pay payments.

Apple Pay provides a secure and seamless payment method that you can offer in-app, in-store, and on the web. Apple Pay uses network tokenization, stores payment information securely in the shopper's Apple Pay eligible device, and confirms the payment through Touch ID or Face ID authentication.

payabl. helps merchants to carry out Apple Pay transactions in an easy way, by providing Apple Pay via payabl. hosted payment page.

It can be carried out via payabl. in two ways:

  • Direct integration - you receive redirection links and forward customers
  • Iframe - customers are redirected by payabl.
Payment typeWallets
CountriesArgentina, Armenia, Australia, Austria, Azerbaijan, Bahrain, Belgium, Brazil, Bulgaria, Canada, China mainland, Colombia, Costa Rica, Croatia, Cyprus, Czechia, Denmark, El Salvador, Estonia, Faroe Islands, Finland, France, Georgia, Germany, Greece, Greenland, Guatemala, Guernsey, Honduras, Hong Kong, Hungary, Iceland, Ireland, Isle of Man, Israel, Italy, Japan, Jersey, Jordan, Kazakhstan, Kuwait, Latvia, Liechtenstein, Lithuania, Luxembourg, Macao, Malaysia, Malta, Mexico, Moldova, Monaco, Montenegro, Morocco, Netherlands, New Zealand, Norway, Palestine, Panama, Peru, Poland, Portugal, Qatar, Romania, San Marino, Saudi Arabia, Serbia, Singapore, Slovakia, Slovenia, South Africa, Spain, Sweden, Switzerland, Taiwan, Ukraine, United Arab Emirates, United Kingdom, United States, Vatican City, Vietnam
Customer currenciesMultiple
Processing currenciesMultiple
One-time paymentYes
ChargebacksYes
RefundsYes
PayoutsYes

🚧

Sandbox testing

To process tests on sandbox your Apple Developer account needs to be configured for Apple Pay.
You may find more information on developer.apple.com website
payabl. allows to avoid testing stage, we will enable the Apple Pay feature on production upon a request.

📘

Subscription

To make a subscription for this method use Credentials on File (tokenization).
The initial request is sent to /applepay_init link and follow-up transactions need to be sent to the authorization /payment_authorize link.

General flow

POST Request -> to /applepay_init
<- Response (direct, synchronous) with status=0&errormessage= = (empty) and redirect_url
Customer is redirected to redirect_url for applepay
<- HTML response with status=0 (or decline) to return_url
<- Callback (asynchronous) with errorcode = 0 to notification_url

Does the device support Apple Pay?

You can check if Apple Pay is supported on end customers browser or other device, using the following snippet

<pre class="wp-block-code"><code>document.addEventListener('DOMContentLoaded', () =&gt; {
  if (isApplePayAvailable()) {
    // show apple pay option
  } else {
    // Apple pay is not supported
  }
});

/**
* check if apple pay is supported or not
*/
function isApplePayAvailable() {
  var unavailable = false;
  unavailable = unavailable || !window.ApplePaySession;
  if (!unavailable) {
    var promise = ApplePaySession.canMakePaymentsWithActiveCard(MERCHANT_ID);
    promise.then(function(canMakePayments) {
      return unavailable = unavailable || !!canMakePayments;
    });
  }
  return !unavailable;
};

Detailed flow

POST https://sandbox.payabl.com/pay/payment/applepay_init

Include in the applepay_init payment request:

ParameterFormatDescription
merchantid40 charactersMerchant identification number assigned during account creation
orderidmax. 40 charactersThe field orderid is optional and exclusively for the merchants' convenience
amountdigits only, either no decimals or two decimal places (e.g. 8 or 8.50)Transaction’s total amount that will be deducted from the customer
currency3 characters. ISO 4217The currency field contains the alpha-3 currency code for the transaction. Links to ISO
payment_method119payabl. Payment methods IDs
signature40 charactersSignature Calculation
emailmax. 50 charactersCustomer email. An RFC 822 compliant email address
firstnamemax. 50 charactersFirst name of the customer
lastnamemax. 50 charactersLast name of the customer
url_returnmax. 255 characters starting with http or httpsURL for customer redirection

You can see the full list of parameters in Authorization .

See test credentials here: Testing credentials for Payment methods

Request example:

merchantid=applepay_test&orderid=Payabl-Test&amount=9.99&currency=EUR&[email protected]&language=en&firstname=John&lastname=Doe&
payment_method=119&zip=3035&street=Olympion&house=23&city=Limassol&country=CYP&url_return=https://yourshop.example/thank_you&
notification_url=https://yourshop.example/notification&customerip=2.22.75.244&signature=d8d93bb191844cb79c577e7eae8608f22b715868

🚧

Public Sandbox information

Do not use your personal email address, Order ID with sensitive information, real customer details and credit card data in the public Sandbox. For email field you may use [email protected].

The payment gateway sends the merchant the response that includes the initiation URL (redirect_url parameter) for redirecting the customer ONLY if the merchant’s server received a successful response from the payment gateway after the applepay_init payment request.

Response example:

errorcode=0&errorcodes=&errormessage=&sessionid=92475a60e05e767cf3b7fd2dc849fb70d6a84bcc&transactionid=105103041&
redirect_url=https%3A%2F%2Fsandbox.payabl.com%2Fpay%2F92475a60e05e767cf3b7fd2dc849fb70d6a84bcc%2Fpayment%2Fapplepay

After the redirection, a customer will see the below screen:

After clicking the Apple Pay button a payment sheet will appear.

Once the transaction is authorized via fingerprint or face recognition or with a passcode, payment would start processing.

The last step will be the redirection of the customer back to the merchant site after the result of the payment attempt is flashed to the customer.

If the transaction was processed successfully, the end-customer will see on the screen the notification about the successful result and will be redirected to the merchant’s website via the url_return.

If the transaction failed and the error cannot be fixed by the customer (i.e. error from the bank “Authorization declined” or error from payment gateway “card temporary blocked for 20 min.”, etc.), the customer will be redirected to the merchant’s website by the url_return.

📘

Please note that we don't send callbacks for Apple Pay transactions by default. Please inform our technical support if you would like to enable them.

Notification URL can be configured by our tech support team in your account on our side,
or you can send it as a parameter notification_url in the initial request to applepay_init.

A notification will be sent to the notification_url provided in the initial request by the merchant.

Notification example:

timestamp=1684839652&orderid=Payabl-Test&transactionid=105103041&security=9eafa5722595ee24e6fbf4b5c2c49c0c0070
c78a35d8374325c7867aea5078009&errormessage=&type=capture&errorcode=0

Notification fields reference:

ParameterDescription
transactionidpayabl. internal transaction id. Please use this transaction id when referring to the transaction in communications with the payabl. team
typeTransaction type
errorcodeTransaction error code (0 for success)
errormessageBrief explanation of transaction decline reason (empty on success)
orderidOptional transaction identifier given by the merchant
securitySignature to verify the authenticity of the notification. You can find more information here
timestampNotification timestamp

If, while in the Apple Pay hosted payment page, the "Back to the shop" button is clicked then the customer will be redirected back to the merchant’s website via the url_return.

To repeat/retry the payment, the order must be submitted by you again.

Hosted Payment Page

For iframe, the initial request is the same as per our iframe section. Please see Payment page integration guide for more details.

On payabl. iframe an additional Apple Pay option would appear, by clicking on it end customer would be redirected to payabl. Apple Pay hosted payment page.

Refunds

Apple Pay supports refunds which can be initiated only on a successful captured transaction.
The request will send a credit note to the authorization system after the customer has already been charged. The refund amount will be credited to the customer and the merchant’s account will be charged.

The refund can be done in two ways:

  • Through API integration
  • Through payabl. dashboard

If you have API integration, you can check more in our documentation Refund.

Payouts

Apple Pay supports Payouts which can be performed via payabl. Dashboard interface (allowed only based on the original transaction ID) or via our API.

The payout request can be done in two ways:

  • with existing transaction-id received during original payment
  • with credit card info

For Payouts use payment_method=1

You can check more in our documentation CFT.


Our Technical Support team is there to help you:
Email: [email protected]
Available Monday – Friday between 09:00 and 17:00 CET/CEST