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

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

In the applepay_init payment request.

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

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.
  • payment_method: The payment method from which will payout will be done.
  • 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.
  • 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 Pre-Authorization .

Request example

https://sandbox.powercash21.com/pay/payment/applepay_init&amp;merchantid=syed&amp;amount=1.23&
amp;currency=USD&amp;orderid=Powercash21-Test&amp;language=en&amp;gender=M&amp;lastname=Mann&
amp;street=An+der+Welle+4&amp;zip=60322&amp;city=Frankfurt&amp;country=DEU&amp;customerid=&
amp;salutation=Herr&amp;title=&amp;firstname=Muster&amp;company=Powercash21&amp;birthday=07071971&
amp;house=19&amp;postbox=&amp;state=HE&amp;email=test%40inatec.com&amp;phone=XXXXXXXXXX8501&
amp;fax=&amp;mobile=&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%2Fsandbox.powercash21.com%2Fpay%2F4720e00f4ec81926e90bfa3783cec8219c98adef%2Fpayment%2Fapplepay

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.

https:sandbox.powercash21.com/pay/4720e00f4ec81926e90bfa3783cec8219c98adef/payment/applepay

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

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.

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.


Did this page help you?