# Apple Pay

Apple Pay provides an easy and secure way to make payments in your iOS apps, watchOS apps, and on websites in Safari. And now, Apple Pay can also be used in Business Chat and in iMessage extensions. By using Face ID, Touch ID, or double-clicking Apple Watch, users can quickly and securely provide their payment, shipping, and contact information to check out. Customers love the simplicity of Apple Pay, and you’ll love the increased conversion rates and new user adoption that come with it.

<figure><img src="https://3790748257-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT43PzcNjyZtWby9yrGd3%2Fuploads%2FvIv2kyMUxKuCLFtD2oMQ%2FUntitled.png?alt=media&#x26;token=cac80a9d-287a-451d-9558-56f485426d1d" alt="" width="188"><figcaption></figcaption></figure>

{% hint style="info" %}
This article is for a direct API integration with CheckoutChamp.  Follow [these instructions](https://help.checkoutchamp.com/funnel-builder/creating-and-editing-funnels-pages/funnel-visualizer-and-page-builder/funnel-visualizer/edit-funnel-settings/payments/apple-pay) if you need to implement Apple Pay with CheckoutChamp hosted pages.
{% endhint %}

### There are 2 options for transacting with Apple Pay <a href="#applepay-thereare2optionsfortransactingwithapplepay" id="applepay-thereare2optionsfortransactingwithapplepay"></a>

#### Option 1: External Payment <a href="#applepay-option1-externalpayment" id="applepay-option1-externalpayment"></a>

1. To integrate Apple Pay, you must do all the Apple javascript with the button for your lander. You can find instructions on how to do this by visiting [**Apple Pay Integration**](https://webkit.org/blog/8182/introducing-the-payment-request-api-for-apple-pay/).
2. Once you have configured the Apple Pay Button on your lander, you will then send in **Import Order** with **paySource='APPLEPAY'**. It will automatically go to QA unless you also send in the **skipQA** parameter.
3. If you want to record Apple Pay declines in the CRM, you would immediately follow the **Import Order** call with the **Order QA** API call and **action='DECLINE**'
4. Feel free to reference our API documentation for more information regarding our **Order QA** and **Import Order** procedures

#### Option 2: Limited Gateway Support <a href="#applepay-option2-limitedgatewaysupport" id="applepay-option2-limitedgatewaysupport"></a>

1. This option allows the transaction to occur within CheckoutChamp.
2. Please follow the steps in the [**Apple Pay Integration**](https://webkit.org/blog/8182/introducing-the-payment-request-api-for-apple-pay/)  or in the [**Apple Pay Demo**](https://applepaydemo.apple.com/) to integrate a web application with the Apple Pay API.
3. Configure the Apple Pay Button in your funnel.
4. The ApplePaySession **onpaymentauthorized** function triggered through Button usage will return a token with the **event.payment.token** parameter.  Send this token to **Import Order** with **paySource='APPLEPAY'** and **applePayToken=** the JSON encoded token.
5. The token will be sent to your gateway to complete the transaction.

{% hint style="info" %}
**applePayToken** should be a JSON encoded string. Apple documentation is [**here**](https://developer.apple.com/documentation/passkit/apple_pay/payment_token_format_reference), and the structure should be similar to this:
{% endhint %}

```json
{
    "paymentData": {
        "data": "**********",
        "signature": "**********",
        "header": {
            "publicKeyHash": "**********",
            "ephemeralPublicKey": "**********",
            "transactionId": "**********"
        },
        "version": "**********"
    },
    "paymentMethod": {
        "displayName": "**********",
        "network": "**********",
        "type": "**********"
    },
    "transactionIdentifier": "**********"
}
```

The same steps can be repeated and the token sent on **Import Upsale** to process an upsell with Apple Pay.

{% hint style="info" %}
Check with your gateway to confirm if rebills and one-click upsells are supported on Apple Pay.
{% endhint %}

&#x20;

Gateway integrations that support Apple Pay tokens are identified on the Gateway Integrations page with the Apple Pay icon.

{% hint style="info" %}
Braintree requires use of the Braintree JavaScript SDK on your lander. The applePayToken parameter sent in the Import Order API call should be the token returned by Braintree's ApplePay tokenize function.
{% endhint %}

<figure><img src="https://3790748257-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT43PzcNjyZtWby9yrGd3%2Fuploads%2FOWv2zsok8VFkA2y2ZlvL%2Fimage.png?alt=media&#x26;token=f0d0d088-bfbc-40b5-a55a-43e7c5c167df" alt=""><figcaption></figcaption></figure>

### Related articles <a href="#applepay-relatedarticles" id="applepay-relatedarticles"></a>

[**Apple Pay Integration**](https://webkit.org/blog/8182/introducing-the-payment-request-api-for-apple-pay/)

[**Apple Pay Demo**](https://applepaydemo.apple.com/)

[**Import Order**](https://apidocs.checkoutchamp.com/?version=latest#275a54c6-b4b0-414c-819b-7387e9a81f58)

[**Order QA**](https://apidocs.checkoutchamp.com/?version=latest#cab0b9b3-1e2c-46be-b133-d748fbbf385f)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.checkoutchamp.com/crm/gateway-setup/gateway-integrations/apple-pay.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
