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
CountriesInternational
Customer currenciesMultiple
Processing currenciesMultiple
Settlement currenciesEUR
One-time paymentYes
ChargebacksYes
RefundsYes

🚧

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 step, we will enable your Prod ApplePay feature 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

Direct integration

Four easy steps for implementing the Apple Pay direct integration

  • Send initialization request (applepay_init).
  • Capture the “redirect_url” from the “applepay_init” request’s post response.
  • Use “redirect_url” to redirect the end customer.
  • Process the transaction’s final response.

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.powercash21.com/pay/payment/applepay_init

In the applepay_init payment request.

The payment gateway should receive from the merchant’s server all required and optional parameters for processing the payment:

  • merchantid: The merchant identification number.
  • amount: The amount field contains the transaction’s total amount. This is the amount that will be transmitted to the authorizing system.
  • currency: The currency field contains the alphanumeric currency code for the transaction, according to ISO 4217, e.g. EUR, USD, AUD, CAD, NOK, SEK, CHF.
  • signature: The signature field contains a 40-figure hexadecimal value. This signature value is a checksum designed to protect the merchant account from unauthorized access.
  • payment_method: for ApplePay it is 119
  • transactionid: Transaction id of an existing captured successful transaction
  • email: The customer's email.
  • language: This parameter determines the language in which pages will be shown valid values: de en. 
  • firstname: First name of the customer.
  • lastname: Last name of the customer.
    You can see a full list of parameters in Authorization .

See test credentials here: Testing credentials for Payment methods

Request example

https://sandbox.powercash21.com/pay/payment/applepay_init&amp;merchantid=syed&amp;amount=1.23&
amp;currency=USD&amp;orderid=payablTest&amp;language=en&amp;customerid=&amp;salutation=Herr&amp;title=&amp;email=test%40inatec.com&amp;;customerip=127.0.0.1&amp;url_return=http%3A%2F%2Fdev-sim-ng.inatec.local%2F%7Esimdad%2FInatecResponse%2Fredirect_response.php&
amp;url_success=http%3A%2F%2Fdev-sim-ng.inatec.local%2F%7Esimdad%2FInatecResponse%2Fsuccess.php&
amp;url_failed=http%3A%2F%2Fdev-sim-ng.inatec.local%2F%7Esimdad%2FInatecResponse%2Ffailed.php&
amp;notification_url=http%3A%2F%2F83.169.19.140%2Fsimulation%2Fbilling_response.php&
amp;signature=dd458addeb7d248d1f849429b1b07145aede71ee</code>

The payment gateway sends the merchant the response that includes the initial 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&amp;errorcodes=&amp;errormessage=&amp;sessionid=4720e00f4ec81926e90bfa3783cec8219c98adef&amp;transactionid=103589508&amp;redirect_url=https%3A%2F%powercash21.com%2Fpay%2F4720e00f4ec81926e90bfa3783cec8219c98adef%2Fpayment%2Fapplepay
389389

After clicking the Apple Pay button a payment sheet would appear (see below).

📘

Processing of Step 2 is possible ONLY if your server received a positive response from the payment gateway after the “initial” transaction.

After you received a response from payabl. and got positive to result from the payment gateway, your customer will be redirected immediately to the payabl. Apple Pay page for payment execution.

357357

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

330330

The last step for an apple pay Hosted Payment Page, will be to redirect the customer back to the merchant site after the result of the payment attempt is flashed to the customer.

391391

The transaction was processed successfully. In this case, 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 url_return.

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.). In this case, the customer will be redirected to the merchant’s website by the URL url_return.

In parallel, a notification would be received on the notification_url provided in the initial request by the merchant

While in apple pay hosted payment page for any reason if the back to the shop is clicked then the customer will be redirected back to the merchant’s website via the url_return URL.

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. iframes an additional Apple Pay option would appear, by clicking on it end customer would be redirected to payabl. Apple Pay hosted payment page.