====== Appley Pay Using XML ======
~~TOC~~
\\
Apple Pay Web helps users quickly and easily complete purchases on Apple Devices with the Safari browser, using cards stored in your Apple Wallet.
===== Availability =====
Apple Pay is enabled on the %Gateway for **TSYS Saratoga** and **Elavon** Processors only, and only customers from the following countries can use Apple Pay to make a transaction:
* - United States
* - United Kingdom
* - Canada
* - Australia
* - China
* - Singapore
* - Switzerland
* - France
* - Hong Kong
* - Russia
* - New Zealand
* - Japan
* - Ireland
* - Guernsey
* - Isle Of Man
* - Jersey
* - Taiwan
* - Italy, San Marino, Vatican City
* - Sweden
* - Denmark
* - Finland
* - UAE
* - Brazil
* - Germany, Netherlands, Poland (Late 2018)
===== Integrating =====
In this integration method you ned to implement a few steps:
**Step 01**: Certificate Setup
To process apple pay payments, you will need to set up the Apple Pay Certificates on your %Gateway Selfcare Terminal.
To do this, follow the instructions on **[[merchant:existing_merchant:selfcare_system:settings:apple_pay|Apple Pay Certificate]]** settings.
\\
**Step 02**: Integrate the Apple Pay JS API to your website
The merchant’s developer team will need to implement the **[[https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api|Apple Pay JS API]]** into the merchant website in order to retrieve the customers (encrypted) card details (to be informed as **APPLEPAYLOAD**).
Note that when specifying the **version** for your apple pay session, you should use version **3**.
Example:
const session = new ApplePaySession(3, yourPaymentRequest);
\\
**Step 03**: Send Payment Request
After you’ve retrieved the Apple Payload, convert the data to Hexadecimal, place it in the XML Payment Request in the APPLEPAYLOAD tag, and send the XML Payment Request to our servers as normal.
Consult the **[[developer:api_specification:xml_payment_features|XML Payment Features]]** for details on the URL for the request and other body fields too. Using the example below (change the data inside the tags) shows you how to perform a simple transaction using apple pay.
5345435
161007
66.0
05-01-2017:11:04:55:055
7b0d0a2020227368697070696e67436f6e74616374223a207b0d0a2020202022656d61696c41646472657373223a20226578616d706c6540776f726c646e65747470732e636f6d222c0d0a202020202266616d696c794e616d65223a2022222c0d0a2020202022676976656e4e616d65223a2022222c0d0a202020202270686f6e6574696346616d696c794e616d65223a2022222c0d0a202020202270686f6e65746963476976656e4e616d65223a2022220d0a20207d2c0d0a202022746f6b656e223a207b0d0a20202020227061796d656e7444617461223a207b0d0a20202020276c6a59544d7559334a734d41344741315564447745422f775145417749486744415042676b71686b694739324e6b42683045416755414d416f4743437147534d343942414d4341306b414d4559434951446148474f75692b583254343452364756704e376d326e456372365436734d6a4f685a354e75536f316567774968414c31612b2f68703838444b4a3073763365543346785763733731786d624...... (etc it's quite long)
APPLEPAY
John Junior Jameson
2db545a97060c95c33bd2844418ff6e7
USD
2
7
12345
\\
Variations of this request are possible, but for that, consult the complete reference for a payment at the **[[developer:api_specification:xml_payment_features|XML Payment Features]]** page and don't forget that the **APPLEPAYLOAD** tag replaces the **TRACKDATA** (for transactions using cards) or **CARDNUMBER** (for transctions using Secure Token) tags.