# Paypal Developer > PayPal supports third-party network token processing for merchants and partners. --- # Process Payments with Third-Party Tokens | PayPal Developer --- ## If you accept cookies, we’ll use them to improve and customize your experience and enable our partners to show you personalized PayPal ads when you visit other sites. [Manage cookies and learn more](https://www.paypal.com/myaccount/privacy/cookiePrefs?locale=en_US) --- ## Process payments using third-party network token processing PayPal supports third-party network token processing for merchants and partners. ### Availability This integration is available in the following countries: - Australia - Austria - Belgium - Bulgaria - Canada - China - Cyprus - Czech Republic - Denmark - Estonia - Finland - France - Germany - Hungary - Ireland - Italy - Latvia - Liechtenstein - Lithuania - Luxembourg - Malta - Netherlands - Norway - Poland - Portugal - Romania - Slovakia - Slovenia - Spain - Sweden - United Kingdom - United States For more information, contact [Sales](https://www.paypal.com/us/business/contact-sales). ### Tokenization Tokenization keeps payment information private by turning card numbers into unique tokens, which are stored securely and used instead of the original card. Tokenization creates a unique credential, or token, for a card that is different from its 15- or 16-digit primary account number. The merchant only sends the token, rather than the underlying account number. A network token only works for a specific card and merchant. The benefits of using network tokens include: - Improved authorization rates. - Increased security by reducing opportunities for data theft and using cryptograms to protect credentials. - Potentially reduced transaction-processing costs. - Simplified payment processing. - Helps maintain Payment Card Industry Data Security Standard compliance. ### Third-party network token processing A third-party network token represents a payment method that is either: - Saved in-house by the partner or merchant. - Saved by an external Token Service Provider (TSP). Third-party network token processing happens when PayPal processes a payment using a token that PayPal didn't create. ### How it works Integrate with third-party network token payments as follows: - Save and tokenize a payer's payment method. - Get a token number and expiration date to use for payments. - Use this token when sending a payment through PayPal. - PayPal processes the payment as a regular credit or debit card purchase. **info** **Note:** Third-party tokens aren't stored and can't be created, mapped, unmapped, or validated against their primary account number. ### Know before you code ### PayPal Expanded Checkout You'll need a PayPal Expanded Checkout integration. ### Third-party token integration liability You acknowledge and agree that you are solely responsible for any third-party vaulting functionality (not provided by PayPal) that you use and PayPal will, under no circumstances, be responsible or liable for any damages, losses or costs whatsoever suffered or incurred by you as a result of using a third-party vaulting functionality on PayPal’s platforms (including Products), services, or APIs. **warning** **Note:** Third-party network token integrations don’t support reference or future transactions. Don’t pass a reference transaction ID using the payment_source.token.id parameter. ### Using third-party network tokens with PayPal Review this section to learn how to integrate third-party network tokens in your PayPal integration. ### Sample third-party token processing request for direct merchants This code sample shows a third-party network token in the body of a POST call to the [Create order](/docs/api/orders/v2/#orders_create) endpoint of the Orders v2 API. This request creates a new order and completes the payment in a single step by declaring the intent as CAPTURE . The payment request includes the new network_token and stored_credential objects: #### **`Sample third-party token processing request for direct merchants`** ```curl curl -v -X POST https://api-m.sandbox.paypal.com/v2/checkout/orders \ -H 'Content-Type: application/json' \ -H 'PayPal-Request-Id: REQUEST-ID' \ -H 'Authorization: Bearer ACCESS-TOKEN' \ -d '{ "intent": "CAPTURE", "purchase_units": [ { "reference_id": "REFID-000-1001", "amount": { "currency_code": "USD", "value": "100.00" } } ], "payment_source": { "card": { "name": "Firstname Lastname", "network_token": { "number": "4444444444444444", "expiry": "2030-11", "eci_flag": "NON_3D_SECURE_TRANSACTION", "token_requestor_id": "VK123PTR" }, "stored_credential": { "payment_initiator": "MERCHANT", "payment_type": "UNSCHEDULED", "usage": "SUBSEQUENT", "previous_network_transaction_reference": { "id": "NETWORK-TRANSACTION-REFERENCE-ID", "network": "VISA" } } } } }' ``` - Lines 19-24: The payment_source.card.network_token object contains details about the third-party network token. PayPal passes this information to the issuer. See [network_token](/docs/api/orders/v2/#definition-network_token_request) for more details. - Line 22: Token service providers give each third-party network token a 2-digit Electronic Commerce Indicator (ECI) code. When you make a payment using a third-party network token, your integration needs to change the 2-digit ECI code to the corresponding string from the table below. Pass this value using the payment_source.card.network_token.eci_flag parameter. This value is required for customer-initiated payments and optional for merchant-initiated payments: | Numeric ECI code | String | | --- | --- | | 00 | MASTERCARD_NON_3D_SECURE_TRANSACTION | | 07 | NON_3D_SECURE_TRANSACTION | - Lines 25-33: The payment_source.card.stored_credential object contains details about the type of card-on-file payment. See [stored_credential](/docs/api/orders/v2/#definition-card_stored_credential) for more details. ### Sample third-party token processing response for direct merchants The HTTP 201 response includes the new bin_details and network_transaction_reference objects: #### **`Sample third-party token processing response for direct merchants`** ```javascript { "id": "ORDER-ID", "status": "COMPLETED", "payment_source": { "card": { "name": "Firstname Lastname", "last_digits": "4444", "expiry": "2030-11", "brand": "VISA", "available_networks": [ "VISA" ], "type": "CREDIT", "bin_details": { "issuing_bank": "CREDIT UNION OF OHIO", "bin_country_code": "US", "products": [ "CONSUMER" ] } } }, "purchase_units": [ { "reference_id": "REFID-000-1001", "payment_instruction": { ... }, "shipping": { ... }, "payments": { "captures": [ { "id": "ORDER-ID", "status": "COMPLETED", "amount": { "currency_code": "USD", "value": "50.00" }, "final_capture": true, "disbursement_mode": "DELAYED", "seller_protection": { "status": "NOT_ELIGIBLE" }, "seller_receivable_breakdown": { ... }, "invoice_id": "INVID-21-07-2023-05-56-55", "custom_id": "CUSTOMID-1001", "links": [ ... ], "create_time": "2023-07-21T12:27:00Z", "update_time": "2023-07-21T12:27:00Z", "processor_response": { "avs_code": "Y", "cvv_code": "X", "response_code": "0000" }, "network_transaction_reference": { "id": "NETWORK-TRANSACTION-REFERENCE-ID", "network": "VISA" } } ] } } ], "links": [ { "href": "https://api.sandbox.paypal.com/v2/checkout/orders/ORDER-ID", "rel": "self", "method": "GET" }, { "href": "https://www.sandbox.paypal.com/checkoutnow?token=ORDER-ID", "rel": "approve", "method": "GET" }, { "href": "https://api.sandbox.paypal.com/v2/checkout/orders/ORDER-ID", "rel": "update", "method": "PATCH" }, { "href": "https://api.sandbox.paypal.com/v2/checkout/orders/ORDER-ID/capture", "rel": "capture", "method": "POST" } ] } ``` - Lines 14-18: The payment_source.card.bin_details object contains the bank identification number (BIN) information. See [bin_details](/docs/api/orders/v2/#definition-bin_details) for more details. - Lines 59-62: The purchase_units.payments.captures.network_transaction_reference object includes the id and network name. See [network_transaction_reference](/docs/api/orders/v2/#definition-network_transaction_reference) for more details. ### Third-party network token processing test scenarios In the PayPal sandbox, you can use test cards to simulate third-party network token payment scenarios. The test scenario on this page shows a successful payment capture with the following details: - Merchant enrolled with Expanded Checkout. - Customer-initiated payment. - Externally provisioned token and cryptogram. Cryptograms are optional for MITs. ### Test cards Use the following test cards as third-party network tokens. Pass the test card number in the body of the request using payment_source.card.network_token.number . **info** **Tip:** Enter a future expiration date when testing these card network tokens. | **Card brand** | **Test card** | **Cryptogram** | | --- | --- | --- | | Visa | 4034772286582057 | "cryptogram":"ApIPtIgAMyrMgTx1RSnAMAACAAA=\" " | | Visa | 4556871409493313 | "cryptogram":"ApIPtIgAMyrMgTx1RSnAMAACAAA=\" " | | Mastercard | 5530238208956601 | "cryptogram":"ApIPtIgAMyrMgTx1RSnAMAACAAA=\" " | | Mastercard | 5419720028804901 | "cryptogram":"ApIPtIgAMyrMgTx1RSnAMAACAAA=\" " | | Amex | 379015087078375 | "cryptogram":"ApIPtIgAMyrMgTx1RSnAMAACAAA=\" " | | Discover | 6011390662682995 | "cryptogram":"ApIPtIgAMyrMgTx1RSnAMAACAAA=\" " | ### Sample create order using a third-party network token This code sample shows a third-party network token in the body of a POST call to the [Create order](/docs/api/orders/v2/#orders_create) endpoint of the Orders v2 API. This request creates a new order and completes the payment in a single step by declaring the intent as CAPTURE . The payment request includes the new network_token and stored_credential objects: #### **`Sample create order request`** ```javascript curl -v -X POST https://api-m.sandbox.paypal.com/v2/checkout/orders \ -H 'Content-Type: application/json' \ -H 'PayPal-Request-Id: REQUEST-ID' \ -H 'Authorization: Bearer ACCESS-TOKEN' \ -d '{ "intent": "CAPTURE", "purchase_units": [ { "reference_id": "reference_id_1_5.00", "amount": { "currency_code": "USD", "value": "100.00" } } ], "payment_source": { "card": { "name": "Firstname Lastname", "network_token": { "number": "4444444444444444", "expiry": "2030-11", "crypto --- # 3rd Party Solutions Overview ## Docs **Current** **Last updated: May 18th 2022, @ 7:02:27 pm** Integrate PayPal with a 3rd-party shopping cart plugin solution. ## Choose a 3rd-party solution ### Partners [Find a partner](https://www.paypal.com/us/business/platforms-and-marketplaces/directory) Visit our partner directory to see a full list of shopping carts, specialty platforms, marketplaces, and financial management systems with PayPal built in. ### Plugins [Find a plugin](/docs/3rd-party/plugins) Connect PayPal or Braintree payments to your system with a no-code plugin. --- ## Reference [Reference](/reference) [PayPal.com](https://www.paypal.com/) [Privacy](https://www.paypal.com/myaccount/privacy/privacyhub) [Cookies](https://www.paypal.com/myaccount/privacy/cookiePrefs) [Support](https://developer.paypal.com/support/) [Legal](https://www.paypal.com/us/webapps/mpp/ua/legalhub-full) [Contact](https://www.paypal.com/us/smarthelp/contact-us) --- # Track transactions using an acquirer reference number The acquirer reference number (ARN) is a unique value assigned to a credit or debit card transaction after the card has been processed. The ARN tracks the transaction's movement, which helps card brands, card issuing banks, and processors locate the transaction and confirm its handling. Customers can use the ARN to confirm that a refund was processed. If you provide your customer with the ARN, their bank can trace the transaction using this value. The ARN is passed as part of the response object. Without an ARN, if a customer's card has been lost, stolen, or closed since the original transaction, the issuing bank can have trouble routing a refund to the customer's account. When this happens, the bank reroutes the money to the appropriate account, mails the customer a check, or returns the money to your merchant account. ## Know before you code ### This integration requires an Expanded Checkout integration. ## Availability This integration is available: - In the US, UK, Canada, Australia, and the EU. - For credit and debit card purchases, including those made with digital wallets or mobile devices. You can retrieve the ARN for orders, captured payments, or refunded transactions. Make a GET call to the `v2/checkout/orders/ORDER-ID`, `v2/payments/captures/CAPTURE-ID`, or `v2/payments/refunds/REFUND-ID` endpoints to retrieve a transaction's ARN. If the ARN is available, it is listed in the response. **Note:** After you capture a payment or refund a transaction, the ARN is available after a few days. ### Orders API API endpoint used: [Show order details](https://developer.paypal.com/docs/api/orders/v2/#orders_get) #### Sample request ```curl "request": { "method": "GET", "path": "v2/checkout/orders/ORDER-ID?fields=payment_source", "headers": { "Authorization: Bearer ACCESS-TOKEN" } }, ``` #### Sample response ```curl "response": { "status": "200 OK", "headers": { "Content-Type": "application/json" }, "body": { "id": "5O190127TN364715T", "status": "COMPLETED", "intent": "CAPTURE", "payment_source": { "card": { "last_digits": "2643", "expiry": "2021-01", "brand": "VISA" } }, "purchase_units": [ { "reference_id": "REFERENCE-ID", "amount": { "currency_code": "USD", "value": "107.14", "breakdown": { "item_total": { "currency_code": "USD", "value": "107.14" }, "shipping": { "currency_code": "USD", "value": "0.00" }, "handling": { "currency_code": "USD", "value": "0.00" }, "tax_total": { "currency_code": "USD", "value": "0.00" }, "shipping_discount": { "currency_code": "USD", "value": "0.00" } } }, "description": "Description of PU1", "custom_id": "custom_id_1001", "soft_descriptor": "PP*soft_descr_107.14", "payments": { "captures": [ { "id": "CAPTURE-ID", "status": "COMPLETED", "amount": { "currency_code": "USD", "value": "107.14" }, "seller_protection": { "status": "NOT_ELIGIBLE" }, "final_capture": true, "network_transaction_reference": { "id": "TRANSACTION-ID", "network": "VISA", "acquirer_reference_number": "ACQUIRER-REFERENCE-NUMBER" }, } ], "refunds": [ { "id": "REFUND-ID", "status": "COMPLETED", "amount": { "currency_code": "USD", "value": "107.14" }, "note": "Defective product", "acquirer_reference_number": "ACQUIRER-REFERENCE-NUMBER", } ] ], "payer": { "name": { "given_name": "Firstname", "surname": "Lastname" }, "email_address": "customer@example.com", "payer_id": "PAYER-ID", "phone": { "phone_number": { "country_code": "1", "national_number": "18882211161" } }, "address": { "address_line_1": "123 Main St", "address_line_2": "Suite 1", "admin_area_2": "Anytown", "admin_area_1": "CA", "postal_code": "12345", "country_code": "US" } }, "create_time": "2018-04-01T21:18:49Z", "update_time": "2018-04-01T21:20:49Z", "links": [ { "href": "https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T", "rel": "self", "method": "GET" } ] } } ``` **Step result** A successful request results in the following: - A return status code of HTTP 200 OK. - A JSON response body that contains the ARN. ### Refund API API endpoint used: [Show refund details](/docs/api/payments/v2/#refunds_get) #### Sample request ```curl "request": { "method": "GET", "path": "v2/payments/refunds/REFUND-ID", "headers": { "Authorization: Bearer ACCESS-TOKEN" } }, ``` #### Sample response ```curl "response": { "status": "200 OK", "headers": { "Content-Type": "application/json" }, "body": { "id": "REFUND-ID", "amount": { "value": "10.99", "currency_code": "USD" }, "status": "COMPLETED", "note_to_payer": "Defective product", "seller_payable_breakdown": { "gross_amount": { "value": "10.99", "currency_code": "USD" }, "paypal_fee": { "value": "0", "currency_code": "USD" }, "net_amount": { "value": "10.99", "currency_code": "USD" }, "total_refunded_amount": { "value": "10.99", "currency_code": "USD" } }, "acquirer_reference_number": "ACQUIRER-REFERENCE-NUMBER", "invoice_id": "INVOICE-123", "create_time": "2023-05-11T23:24:19Z", "update_time": "2023-05-11T23:24:19Z", "links": [{ "rel": "self", "method": "GET", "href": "https://api-m.paypal.com/v2/payments/refunds/1JU08902781691411" }, { "rel": "up", "method": "GET", "href": "https://api-m.paypal.com/v2/payments/captures/2GG279541U471931P" } ] } } ``` **Step result** A successful request results in the following: - A return status code of HTTP 200 OK. - A JSON response body that contains the ARN. ### Capture API API endpoint used: [Show captured payment details](https://developer.paypal.com/docs/api/payments/v2/#captures_get) #### Sample request ```curl "request": { "method": "GET", "path": "v2/payments/captures/CAPTURE-ID", "headers": { "Authorization: Bearer ACCESS-TOKEN" } }, ``` #### Sample response ```curl "response": { "status": "200 OK", "headers": { "Content-Type": "application/json" }, "body": { "id": "CAPTURE-ID", "status": "COMPLETED", "amount": { "value": "10.99", "currency_code": "USD" }, "final_capture": true, "network_transaction_reference": { "id": "REFERENCE-ID", "network": "VISA", "acquirer_reference_number": "ACQUIRER-REFERENCE-NUMBER" }, "seller_protection": { "status": "ELIGIBLE", "dispute_categories": [ "ITEM_NOT_RECEIVED", "UNAUTHORIZED_TRANSACTION" ] }, "seller_receivable_breakdown": { "gross_amount": { "value": "10.99", "currency_code": "USD" }, "paypal_fee": { "value": "0.33", "currency_code": "USD" }, "net_amount": { "value": "10.66", "currency_code": "USD" } }, "invoice_id": "INVOICE-123", "processor_response": { "avs_code": "A", "cvv_code": "M", "response_code": "0000" }, "supplementary_data": { "related_ids": { "order_id": "ORDER-ID" } }, "create_time": "2017-09-11T23:24:01Z", "update_time": "2017-09-11T23:24:01Z", "links": [{ "href": "https://api-m.paypal.com/v2/payments/captures/2GG279541U471931P", "rel": "self", "method": "GET" }, { "href": "https://api-m.paypal.com/v2/payments/captures/2GG279541U471931P/refund", "rel": "refund", "method": "POST" }, { "href": "https://api-m.paypal.com/v2/payments/authorizations/0VF52814937998046", "rel": "up", "method": "GET" } ] } } ``` **Step result** A successful request results in the following: - A return status code of HTTP 200 OK. - A JSON response body that contains the ARN. --- # Activating FPA for direct merchants This flow is for existing merchants who have not signed up for Fraud Protection Advanced (FPA). You can activate FPA through one of the following: - Business Tools - Account Settings ## Activating FPA through Business Tools 1. In **Business Tools**, navigate to the **Manage Risk** section. Select the **Fraud Tools** tile highlighted in the following screenshot. On the next screen, select **Get Started.** ![Image 1](https://www.paypalobjects.com/devdoc/FPA_Home_Discovery_BusinessTools.png) ![Image 2](https://www.paypalobjects.com/devdoc/Get_startedFPA.png) 2. Select **Do it yourself with PayPal's fraud tool** and then select **Next**. If you select **comparison chart**, you'll see a detailed comparison of features for [Fraud Protection](https://developer.paypal.com/docs/checkout/advanced/customize/fraud-protection/) (FP), Fraud Protection Advanced (FPA), and Chargeback protection, as shown in the following screenshots: ![Image 3](https://www.paypalobjects.com/devdoc/FPA_Home_DIY_FPA_Recommended.png) ![Image 4](https://www.paypalobjects.com/devdoc/FPA_glance.png) 3. A recommended solution will be preselected for you based on your business metrics. However, you can modify the selection if you want. Make sure the **Fraud Protection Advanced Tool** is selected and select **Next**. ![Image 5](https://www.paypalobjects.com/devdoc/Activate_Dir_Mer_Select_FPA.png) 4. Confirm your details to set up automatic bank payments for your fraud tool, and select **Next**. ![Image 6](https://www.paypalobjects.com/devdoc/Activate_Dir_Mer_Set_Up_auto_debit.png) 5. Select **Let's Go** to open the Fraud Protection Advanced tool and begin customizing your fraud tool. ![Image 7](https://www.paypalobjects.com/devdoc/Activate_DirMer_EndOfFlow_.png) ## Activating FPA through Account Settings Go to your **Account Settings**, select **Payment preferences**. Next to the **Manage fraud** section, select **Choose a fraud tool**. ![Image 8](https://www.paypalobjects.com/devdoc/Manage_Fraud_tool.png) Follow steps 2 through 5 in Activating FPA through Business Tools to complete the activation process. ## Next steps ### Create and set up filters Use filters to decide whether FPA approves, rejects, or puts a transaction into a review queue. ### Manage lists Use the lists feature to manage information and work with their rules to help prevent fraud. ### Review transactions Review transactions that are flagged for review. ### Monitor FPA activity You can track which users made changes and when these changes occurred. --- # Integrate card payments in Android Accept PayPal, credit, and debit card payments in a web or native experience using the PayPal Mobile Android SDK. Use customizable PayPal buttons with your custom checkout UI to align with your business branding. For more implementation details, see the [PayPal GitHub repository](https://github.com/paypal/paypal-android/) . ## Know before you code You need a [developer account](https://developer.paypal.com/tools/sandbox/accounts/) to get sandbox credentials: - PayPal uses REST API credentials which you can get from the [developer dashboard](https://developer.paypal.com/dashboard/). - Client ID: Authenticates your account with PayPal and identifies an app in your sandbox. - Client secret: Authorizes an app in your sandbox. Keep this secret safe and don’t share it. Read [Get started with PayPal APIs](https://developer.paypal.com/api/rest/) for more information. You need a combination of PayPal and third-party tools: - [Android SDK](https://github.com/paypal/paypal-android): Adds PayPal-supported payment methods for Android. - [Orders REST API](https://developer.paypal.com/docs/api/orders/v2/): Create, update, retrieve, authorize, and capture orders. Use Postman to explore and test PayPal APIs. ## Before you begin your integration ### Check your account setup for advanced card payments This integration requires a sandbox business account with the Advanced Credit and Debit Card Payments capability. Your account should automatically have this capability. To confirm that Advanced Credit and Debit Card Payments are enabled for you, check your sandbox business account as follows: - Log into the [**PayPal Developer Dashboard**](https://developer.paypal.com/dashboard/) , toggle **Sandbox** , and go to **Apps & Credentials** . - In **REST API apps** , select the name of your app. - Go to **Features** \> **Accept payments** . Select the **Advanced Credit and Debit Card Payments** checkbox and select **Save Changes** . **Note:** If you created a sandbox business account through [sandbox.paypal.com](https://www.sandbox.paypal.com/?_ga=1.158343865.248280996.1670866755) , and the advanced credit and debit card payments status for the account is disabled, [complete the sandbox onboarding steps](https://www.sandbox.paypal.com/bizsignup/#/checkAccount) . ### Check 3D Secure requirements Add 3D Secure to reduce the chance of fraud and improve the payment experience by authenticating a cardholder through their card issuer. Visit our [3D Secure](https://developer.paypal.com/docs/checkout/advanced/customize/3d-secure/) page to see if 3D Secure is required in your region and learn more about implementing 3DS in your app. The PayPal Mobile SDK is available through Maven Central. Add the mavenCentral repository to the build.gradle file of your project root: #### **`Integrate the SDK into your app Demo`** ```javascript allprojects { repositories { mavenCentral() } } ``` ### Snapshot builds You can also use snapshot builds to test upcoming features before release. To include a snapshot build: #### 1. Add snapshots repository Add the snapshots repository to the build.gradle file of your project root. ```javascript allprojects { repositories { mavenCentral() maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } } } ``` #### 2. Add snapshot to dependencies Then, add a snapshot build by adding -SNAPSHOT to the current dependency version. For example, if you want to add a snapshot build for CardPayments , add the following: ```javascript dependencies { implementation 'com.paypal.android:card-payments:CURRENT-VERSION-SNAPSHOT' } ``` ### Payment integrations Integrate 3 different types of payments using the PayPal Mobile SDK: - **Card payments:** Add card fields that align with your branding. - **PayPal native payments:** Launch a checkout page within your app, instead of a popup. - **PayPal web payments:** A lighter integration that launches a checkout page in a browser within your app. ### Card ### Integrate with card payments Build and customize the card fields to align with your branding. #### 1. Add card payments module to your app Add the card-payments package dependency in your app's build.gradle file: ```javascript dependencies { implementation "com.paypal.android:card-payments:CURRENT-VERSION" } ``` ### 2. Create CardClient A CardClient helps you attach a card to a payment. In your Android app: - Use the CLIENT_ID to construct a CoreConfig . - Construct a CardClient using your CoreConfig object. ```javascript val config = CoreConfig("CLIENT_ID", environment = Environment.SANDBOX) val cardClient = CardClient(config) ``` ### 3. Get Order ID On your server: - Create an ORDER_ID by using the [Orders v2 API](https://developer.paypal.com/docs/api/orders/v2/). - Pass your ACCESS_TOKEN in the Authorization header. To get an ACCESS_TOKEN , use the [Authentication API](https://developer.paypal.com/api/rest/authentication/). - Pass the intent . You'll need to pass either AUTHORIZE or CAPTURE as the intent type. This type must match the /authorize or /capture endpoint you use to process your order. #### **`Sample request`** ```javascript curl --location --request POST 'https://api-m.sandbox.paypal.com/v2/checkout/orders/' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ --data-raw '{ "intent": "CAPTURE|AUTHORIZE", "purchase_units": [ { "amount": { "currency_code": "USD", "value": "5.00" } } ] }' ``` #### **`Sample response`** ```javascript { "id":"ORDER_ID", "status":"CREATED" } ``` When a buyer starts a payment, send the ORDER_ID from your server to your client app. ### 4. Create card request A CardRequest object: - Attaches a card to an ORDER_ID . - Launches 3D Secure when a payment requires additional authentication. #### 1. Collect card payment details Build a card object with the buyer's card details: ```javascript val card = Card( number = "4005519200000004", expirationMonth = "01", expirationYear = "2025", securityCode = "123", billingAddress = Address( streetAddress = "123 Main St.", extendedAddress = "Apt. 1A", locality = "Anytown", region = "CA", postalCode = "12345", countryCode = "US" ) ) ``` Collecting a billing address can reduce the number of authentication challenges to customers. #### 2. Build CardRequest Build a CardRequest with the card object and your ORDER_ID : ```javascript val cardRequest = CardRequest( orderID = "ORDER_ID", card = card, returnUrl = "myapp://return_url", // custom URL scheme needs to be configured in AndroidManifest.xml sca = SCA.SCA_ALWAYS // default value is SCA.SCA_WHEN_REQUIRED ) ``` ### 3. Set up your app for browser switching The sca challenge launches in a browser within your application. Your app needs to handle the browser switch between the sca challenge and the checkout page. Set up a return URL that returns to your app from the browser. #### 4. Create a return URL Provide a returnUrl so the browser returns to your application after the sca challenge finishes. The myapp:// portion of the returnUrl is a custom URL scheme that you need to register in your app's AndroidManifest.xml . #### 5. Add card payment activity to the Android manifest Update your app's AndroidManifest.xml with details about the card payment activity that will return the user to your app after completing the SCA check. Include the following elements: - Set the activity launchMode to singleTop . - Set the android:scheme on the Activity that will be responsible for handling the deep link back into the app. - Add an intent-filter . - Register the myapp:// custom URL scheme in the intent-filter . Note: android:exported is required if your app compile SDK version is API 31 (Android 12) or later. ```xml ... ``` ### 6. Connect the card payment activity Add onNewIntent to your activity: ```javascript override fun onNewIntent(newIntent: Intent?) { super.onNewIntent(intent) intent = newIntent } ``` ### 5. Approve order After your CardRequest has the card details, call cardClient.approveOrder() to process the payment. ```javascript class MyCardPaymentActivity: FragmentActivity { fun cardCheckoutTapped(cardRequest: CardRequest) { cardClient.approveOrder(this, cardRequest) } } ``` ### 6. Handle payment result scenarios Set up your ApproveOrderListener to handle successful payments, errors, cancellations, and 3D Secure transaction flows. ```javascript class MyCardPaymentActivity: FragmentActivity, ApproveOrderListener { fun cardCheckoutTapped(cardRequest: CardRequest) { val result = cardClient.approveOrder(this, cardRequest) } fun setupCardClient() { cardClient.listener = this } fun onApproveOrderSuccess(result: CardResult) { // order was approved and is ready to be captured/authorized (see step 6) } fun onApproveOrderFailure(error: PayPalSDKError) { // inspect 'error' for more information } fun onApproveOrderCanceled() { // 3D Secure flow was canceled } fun onApproveOrderThreeDSecureWillLaunch() { // 3D Secure flow will launch } fun onApproveOrderThreeDSecureDidFinish() { // 3D Secure auth did finish successfully } } ``` ### 7. Authorize and capture order Submit your ORDER_ID for authorization or capture when the PayPal Android SDK calls the onApproveOrderSuccess method. Call the [authorize](https://developer.paypal.com/docs/api/orders/v2/#orders_authorize) endpoint of the Orders V2 API to place the money on hold: #### Sample request: Authorize order ```javascript curl --location --request POST 'https://api-m.sandbox.paypal.com/v2/checkout/orders/' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ --data-raw '{ "intent": "CAPTURE|AUTHORIZE", "purchase_units": [ { "amount": { "currency_code": "USD", "value": "5.00" } } ] }' ``` Call the [capture](https://developer.paypal.com/docs/api/orders/v2/#orders_capture) endpoint of the Orders V2 API to capture the money immediately: #### Sample request: Capture order ```javascript curl --location --request POST 'https://api-m.sandbox.paypal.com/v2/checkout/orders/ORDER_ID/capture' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ --data-raw '' ``` ## Web payments ### PayPal Web Payments Integrate PayPalWebPayments to add a lighter checkout integration to your app. The checkout experience is launched in a browser within your application, reducing the size of the SDK. Follow these steps to integrate PayPalWebPayments : ### 1. Add PayPalWebPayments to your app Add the paypal-web-payments package dependency in your app's build.gradle file: ```javascript dependencies { implementation "com.paypal.android:paypal-web-payments:CURRENT-VERSION" } ``` ### 2. Set up your app for browser switching PayPalWebPayments launches a checkout page in a browser within your application. Your app needs to handle the browser switch between the checkout page and your app. Set up a return URL that returns to your app from the browser. Update your app's AndroidManifest.xml with details about the card payment activity that will return the user to your app after completing the payment. Include the following elements: - Set the activity launchMode to singleTop . - Set the android:scheme on the Activity that will be responsible for handling the deep link back into the app. - Add an intent-filter . - Register the myapp:// custom URL scheme in the intent-filter . Note: android:exported is required if your app compile SDK version is API 31 (Android 12) or later. ```xml ... ``` ### 3. Create PayPalWebCheckoutClient Use the following steps to set up the PayPal Native Checkout client for your app: #### 1. Construct CoreConfig In your Android app, use the CLIENT_ID to construct a CoreConfig . ```javascript val config = CoreConfig("CLIENT_ID", environment = Environment.SANDBOX) val dataCollector = PayPalDataCollector(coreConfig = coreConfig) ``` #### 2. Create return URL Set a return URL using the custom scheme you configured in the ActivityManifest.xml : ```javascript val returnUrl = "custom-url-scheme" ``` #### 3. Create web checkout request Create a PayPalWebCheckoutClient to approve an order with a PayPal payment method: ```javascript val payPalWebCheckoutClient = PayPalWebCheckoutClient(requireActivity(), config, returnUrl) ``` #### 4. Set up payment listener Set a PayPalWebCheckoutListener on the PayPalWebCheckoutClient to receive payment flow callbacks: ```javascript payPalWebCheckoutClient.listener = object : PayPalWebCheckoutListener { override fun onPayPalWebSuccess(result: PayPalWebCheckoutResult) { // order was approved and is ready to be captured/authorized (see step 7) } override fun onPayPalWebFailure(error: PayPalSDKError) { // inspect 'error' for more information } override fun onPayPalWebCanceled() { // 3D Secure flow was canceled } override fun onPayPalWebThreeDSecureWillLaunch() { // 3D Secure flow will launch } override fun onPayPalWebThreeDSecureDidFinish() { // 3D Secure auth did finish successfully } } ``` ### 5. Get Order ID On your server: - Create an ORDER_ID by using the [Orders v2 API](https://developer.paypal.com/docs/api/orders/v2/). - Pass your ACCESS_TOKEN in the Authorization header. To get an ACCESS_TOKEN , use the [Authentication API](https://developer.paypal.com/api/rest/authentication/). - Pass the intent . You'll need to pass either AUTHORIZE or CAPTURE as the intent type. This type must match the /authorize or /capture endpoint you use to process your order. #### **`Sample request`** ```javascript curl --location --request POST 'https://api-m.sandbox.paypal.com/v2/checkout/orders/' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ --data-raw '{ "intent": "CAPTURE|AUTHORIZE", "purchase_units": [ { "amount": { "currency_code": "USD", "value": "5.00" } } ] }' ``` #### **`Sample response`** ```javascript { "id":"ORDER_ID", "status":"CREATED" } ``` When a buyer starts a payment, send the ORDER_ID from your server to your client app. ### 6. Create web checkout request Configure your PayPalWebCheckoutRequest with the ORDER_ID . You can also specify one of the following funding sources for your order: PayPal (default), PayLater , or PayPalCredit . ```javascript val payPalWebCheckoutRequest = PayPalWebCheckoutRequest("ORDER_ID", fundingSource = PayPalWebCheckoutFundingSource.PAYPAL) ``` ### 7. Approve order Call payPalWebCheckoutClient.start() to process the payment. ```javascript class MyCardPaymentActivity: FragmentActivity { fun cardCheckoutTapped(cardRequest: CardRequest) { payPalWebCheckoutClient.start(cardRequest) } } ``` ### 8. Handle payment result scenarios Set up your ApproveOrderListener to handle successful payments, errors, cancellations, and 3D Secure transaction flows. ```javascript class MyCardPaymentActivity: FragmentActivity, ApproveOrderListener { fun cardCheckoutTapped(cardRequest: CardRequest) { val result = cardClient.approveOrder(this, cardRequest) } fun setupCardClient() { cardClient.listener = this } fun onApproveOrderSuccess(result: CardResult) { // order was approved and is ready to be captured/authorized (see step 6) } fun onApproveOrderFailure(error: PayPalSDKError) { // inspect 'error' for more information } fun onApproveOrderCanceled() { // 3D Secure flow was canceled } fun onApproveOrderThreeDSecureWillLaunch() { // 3D Secure flow will launch } fun onApproveOrderThreeDSecureDidFinish() { // 3D Secure auth did finish successfully } } ``` For more information, visit the [Update order](https://developer.paypal.com/docs/api/orders/v2/#orders_patch) endpoint of the Orders v2 API. ## Fraud protection ### Protect from fraud The FraudProtection module helps you collect data about a customer's device and match it with a session identifier on your server. For more information, see [Fraud protection](https://developer.paypal.com/docs/checkout/advanced/customize/fraud-protection/) . **Note:** If you integrated 3D Secure before June 2020, the liabilityShifted , authenticationStatus , and AuthenticationReason parameters are no longer supported, but continue to work on the server. ### 1. Add FraudProtection to your app Add the fraud-protection package dependency in your app's build.gradle file: ```javascript dependencies { implementation "com.paypal.android:fraud-protection:CURRENT-VERSION" } ``` ### 2. Create PayPalDataCollector In your Android app: - Use the CLIENT_ID to construct a CoreConfig . - Construct a PayPalDataCollector using your CoreConfig object. ```javascript val config = CoreConfig("CLIENT_ID", environment = Environment.SANDBOX) val dataCollector = PayPalDataCollector(coreConfig = coreConfig) ``` ### 3. Collect client metadata Collect the client metadata ID before starting a payment from a mobile device: **Important:** User Data Consent Merchant applications are responsible for collecting user data consent. If your app has obtained consent from the user to collect location data in compliance with [Google Play Developer Program policies](https://support.google.com/googleplay/android-developer/answer/10144311#personal-sensitive) , set hasUserLocationConsent to true . This flag enables PayPal to collect necessary information required for Fraud Detection and Risk Management. **Merchant App Disclosure** Merchant applications may be required to display a disclosure before collecting user location data in accordance with Google’s [Best practices for prominent disclosures and consent](https://support.google.com/googleplay/android-developer/answer/11150561?hl=en&ref_topic=12797379&sjid=10421482417907285178-NC) . By setting hasUserLocationConsent to true , your app is enabled to share device location data with a third party (PayPal) for Fraud Detection and Risk Management. ```javascript val dataCollectorRequest = PayPalDataCollectorRequest(hasUserLocationConsent) val clientMetadataId = payPalDataCollector.collectDeviceData(context, dataCollectorRequest) ``` Pass the result to your server, and include the client metadata ID in the payment request you send to PayPal. Don't cache or store this value. ### 4. Set up your app for browser switching The sca challenge launches in a browser within your application. Your app needs to handle the browser switch between the sca challenge and the checkout page. Set up a return URL that returns to your app from the browser. #### 5. Create a return URL Provide a returnUrl so the browser returns to your application after the sca challenge finishes. The myapp:// portion of the returnUrl is a custom URL scheme that you need to register in your app's AndroidManifest.xml . #### 6. Add card payment activity to the Android manifest Update your app's AndroidManifest.xml with details about the card payment activity that will return the user to your app after completing the SCA check. Include the following elements: - Set the activity launchMode to singleTop . - Set the android:scheme on the Activity that will be responsible for handling the deep link back into the app. - Add an intent-filter . - Register the myapp:// custom URL scheme in the intent-filter . Note: android:exported is required if your app compile SDK version is API 31 (Android 12) or later. ```xml ... ``` ### 7. Connect the card payment activity Add onNewIntent to your activity: ```javascript override fun onNewIntent(newIntent: Intent?) { super.onNewIntent(intent) intent = newIntent } ``` ### 5. Approve order Submit your ORDER_ID for authorization or capture when the PayPal Android SDK calls the onApproveOrderSuccess method. Call the [authorize](https://developer.paypal.com/docs/api/orders/v2/#orders_authorize) endpoint of the Orders V2 API to place the money on hold: #### Sample request: Authorize order ```javascript curl --location --request POST 'https://api-m.sandbox.paypal.com/v2/checkout/orders/' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ --data-raw '{ "intent": "CAPTURE|AUTHORIZE", "purchase_units": [ { "amount": { "currency_code": "USD", "value": "5.00" } } ] }' ``` Call the [capture](https://developer.paypal.com/docs/api/orders/v2/#orders_capture) endpoint of the Orders V2 API to capture the money immediately: #### Sample request: Capture order ```javascript curl --location --request POST 'https://api-m.sandbox.paypal.com/v2/checkout/orders/ORDER_ID/capture' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ --data-raw '' ``` ## Go live If you have fulfilled the requirements for accepting Advanced Credit and Debit Card Payments for your [business account](https://www.paypal.com/myaccount/bundle/business/upgrade) , review the [Move your app to production](https://www.paypal.com/api/rest/production/) page to learn how to test and go live. If this is your first time testing in a live environment, follow these steps: - Log into the [PayPal Developer Dashboard](https://developer.paypal.com/dashboard/) with your PayPal business account. - Complete [production onboarding](https://www.paypal.com/bizsignup/entry?_ga=1.171321763.248280996.1670866755) so you can process card payments with your live PayPal business account. - Request [Advanced Credit and Debit Card Payments](https://www.paypal.com/signin/client?flow=provisionUser&country.x=US&locale.x=en_US&ga=1.95899167.248280996.1670866755) for your business account. **Note:** The code for the integration checks eligibility requirements, so the payment card fields only display when the production request is successful. --- # Enable 3D Secure with Orders API for Payments Enable 3D Secure for advanced credit and debit cards. This integration uses Orders API. **Info:** PayPal handles 3D Secure authentication for standard payment integrations. No changes are required for standard integrations. ## Know before you code ### If you are based in Europe, you may be subject to PSD2: - Include 3D Secure as part of your integration. - Pass the cardholder's billing address as part of the transaction processing. ### Explore PayPal APIs with Postman You can use Postman to explore and test PayPal APIs. Learn more in our [Postman guide](/api/rest/postman). ## Include a contingency for 3D Secure Use the following code to request either `SCA_ALWAYS` or `SCA_WHEN_REQUIRED` as a verification attribute for the card object. - `SCA_ALWAYS` triggers 3D Secure for every transaction, regardless of SCA requirements. - `SCA_WHEN_REQUIRED` returns a 3D Secure contingency when it is a mandate in the region where you operate. This is the default when neither parameter is explicitly passed. ### `Include a contingency for 3D Secure` ```javascript "request": { "method": "POST", "path": "v2/checkout/orders/5O190127TN364715T/authorize", "headers": { "PayPal-Request-Id": "7b92603e-77ed-4896-8e78-5dea2050476a", "Authorization: Bearer " }, "body": { "payment_source": { "card": { "number": "4111111111111111", "expiry": "2010-02", "name": "John Doe", "billing_address": { "address_line_1": "2211 N First Street", "address_line_2": "17.3.160", "admin_area_1": "CA", "admin_area_2": "San Jose", "postal_code": "95131", "country_code": "US" }, "attributes": { "verification": { "method": "SCA_WHEN_REQUIRED" } } } } } } ``` ## Launch authentication flow with HATEOAS link The merchant needs to redirect the payer back to PayPal to complete 3D Secure authentication. To trigger the authentication: - Redirect the buyer to the `"rel": "payer-action"` HATEOAS link returned as part of the response before authorizing or capturing the order. - Append `"redirect_uri"` to the `payer-action` URL so that PayPal returns the payer to the merchant's checkout page after they complete 3D Secure authentication. ### `Sample URL` https://example.com/webapp/myshop?action=verify&flow=3ds&cart_id=ORDER-ID&redirect_uri=MERCHANT-LANDING-PAGE - The issuing bank verifies authentication. - Device data is collected, and JavaScript is posted directly to the issuing bank. ## Buyer completes authentication ### Single-step API request After the 3D Secure contingency is thrown during the [create order](/api/orders/v2/#orders_create) response, and contingency is resolved by the buyer, the merchant or partner must invoke the [authorize order](/docs/api/orders/v2/#orders_authorize) and [capture order](https://developer.paypal.com/docs/api/orders/v2/#orders_capture) endpoints with an empty payload to complete the transaction. ### Multi-step API request After the 3D Secure contingency is thrown during the [authorize order](/docs/api/orders/v2/#orders_authorize) and [capture order](/docs/api/orders/v2/#orders_capture) response and contingency is resolved by the buyer, the merchant or partner must invoke the authorize order and capture order endpoints again with an empty payload to complete the transaction. ## Proceed with the transaction ### Single-step API request After the 3D Secure contingency is thrown during the [create order](/api/orders/v2/#orders_create) response, and contingency is resolved by the buyer, the merchant or partner must invoke the [authorize order](/docs/api/orders/v2/#orders_authorize) and [capture order](https://developer.paypal.com/docs/api/orders/v2/#orders_capture) endpoints with an empty payload to complete the transaction. ### Multi-step API request After the 3D Secure contingency is thrown during the [authorize order](/docs/api/orders/v2/#orders_authorize) and [capture order](/docs/api/orders/v2/#orders_capture) response and contingency is resolved by the buyer, the merchant or partner must invoke the authorize order and capture order endpoints again with an empty payload to complete the transaction. ## See also - [Response parameters](/docs/checkout/advanced/customize/3d-secure/response-parameters/) - Learn more about handling 3D Secure responses. - [Test scenarios](/docs/checkout/advanced/customize/3d-secure/test/) - Simulate 3D Secure scenarios and responses. --- # Alternative payment methods With alternative payment methods, customers across the globe can pay with their bank accounts, wallets, and other local payment methods. For example, a customer in the Netherlands might want to pay using iDEAL, which is used by more than half of consumers in the Netherlands for online purchases, whereas a customer in Belgium on the same website might want to pay using Bancontact, a popular payment method there. Integrate alternative payment methods so you can: - Present the alternative payment methods that you want to offer. - Customize the experience for collecting buyer information. - Get your buyers, paying through an alternative payment method, checked out in as few steps as possible. ## Available payment methods | Payment method | Payment type | Payment flow | Countries | Currencies | Minimum amount | Refunds | | --- | --- | --- | --- | --- | --- | --- | | [Apple Pay](https://developer.paypal.com/docs/checkout/apm/apple-pay/) | push | direct | [Country list](https://developer.paypal.com/docs/checkout/apm/apple-pay/#link-supportedcountriesandcurrencies) | [Currency list](https://developer.paypal.com/docs/checkout/apm/apple-pay/#link-supportedcountriesandcurrencies) | 1 USD | Up to 180 days | | [Bancontact](https://developer.paypal.com/docs/checkout/apm/bancontact/) | bank redirect | redirect | Belgium | EUR | 1 EUR | Within 180 days | | [BLIK](https://developer.paypal.com/docs/checkout/apm/blik/) | bank redirect | redirect | Poland | PLN | 1 PLN | Within 180 days | | [eps](https://developer.paypal.com/docs/checkout/apm/eps/) | bank redirect | redirect | Austria | EUR | 1 EUR | Within 180 days | | [Google Pay](https://developer.paypal.com/docs/checkout/apm/google-pay/) | push | direct | [Country list](https://developer.paypal.com/docs/checkout/apm/google-pay/#link-supportedcountriesandcurrencies) | [Currency list](https://developer.paypal.com/docs/checkout/apm/google-pay/#link-supportedcountriesandcurrencies) | 1 USD | Up to 180 days | | [iDEAL](https://developer.paypal.com/docs/checkout/apm/ideal/) | bank redirect | redirect | Netherlands | EUR | 0.01 EUR | Within 180 days | | [Multibanco](https://developer.paypal.com/docs/checkout/apm/multibanco/) | voucher | redirect | Portugal | EUR | N/A | N/A | | [MyBank](https://developer.paypal.com/docs/checkout/apm/mybank/) | bank redirect | redirect | Italy | EUR | N/A | Within 180 days | | [Pay upon Invoice](https://developer.paypal.com/docs/checkout/apm/pay-upon-invoice/) | deferred payment | direct | Germany | EUR | 5 EUR | Within 180 days | | [Przelewy24](https://developer.paypal.com/docs/checkout/apm/przelewy24/) | bank redirect | redirect | Poland | PLN EUR | 1 PLN | Within 180 days | | [Trustly](https://developer.paypal.com/docs/checkout/apm/trustly/) | bank redirect | redirect | AT, DE, DK, EE, ES, FI, GB, LT, LV, NL, NO, SE | EUR, DKK, SEK, GBP, NOK | 0.01 EUR | Up to 365 days | **warning** giropay was sunset on June 30, 2024. PayPal will not support giropay payments starting July 1, 2024. Offer your users PayPal wallet and other alternative payment methods. [Learn more](https://www.paypal.com/us/cshelp/article/giropay-deprecation-help1183) Sofort was sunset on April 18, 2024. PayPal will not support Sofort payments starting April 19, 2024. Offer your users PayPal wallet and other alternative payment methods. [Learn more](https://www.paypal.com/us/cshelp/article/sofort-deprecation-help1145) --- # App Switch ## Overview App Switch helps PayPal customers start a transaction in a browser or app and complete it in the PayPal app, streamlining checkout with strong multi-factor authentication. The buyer can use biometrics or a passkey to log in instead of entering their password. The buyer experience falls back to the web flow in cases where App Switch isn't available. ## Buyer flow ![Buyer, is directed to the PayPal app, to complete the transaction.](https://www.paypalobjects.com/devdoc/app_switch_flow.gif) 1. The buyer selects the PayPal button from another app or website. 2. The PayPal app opens and uses biometrics or a passkey to log the buyer in. 3. The buyer reviews purchase details and completes the transaction in the PayPal app. 4. The buyer is returned to the app or website where they selected the PayPal button. ## Integration options ### API: One-time payments Merchant’s manage the payer's interaction between their app or website and the PayPal app. ### API: Vaulted payments Vaulting helps securely save a payer’s PayPal wallet, with the payer’s consent, for future use. ### App Switch for JS SDK Enable App Switch in the JavaScript SDK for resume flows and error scenarios. --- # Integrate Apple Pay with JS SDK for direct merchants ## Apple Pay integration Apple Pay is a mobile payment and digital wallet service provided by Apple Inc. Buyers can use Apple Pay to make payments on the web using the Safari web browser or an iOS device. Sellers can use Apple Pay to sell: - Physical goods, such as clothes and electronics. - Digital goods, such as software. - Intangible professional services, such as concerts or gym memberships. [Visit this site](https://developer.apple.com/documentation/passkit/apple_pay) for more information about Apple Pay. ![applepay-sheet-xxl-m.png](https://www.paypalobjects.com/ppdevdocs/img/applepay-sheet-xxl-m.png) ## Supported countries and currencies Apple Pay supports payments in 34 countries and 22 currencies: - **Countries:** Australia, Austria, Belgium, Bulgaria, Canada, China, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Ireland, Italy, Japan, Latvia, Liechtenstein, Lithuania, Luxembourg, Malta, Netherlands, Norway, Poland, Portugal, Romania, Singapore, Slovakia, Slovenia, Spain, Sweden, United States, United Kingdom - **Currencies:** AUD, BRL, CAD, CHF, CZK, DKK, EUR, GBP, HKD, HUF, ILS, JPY, MXN, NOK, NZD, PHP, PLN, SEK, SGD, THB, TWD, USD ## How it works The Apple Pay button shows up on your website when a customer uses the Safari web browser on an eligible device. When your buyer selects the Apple Pay button: - Your website shows the buyer a payment sheet. - The buyer confirms the purchase details, such as the shipping address and payment method. - The buyer authorizes the purchase on the payment sheet. The payment sheet helps streamline the checkout process by showing the customer the information needed to make the payment. Payment sheets can show the user's name, address, shipping information, and email address. You can customize this payment sheet to include the user details and payment information you need for your Apple Pay integration. [Visit this site](https://support.apple.com/en-us/HT208531) for more details about Apple Pay's compatibility. ![applepay_mobile.png](https://www.paypalobjects.com/ppdevdocs/img/applepay_mobile.png) ## Integration video Watch our video tutorial for this integration: ## Know before you code You must be an approved partner to integrate the Apple Pay SDK. For customers to pay with Apple Pay, they must be in a region where Apple Pay is supported, and their devices must meet the following requirements: - Device compatibility: The device must support Apple Pay. - iOS version: iOS 12.1 or later. - Desktop: macOS 10.14.1 or later. - Supported browsers: Safari. With the [latest Apple Pay SDK](https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js) , customers can also pay using non-Safari browsers. PayPal also provides iframe support for ApplePay. To use ApplePay within an iframe: - The iframe tag must have the attribute allow="payment". - The parent domain hosting the iframe needs to have its domain validated by following the usual process with PayPal. ## Create Apple Pay sandbox account Create an Apple Pay sandbox account on the Apple Developer website to get a test wallet and test cards to test your Apple Pay integration. If you already have an Apple sandbox account, you can use that account and move on to the next step. - Create an [Apple developer account](https://developer.apple.com/). - Create an [Apple sandbox account](https://developer.apple.com/apple-pay/sandbox-testing/). - Get test cards from your Apple sandbox account. ## Integrate Apple JavaScript SDK Use this script to integrate with the PayPal JavaScript SDK: ```html ``` Include `applepay` in the `components` list. Use this script to integrate with the Apple JavaScript SDK: ```html ``` PayPal's Apple Pay component interacts with your JavaScript code in 4 areas: - Checking merchant eligibility for Apple Pay: `paypal.Applepay().config()`. - Creating an Apple Pay session. - Handling the `onvalidatemerchant` callback: `paypal.Applepay().validateMerchant()`. - Handling the `onpaymentauthorized` callback: `paypal.Applepay().confirmOrder()`. Before you show the Apple Pay button, make sure that you can create an Apple Pay instance and that the device can make an Apple Pay payment. Use `ApplePaySession.canMakePayments` to check if the device can make Apple Pay payments. ## Register your sandbox domains - Log into the PayPal Developer Dashboard. - Register all high-level domains and subdomains that show the Apple Pay button, such as businessexample.com and checkout.businessexample.com. - After the domains and subdomains are registered, you can test the Apple Pay buttons after you register the domains and subdomains. ## Create Apple Pay sandbox account - Create an Apple Pay sandbox account on the Apple Developer website to get a test wallet and test cards to test your Apple Pay integration. If you already have an Apple sandbox account, you can use that account and move on to the next step. - Create an [Apple developer account](https://developer.apple.com/). - Create an [Apple sandbox account](https://developer.apple.com/apple-pay/sandbox-testing/). - Get test cards from your Apple sandbox account. ## Integrate Apple Pay checkout Follow this integration process to add Apple Pay as a checkout option, customize the payment experience, and process payments. ## Test your integration Test your Apple Pay integration in the PayPal sandbox and production environments to ensure that your app works correctly. Use your personal sandbox login information during checkout to complete a payment using Apple Pay. Then, log into the sandbox site [sandbox.paypal.com](https://sandbox.paypal.com) to see that the money has moved into your account. - Open your test page with the Safari web browser on an iOS device or computer. - Get a test card from your Apple sandbox account. - Add the test card to your Apple Wallet on your iOS device or by using the Safari browser on the web. - Tap the Apple Pay button to open a pop-up with the Apple Pay payment sheet. - Make a payment using the Apple Pay payment sheet. - If you have an additional confirmation page on your merchant website, continue to confirm the payment. - Log in to your merchant account and continue to your confirmation page to confirm that the money you used for payment showed up in the account. ## Go live Make Apple Pay available to buyers using your website or app. ## Important: Before going live, complete [production onboarding](https://www.paypal.com/bizsignup/add-product?product=payment_methods&capabilities=APPLE_PAY) to process Apple Pay payments with your live PayPal account. ## Live environment If you're a new merchant, sign up for a [PayPal business account](https://www.paypal.com/us/business). Use your personal production login information during checkout to complete an Apple Pay transaction. Then log into [paypal.com](https://www.paypal.com) to see the money move out of your account. ## Getting started in your live environment Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Register your live domain on PayPal - Add all high-level domains that show the Apple Pay button. - Log into the PayPal Developer Dashboard. - Select the Sandbox/Live toggle so it shows Live. - Go to Apps & Credentials. - Scroll down to Features > Accept payments > Advanced Credit and Debit Card Payments. - Check if Apple Pay is enabled. If Apple Pay isn't enabled, select the Apple Pay checkbox and select the Save link to enable Apple Pay. - Select the Manage link in the Apple Pay section. - Select Add Domain and enter your domain name. - Select Register Domain. If registration fails, check that the domain association file is live and saved to the right place on your live site. ## Register your live domain on PayPal - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Create Apple Pay sandbox account - Create an Apple Pay sandbox account on the Apple Developer website to get a test wallet and test cards to test your Apple Pay integration. If you already have an Apple sandbox account, you can use that account and move on to the next step. - Create an [Apple developer account](https://developer.apple.com/). - Create an [Apple sandbox account](https://developer.apple.com/apple-pay/sandbox-testing/). - Get test cards from your Apple sandbox account. ## Integrate Apple Pay checkout - Follow this integration process to add Apple Pay as a checkout option, customize the payment experience, and process payments. ## Test your integration - Test your Apple Pay integration in the PayPal sandbox and production environments to ensure that your app works correctly. - Use your personal sandbox login information during checkout to complete a payment using Apple Pay. Then, log into the sandbox site [sandbox.paypal.com](https://sandbox.paypal.com) to see that the money has moved into your account. ## Go live - Make Apple Pay available to buyers using your website or app. ## Important: Before going live, complete [production onboarding](https://www.paypal.com/bizsignup/add-product?product=payment_methods&capabilities=APPLE_PAY) to process Apple Pay payments with your live PayPal account. ## Live environment - If you're a new merchant, sign up for a [PayPal business account](https://www.paypal.com/us/business). Use your personal production login information during checkout to complete an Apple Pay transaction. Then log into [paypal.com](https://www.paypal.com) to see the money move out of your account. ## Getting started in your live environment - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Register your live domain on PayPal - Add all high-level domains that show the Apple Pay button. - Log into the PayPal Developer Dashboard. - Select the Sandbox/Live toggle so it shows Live. - Go to Apps & Credentials. - Scroll down to Features > Accept payments > Advanced Credit and Debit Card Payments. - Check if Apple Pay is enabled. If Apple Pay isn't enabled, select the Apple Pay checkbox and select the Save link to enable Apple Pay. - Select the Manage link in the Apple Pay section. - Select Add Domain and enter your domain name. - Select Register Domain. If registration fails, check that the domain association file is live and saved to the right place on your live site. ## Register your live domain on PayPal - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Create Apple Pay sandbox account - Create an Apple Pay sandbox account on the Apple Developer website to get a test wallet and test cards to test your Apple Pay integration. If you already have an Apple sandbox account, you can use that account and move on to the next step. - Create an [Apple developer account](https://developer.apple.com/). - Create an [Apple sandbox account](https://developer.apple.com/apple-pay/sandbox-testing/). - Get test cards from your Apple sandbox account. ## Integrate Apple Pay checkout - Follow this integration process to add Apple Pay as a checkout option, customize the payment experience, and process payments. ## Test your integration - Test your Apple Pay integration in the PayPal sandbox and production environments to ensure that your app works correctly. - Use your personal sandbox login information during checkout to complete a payment using Apple Pay. Then, log into the sandbox site [sandbox.paypal.com](https://sandbox.paypal.com) to see that the money has moved into your account. ## Go live - Make Apple Pay available to buyers using your website or app. ## Important: Before going live, complete [production onboarding](https://www.paypal.com/bizsignup/add-product?product=payment_methods&capabilities=APPLE_PAY) to process Apple Pay payments with your live PayPal account. ## Live environment - If you're a new merchant, sign up for a [PayPal business account](https://www.paypal.com/us/business). Use your personal production login information during checkout to complete an Apple Pay transaction. Then log into [paypal.com](https://www.paypal.com) to see the money move out of your account. ## Getting started in your live environment - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Register your live domain on PayPal - Add all high-level domains that show the Apple Pay button. - Log into the PayPal Developer Dashboard. - Select the Sandbox/Live toggle so it shows Live. - Go to Apps & Credentials. - Scroll down to Features > Accept payments > Advanced Credit and Debit Card Payments. - Check if Apple Pay is enabled. If Apple Pay isn't enabled, select the Apple Pay checkbox and select the Save link to enable Apple Pay. - Select the Manage link in the Apple Pay section. - Select Add Domain and enter your domain name. - Select Register Domain. If registration fails, check that the domain association file is live and saved to the right place on your live site. ## Register your live domain on PayPal - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Create Apple Pay sandbox account - Create an Apple Pay sandbox account on the Apple Developer website to get a test wallet and test cards to test your Apple Pay integration. If you already have an Apple sandbox account, you can use that account and move on to the next step. - Create an [Apple developer account](https://developer.apple.com/). - Create an [Apple sandbox account](https://developer.apple.com/apple-pay/sandbox-testing/). - Get test cards from your Apple sandbox account. ## Integrate Apple Pay checkout - Follow this integration process to add Apple Pay as a checkout option, customize the payment experience, and process payments. ## Test your integration - Test your Apple Pay integration in the PayPal sandbox and production environments to ensure that your app works correctly. - Use your personal sandbox login information during checkout to complete a payment using Apple Pay. Then, log into the sandbox site [sandbox.paypal.com](https://sandbox.paypal.com) to see that the money has moved into your account. ## Go live - Make Apple Pay available to buyers using your website or app. ## Important: Before going live, complete [production onboarding](https://www.paypal.com/bizsignup/add-product?product=payment_methods&capabilities=APPLE_PAY) to process Apple Pay payments with your live PayPal account. ## Live environment - If you're a new merchant, sign up for a [PayPal business account](https://www.paypal.com/us/business). Use your personal production login information during checkout to complete an Apple Pay transaction. Then log into [paypal.com](https://www.paypal.com) to see the money move out of your account. ## Getting started in your live environment - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Register your live domain on PayPal - Add all high-level domains that show the Apple Pay button. - Log into the PayPal Developer Dashboard. - Select the Sandbox/Live toggle so it shows Live. - Go to Apps & Credentials. - Scroll down to Features > Accept payments > Advanced Credit and Debit Card Payments. - Check if Apple Pay is enabled. If Apple Pay isn't enabled, select the Apple Pay checkbox and select the Save link to enable Apple Pay. - Select the Manage link in the Apple Pay section. - Select Add Domain and enter your domain name. - Select Register Domain. If registration fails, check that the domain association file is live and saved to the right place on your live site. ## Register your live domain on PayPal - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Create Apple Pay sandbox account - Create an Apple Pay sandbox account on the Apple Developer website to get a test wallet and test cards to test your Apple Pay integration. If you already have an Apple sandbox account, you can use that account and move on to the next step. - Create an [Apple developer account](https://developer.apple.com/). - Create an [Apple sandbox account](https://developer.apple.com/apple-pay/sandbox-testing/). - Get test cards from your Apple sandbox account. ## Integrate Apple Pay checkout - Follow this integration process to add Apple Pay as a checkout option, customize the payment experience, and process payments. ## Test your integration - Test your Apple Pay integration in the PayPal sandbox and production environments to ensure that your app works correctly. - Use your personal sandbox login information during checkout to complete a payment using Apple Pay. Then, log into the sandbox site [sandbox.paypal.com](https://sandbox.paypal.com) to see that the money has moved into your account. ## Go live - Make Apple Pay available to buyers using your website or app. ## Important: Before going live, complete [production onboarding](https://www.paypal.com/bizsignup/add-product?product=payment_methods&capabilities=APPLE_PAY) to process Apple Pay payments with your live PayPal account. ## Live environment - If you're a new merchant, sign up for a [PayPal business account](https://www.paypal.com/us/business). Use your personal production login information during checkout to complete an Apple Pay transaction. Then log into [paypal.com](https://www.paypal.com) to see the money move out of your account. ## Getting started in your live environment - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Register your live domain on PayPal - Add all high-level domains that show the Apple Pay button. - Log into the PayPal Developer Dashboard. - Select the Sandbox/Live toggle so it shows Live. - Go to Apps & Credentials. - Scroll down to Features > Accept payments > Advanced Credit and Debit Card Payments. - Check if Apple Pay is enabled. If Apple Pay isn't enabled, select the Apple Pay checkbox and select the Save link to enable Apple Pay. - Select the Manage link in the Apple Pay section. - Select Add Domain and enter your domain name. - Select Register Domain. If registration fails, check that the domain association file is live and saved to the right place on your live site. ## Register your live domain on PayPal - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Create Apple Pay sandbox account - Create an Apple Pay sandbox account on the Apple Developer website to get a test wallet and test cards to test your Apple Pay integration. If you already have an Apple sandbox account, you can use that account and move on to the next step. - Create an [Apple developer account](https://developer.apple.com/). - Create an [Apple sandbox account](https://developer.apple.com/apple-pay/sandbox-testing/). - Get test cards from your Apple sandbox account. ## Integrate Apple Pay checkout - Follow this integration process to add Apple Pay as a checkout option, customize the payment experience, and process payments. ## Test your integration - Test your Apple Pay integration in the PayPal sandbox and production environments to ensure that your app works correctly. - Use your personal sandbox login information during checkout to complete a payment using Apple Pay. Then, log into the sandbox site [sandbox.paypal.com](https://sandbox.paypal.com) to see that the money has moved into your account. ## Go live - Make Apple Pay available to buyers using your website or app. ## Important: Before going live, complete [production onboarding](https://www.paypal.com/bizsignup/add-product?product=payment_methods&capabilities=APPLE_PAY) to process Apple Pay payments with your live PayPal account. ## Live environment - If you're a new merchant, sign up for a [PayPal business account](https://www.paypal.com/us/business). Use your personal production login information during checkout to complete an Apple Pay transaction. Then log into [paypal.com](https://www.paypal.com) to see the money move out of your account. ## Getting started in your live environment - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Register your live domain on PayPal - Add all high-level domains that show the Apple Pay button. - Log into the PayPal Developer Dashboard. - Select the Sandbox/Live toggle so it shows Live. - Go to Apps & Credentials. - Scroll down to Features > Accept payments > Advanced Credit and Debit Card Payments. - Check if Apple Pay is enabled. If Apple Pay isn't enabled, select the Apple Pay checkbox and select the Save link to enable Apple Pay. - Select the Manage link in the Apple Pay section. - Select Add Domain and enter your domain name. - Select Register Domain. If registration fails, check that the domain association file is live and saved to the right place on your live site. ## Register your live domain on PayPal - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Create Apple Pay sandbox account - Create an Apple Pay sandbox account on the Apple Developer website to get a test wallet and test cards to test your Apple Pay integration. If you already have an Apple sandbox account, you can use that account and move on to the next step. - Create an [Apple developer account](https://developer.apple.com/). - Create an [Apple sandbox account](https://developer.apple.com/apple-pay/sandbox-testing/). - Get test cards from your Apple sandbox account. ## Integrate Apple Pay checkout - Follow this integration process to add Apple Pay as a checkout option, customize the payment experience, and process payments. ## Test your integration - Test your Apple Pay integration in the PayPal sandbox and production environments to ensure that your app works correctly. - Use your personal sandbox login information during checkout to complete a payment using Apple Pay. Then, log into the sandbox site [sandbox.paypal.com](https://sandbox.paypal.com) to see that the money has moved into your account. ## Go live - Make Apple Pay available to buyers using your website or app. ## Important: Before going live, complete [production onboarding](https://www.paypal.com/bizsignup/add-product?product=payment_methods&capabilities=APPLE_PAY) to process Apple Pay payments with your live PayPal account. ## Live environment - If you're a new merchant, sign up for a [PayPal business account](https://www.paypal.com/us/business). Use your personal production login information during checkout to complete an Apple Pay transaction. Then log into [paypal.com](https://www.paypal.com) to see the money move out of your account. ## Getting started in your live environment - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Register your live domain on PayPal - Add all high-level domains that show the Apple Pay button. - Log into the PayPal Developer Dashboard. - Select the Sandbox/Live toggle so it shows Live. - Go to Apps & Credentials. - Scroll down to Features > Accept payments > Advanced Credit and Debit Card Payments. - Check if Apple Pay is enabled. If Apple Pay isn't enabled, select the Apple Pay checkbox and select the Save link to enable Apple Pay. - Select the Manage link in the Apple Pay section. - Select Add Domain and enter your domain name. - Select Register Domain. If registration fails, check that the domain association file is live and saved to the right place on your live site. ## Register your live domain on PayPal - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Create Apple Pay sandbox account - Create an Apple Pay sandbox account on the Apple Developer website to get a test wallet and test cards to test your Apple Pay integration. If you already have an Apple sandbox account, you can use that account and move on to the next step. - Create an [Apple developer account](https://developer.apple.com/). - Create an [Apple sandbox account](https://developer.apple.com/apple-pay/sandbox-testing/). - Get test cards from your Apple sandbox account. ## Integrate Apple Pay checkout - Follow this integration process to add Apple Pay as a checkout option, customize the payment experience, and process payments. ## Test your integration - Test your Apple Pay integration in the PayPal sandbox and production environments to ensure that your app works correctly. - Use your personal sandbox login information during checkout to complete a payment using Apple Pay. Then, log into the sandbox site [sandbox.paypal.com](https://sandbox.paypal.com) to see that the money has moved into your account. ## Go live - Make Apple Pay available to buyers using your website or app. ## Important: Before going live, complete [production onboarding](https://www.paypal.com/bizsignup/add-product?product=payment_methods&capabilities=APPLE_PAY) to process Apple Pay payments with your live PayPal account. ## Live environment - If you're a new merchant, sign up for a [PayPal business account](https://www.paypal.com/us/business). Use your personal production login information during checkout to complete an Apple Pay transaction. Then log into [paypal.com](https://www.paypal.com) to see the money move out of your account. ## Getting started in your live environment - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Register your live domain on PayPal - Add all high-level domains that show the Apple Pay button. - Log into the PayPal Developer Dashboard. - Select the Sandbox/Live toggle so it shows Live. - Go to Apps & Credentials. - Scroll down to Features > Accept payments > Advanced Credit and Debit Card Payments. - Check if Apple Pay is enabled. If Apple Pay isn't enabled, select the Apple Pay checkbox and select the Save link to enable Apple Pay. - Select the Manage link in the Apple Pay section. - Select Add Domain and enter your domain name. - Select Register Domain. If registration fails, check that the domain association file is live and saved to the right place on your live site. ## Register your live domain on PayPal - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Create Apple Pay sandbox account - Create an Apple Pay sandbox account on the Apple Developer website to get a test wallet and test cards to test your Apple Pay integration. If you already have an Apple sandbox account, you can use that account and move on to the next step. - Create an [Apple developer account](https://developer.apple.com/). - Create an [Apple sandbox account](https://developer.apple.com/apple-pay/sandbox-testing/). - Get test cards from your Apple sandbox account. ## Integrate Apple Pay checkout - Follow this integration process to add Apple Pay as a checkout option, customize the payment experience, and process payments. ## Test your integration - Test your Apple Pay integration in the PayPal sandbox and production environments to ensure that your app works correctly. - Use your personal sandbox login information during checkout to complete a payment using Apple Pay. Then, log into the sandbox site [sandbox.paypal.com](https://sandbox.paypal.com) to see that the money has moved into your account. ## Go live - Make Apple Pay available to buyers using your website or app. ## Important: Before going live, complete [production onboarding](https://www.paypal.com/bizsignup/add-product?product=payment_methods&capabilities=APPLE_PAY) to process Apple Pay payments with your live PayPal account. ## Live environment - If you're a new merchant, sign up for a [PayPal business account](https://www.paypal.com/us/business). Use your personal production login information during checkout to complete an Apple Pay transaction. Then log into [paypal.com](https://www.paypal.com) to see the money move out of your account. ## Getting started in your live environment - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Register your live domain on PayPal - Add all high-level domains that show the Apple Pay button. - Log into the PayPal Developer Dashboard. - Select the Sandbox/Live toggle so it shows Live. - Go to Apps & Credentials. - Scroll down to Features > Accept payments > Advanced Credit and Debit Card Payments. - Check if Apple Pay is enabled. If Apple Pay isn't enabled, select the Apple Pay checkbox and select the Save link to enable Apple Pay. - Select the Manage link in the Apple Pay section. - Select Add Domain and enter your domain name. - Select Register Domain. If registration fails, check that the domain association file is live and saved to the right place on your live site. ## Register your live domain on PayPal - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Create Apple Pay sandbox account - Create an Apple Pay sandbox account on the Apple Developer website to get a test wallet and test cards to test your Apple Pay integration. If you already have an Apple sandbox account, you can use that account and move on to the next step. - Create an [Apple developer account](https://developer.apple.com/). - Create an [Apple sandbox account](https://developer.apple.com/apple-pay/sandbox-testing/). - Get test cards from your Apple sandbox account. ## Integrate Apple Pay checkout - Follow this integration process to add Apple Pay as a checkout option, customize the payment experience, and process payments. ## Test your integration - Test your Apple Pay integration in the PayPal sandbox and production environments to ensure that your app works correctly. - Use your personal sandbox login information during checkout to complete a payment using Apple Pay. Then, log into the sandbox site [sandbox.paypal.com](https://sandbox.paypal.com) to see that the money has moved into your account. ## Go live - Make Apple Pay available to buyers using your website or app. ## Important: Before going live, complete [production onboarding](https://www.paypal.com/bizsignup/add-product?product=payment_methods&capabilities=APPLE_PAY) to process Apple Pay payments with your live PayPal account. ## Live environment - If you're a new merchant, sign up for a [PayPal business account](https://www.paypal.com/us/business). Use your personal production login information during checkout to complete an Apple Pay transaction. Then log into [paypal.com](https://www.paypal.com) to see the money move out of your account. ## Getting started in your live environment - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Register your live domain on PayPal - Add all high-level domains that show the Apple Pay button. - Log into the PayPal Developer Dashboard. - Select the Sandbox/Live toggle so it shows Live. - Go to Apps & Credentials. - Scroll down to Features > Accept payments > Advanced Credit and Debit Card Payments. - Check if Apple Pay is enabled. If Apple Pay isn't enabled, select the Apple Pay checkbox and select the Save link to enable Apple Pay. - Select the Manage link in the Apple Pay section. - Select Add Domain and enter your domain name. - Select Register Domain. If registration fails, check that the domain association file is live and saved to the right place on your live site. ## Register your live domain on PayPal - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Create Apple Pay sandbox account - Create an Apple Pay sandbox account on the Apple Developer website to get a test wallet and test cards to test your Apple Pay integration. If you already have an Apple sandbox account, you can use that account and move on to the next step. - Create an [Apple developer account](https://developer.apple.com/). - Create an [Apple sandbox account](https://developer.apple.com/apple-pay/sandbox-testing/). - Get test cards from your Apple sandbox account. ## Integrate Apple Pay checkout - Follow this integration process to add Apple Pay as a checkout option, customize the payment experience, and process payments. ## Test your integration - Test your Apple Pay integration in the PayPal sandbox and production environments to ensure that your app works correctly. - Use your personal sandbox login information during checkout to complete a payment using Apple Pay. Then, log into the sandbox site [sandbox.paypal.com](https://sandbox.paypal.com) to see that the money has moved into your account. ## Go live - Make Apple Pay available to buyers using your website or app. ## Important: Before going live, complete [production onboarding](https://www.paypal.com/bizsignup/add-product?product=payment_methods&capabilities=APPLE_PAY) to process Apple Pay payments with your live PayPal account. ## Live environment - If you're a new merchant, sign up for a [PayPal business account](https://www.paypal.com/us/business). Use your personal production login information during checkout to complete an Apple Pay transaction. Then log into [paypal.com](https://www.paypal.com) to see the money move out of your account. ## Getting started in your live environment - Verify any domain names in your live environment that will show an Apple Pay button. Apple Pay transactions only work on a domain and site registered to you. - [Download and host](#download-host) the domain association file for your live environment. - [Register your live domain](#register-your-live-domain) on your PayPal Developer Dashboard. ## Register your live domain on PayPal - Add all high-level domains that show the Apple Pay button. - Log into the PayPal Developer Dashboard. - Select the Sandbox/Live toggle so it shows Live. - Go to Apps & Credentials. - Scroll down to Features > Accept payments > Advanced Credit and Debit Card Payments. - Check if Apple Pay is enabled. If Apple Pay isn't enabled, select the Apple Pay checkbox and select the Save link to enable Apple Pay. - Select the Manage link in the Apple Pay section. - Select Add Domain and enter your domain name. - Select Register Domain. If registration fails, check that the domain association file is live and saved --- # Save Apple Pay with the JavaScript SDK Save Apple Pay payment methods so merchants can make recurring payments without the payer being present. **info** **Note:** Apple Pay can't be used as a payment method for returning buyers, according to Apple guidelines. ## How it works When a payer on your website agrees to save the Apple Pay payment method, PayPal creates a customer record after the first successful transaction, encrypts the payment method information, and stores it in the vault. The saved payment information can only be accessed by the merchant. The merchant can use this saved payment method to make recurring payments on behalf of the payer. - The payer chooses to save their payment method. - For a first-time payer, PayPal generates a customer ID. Store this in your system for future use. ## Know before you code - To accept one-time or recurring payments using Apple Pay, you need a business account that is approved by PayPal. - You'll need an existing [Apple Pay](https://developer.apple.com/apple-pay/sandbox-testing/) integration. - Complete the steps in [Get started](https://api.rest/) to get the following sandbox account information from the Developer Dashboard: - Sandbox client ID and secret of [a REST app](https://www.paypal.com/signin?returnUri=https%3A%2F%2Fdeveloper.paypal.com%2Fdeveloper%2Fapplications%26intent%3Ddeveloper) - Access token to use the PayPal REST API server. - This integration uses the following: - [PayPal JavaScript SDK](https://sdk.paypal.com/) - [Orders REST API](https://docs.api.rest/) ## Enable Apple Pay Before your app can save Apple Pay as a payment method, verify that your sandbox business account supports Apple Pay. See the [Apple Pay integration guide](https://docs/checkout/apm/apple-pay/#link-setupyoursandboxaccounttoacceptapplepay) for more information. **info** **Note:** When your integration is ready to go live, read the **Go live** section below for details about the additional steps needed for Apple Pay onboarding. This screenshot shows the Apple Pay sandbox settings in the mobile and digital payments section of the PayPal Developer Dashboard. This only applies to direct merchant integrations: ![A, screenshot, showing, the, Apple, Pay, sandbox, settings, in, the, mobile, and, digital, payments, section, of, the, PayPal, Developer, Dashboard](https://paypalobjects.com/devdoc/sdk_acdc_acceptpayments.png) ## Create an Apple Pay Payment Session An Apple Pay Payment Session is a payment sheet that PayPal shows to the payer to start a payment. Request an Apple Pay Payment Session by passing the following request object: ### **`Apple Pay Payment Session`** ```javascript // Note: the `applepayConfig` object in this request is the response from `paypal.Applepay().config()`. const paymentRequest = { countryCode: applepayConfig.countryCode, merchantCapabilities: applepayConfig.merchantCapabilities, supportedNetworks: applepayConfig.supportedNetworks, currencyCode: "USD", requiredShippingContactFields: ["name", "phone", "email", "postalAddress"], requiredBillingContactFields: ["postalAddress"], lineItems: [ { label: "Recurring", amount: "100.00", paymentTiming: "recurring", recurringPaymentStartDate: "2023-06-08T18:09:07.501Z" } ], total: { label: "Demo", type: "final", amount: "100.00" } }; const session = new ApplePaySession(4, paymentRequest); ``` ## Create order and Save Apple Pay ### Server-side Set up your server to call the [Create Order v2 API endpoint](https://docs/api/rest/). The Apple Pay button pressed on the client side determines the payment_source sent in the following sample. This SDK uses the [Orders v2 REST API](https://docs/api/rest/) to save the Apple Pay payment method in the background. Add the attributes needed to save an Apple Pay payment method by using the request from **Save Apple Pay for the first time** below. ### Platform considerations When your platform saves a payment method, it can be owned by either: - Your platform. - A merchant on your platform. If you are a platform, pass the the build notation (BN) code of the partner in the [PayPal-Partner-Attribution-Id](https://api.rest/requests/#link-httprequestheaders) header for server-side calls to the Orders API. PayPal uses this information for reporting and tracking purposes. For a merchant on your platform, pass the [PayPal-Auth-Assertion](https://api.rest/requests/) header as part of calls to the Orders API. This ensures that the owner of the saved payment method is the merchant, not your platform. ### Save Apple Pay for the first time Save the Apple Pay payment method the first time a payer opts in. This request is for payers who meet both of these conditions: - Payer hasn't previously stored Apple Pay as a payment method for recurring purchases. - Payer consents to store the Apple Pay payment method for future use. ### Request ```javascript curl -v -X POST https://api-m.sandbox.paypal.com/v2/checkout/orders -H "Content-Type: application/json" -H "Authorization: Bearer ACCESS-TOKEN" -H "PayPal-Partner-Attribution-Id: BN-CODE" -d '{ "intent": "CAPTURE", "purchase_units": [{ "reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b", "amount": { "currency_code": "USD", "value": "100.00" } }], "payment_source": { "apple_pay": { "stored_credential": { "payment_initiator": "CUSTOMER", "payment_type": "RECURRING" }, "attributes": { "vault": { "store_in_vault": "ON_SUCCESS" } } } } } } ``` **info** **Note:** When payment_source.apple_pay.attributes.vault.store_in_vault is set to ON_SUCCESS , that means the Apple Pay payment method is saved when the authorization or capture succeeds. ### Response Pass the order.id to the JavaScript SDK. The SDK updates the order with the Apple Pay payment method that the payer selects. PayPal handles any PCI Compliance checks. The request needs to pass payment_source.attributes.vault.store_in_vault to save the Apple Pay payment method. Details about a saved payment method are available only after an order is authorized or captured. ### **`Response Code`** ```javascript { "id": "5O190127TN364715T", "status": "CREATED", "intent": "CAPTURE", "payment_source": { "apple_pay": { "name": "Firstname Lastname", "email_address": "payer@example.com", "phone_number": { "national_number": "15555555555" }, "card": { "name": "Firstname Lastname", "last_digits": "4949", "brand": "VISA", "type": "CREDIT", "billing_address": { "address_line_1": "123 Main St.", "admin_area_2": "Anytown", "admin_area_1": "CA", "postal_code": "12345", "country_code": "US" } } }, "purchase_units": [{ "reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b", "amount": { "currency_code": "USD", "value": "100.00" } }], "create_time": "2021-10-28T21:18:49Z", "links": [{ "href": "https://api-m.sandbox.paypal.com/v2/checkout/orders/5O190127TN364715T", "rel": "self", "method": "GET" }, { "href": "https://www.sandbox.paypal.com/checkoutnow?token=5O190127TN364715T", "rel": "approve", "method": "GET" }, { "href": "https://api-m.sandbox.paypal.com/v2/checkout/orders/5O190127TN364715T", "rel": "update", "method": "PATCH" }, { "href": "https://api-m.sandbox.paypal.com/v2/checkout/orders/5O190127TN364715T/capture", "rel": "capture", "method": "POST" } ] } } ``` The Payment Method Tokens API still saves the payment source even after the Orders API returns its response and sends a webhook after the payment source is saved. In order to retrieve a vault_id when an APPROVED status is returned, you'll need to subscribe to the VAULT.PAYMENT-TOKEN.CREATED [webhook](https://api.rest/webhooks/event-names/#vault). The Payment Method Tokens API sends a webhook after the payment source is saved. An example of the VAULT.PAYMENT-TOKEN.CREATED webhook payload is shown in the following sample: ### **`Check Orders API response`** ```javascript { "id": "WH-1KN88282901968003-82E75604WM969463F", "event_version": "1.0", "create_time": "2022-08-15T14:13:48.978Z", "resource_type": "payment_token", "resource_version": "3.0", "event_type": "VAULT.PAYMENT-TOKEN.CREATED", "summary": "A payment token has been created.", "resource": { "time_created": "2022-08-15T07:13:48.964PDT", "links": [ { "href": "https://api-m.sandbox.paypal.com/v3/vault/payment-tokens/9n6724m", "rel": "self", "method": "GET", "encType": "application/json" }, { "href": "https://api-m.sandbox.paypal.com/v3/vault/payment-tokens/9n6724m", "rel": "delete", "method": "DELETE" } ], "id": "nkq2y9g", "payment_source": { "card": { "last_digits": "1111", "brand": "VISA", "expiry": "2027-02", "billing_address": { "address_line_1": "123 Main St.", "admin_area_2": "Anytown", "admin_area_1": "CA", "postal_code": "12345", "country_code": "US" } } }, "customer": { "id": "695922590" } }, "links": [ { "href": "https://api-m.sandbox.paypal.com/v1/notifications/webhooks-events/WH-1KN88282901968003-82E75604WM969463F", "rel": "self", "method": "GET" }, { "href": "https://api-m.sandbox.paypal.com/v1/notifications/webhooks-events/WH-1KN88282901968003-82E75604WM969463F/resend", "rel": "resend", "method": "POST" } ] } } ``` In the previous example, the resource.id field is the vault ID. The resource.customer.id is the PayPal-generated customer ID. ## Test your integration Test your Apple Pay integration in the PayPal sandbox and production environments to ensure that your app works correctly. Use your personal sandbox login information during checkout to complete a payment using Apple Pay. Then, log into the sandbox site [sandbox.paypal.com](https://sandbox.paypal.com/) to see that the money has moved into your account. - Open your test page with the Safari web browser on an iOS device or computer. - Get a test card from your Apple sandbox account. - Add the test card to your Apple Wallet on your iOS device or by using the Safari browser on the web. - Tap the **Apple Pay** button to open a pop-up with the Apple Pay payment sheet. - Make a payment using the Apple Pay payment sheet. - If you have an additional confirmation page on your merchant website, continue to confirm the payment. - Log in to your merchant account and continue to your confirmation page to confirm that the money you used for payment showed up in the account. ### Test cards for Apple Pay Refer to Apple's [sandbox testing page](https://developer.apple.com/apple-pay/sandbox-testing/) to learn more about using test cards for Apple Pay. ## Next steps - Test and go live with this integration. See the **Go live** section below for more details. - Complete [production onboarding](https://www.paypal.com/bizsignup/entry/product/ppcp) to be eligible to process cards with your live PayPal account. - Change the credentials and API URLs from api-m.sandbox.paypal.com to api-m.paypal.com when going live with your integration. - You can [create orders](https://docs/api/rest/) without the payment_source.paypal.attributes.vault for subsequent or recurring transactions. - You can [get a payment token](https://docs/api/rest/payment-tokens/v3/#payment-tokens_get) , [list all payment tokens](https://docs/api/rest/payment-tokens/v3/#payment-tokens_payment-tokens) , [delete a payment token](https://docs/api/rest/payment-tokens/v3/#payment-tokens_delete) , and more with the [Payment Method Tokens API](https://docs/api/rest/payment-tokens/v3/). - To manage subsequent or recurring transactions, see [Use Saved Payment Token](https://docs/checkout/save-payment-methods/purchase-later/cards/#link-sampleapirequestwithpaymenttokenassociatedwithcard). ## Go live - Go to paypal.com and sign in with your business account. - Go to **Account Settings > Payment Method > Enable Apple Pay** . - In the Apple Pay payment methods section, select **Get Started** . - After you submit the details on the Profile collection, your status will change to "Your eligibility to save customer Apple Pay payment methods is under review". It might be approved instantly as well. - Based on information provided in the profile collection of the Business Account, you might see a status like **Denied** , **Success** , or **Need more information** . Once the information is vetted, you get a **Success** status. --- # Authorize a payment and capture funds later The PayPal Checkout integration supports a 2-step authorize and capture payment model. Authorize a buyer's funds before you capture them, then settle the purchase later. An authorization places a hold on the funds and is valid for 29 days. For example, use authorize and capture to complete a task before finalizing the payment, such as verifying that you have the item in stock. ## How it works - The payer checks out and provides a payment method. - You authorize the payment. - A hold is placed on the payment method until you are ready to capture payment. - You finalize the transaction and capture the payment. - The payer's payment method is charged. ## Know before you code ### You need a developer account to get sandbox credentials PayPal uses the following REST API credentials, which you can get from the developer dashboard: - Client ID : Authenticates your account with PayPal and identifies an app in your sandbox. - Client secret : Authorizes an app in your sandbox. Keep this secret safe and don't share it. ### PayPal Checkout This feature modifies an existing PayPal Checkout integration and uses the following: - [JavaScript SDK:](/sdk/js/) Adds PayPal-supported payment methods. - [Orders REST API:](/docs/api/orders/v2/) Create, update, retrieve, authorize, and capture orders. - [Payments REST API:](/docs/api/payments/v2/) Authorize, capture, retrieve, and refund payments. ### Explore PayPal APIs with Postman You can use Postman to explore and test PayPal APIs. Learn more in our [Postman guide](/api/rest/postman). The default approval intent of the JavaScript SDK is to both authorize the transaction and capture payment immediately. To split authorize and capture into separate actions, add `intent=authorize` to the JavaScript SDK script tag, as shown in the following example: #### **`Change intent sample code`** ```javascript ` ### Loading script There are 2 options for passing the FraudNet data on the web page: Option 1: Insert this code after the fnparams configuration script: 1 `2Option 2: Append this code after your logic and pass your configuration as options: 1 `{2fnUrl:"https://c.paypal.com/da/r/fb.js";3}4function_loadFraudnetConfig(options){5varscript=document.createElement("script");6script.src=options.fnUrl;7document.body.appendChild(script);8}` ## Noscript ### Noscript snippet The noscript/ code block renders only in web browsers that don't have JavaScript enabled. The code collects data from a visitor, even when JavaScript isn't available: 1 `