# Apple Pay {#pm_applepay} **Parent topic:**[Digital wallet payments](en_pm_ewallet.md) ## Overview {#en_pm_applepay_overview} An article about the payment method which allows you to process payments in different currencies by using Apple services in different countries and supports one-time one-step and two-step purchases, credential-on-file purchases, refunds, payment card verification, and payouts. ### Introduction {#section_i11_bg5_1xb .section} Apple Pay is a payment method which allows you to process payments in different currencies by using Apple Pay services in different regions.This method supports one-time one-stepand two-step purchases, credential-on-file purchases, refunds, payouts, and payment card verification. This article provides information about working with the Apple Pay method: general insights are presented in the Overview section, while information about the actions required to process payments and perform other actions is presented in the sections that follow. ### General information {#section_tbf_2zk_ggb .section} |Payment method type|digital wallet payments| |Payment instruments|payments cards| |Countries and regions|all regions supported by the Apple Pay service \([details](https://support.apple.com/en-us/HT207957)\)| |Payment currencies|all currencies supported by American Express, Mastercard and Visa payment systems in supported regions| |Currency conversion|on the Ecommpay side| |One-time purchases|+| |Credential-on-file purchases|+| |Full refunds|+| |Partial refunds|+| |Payouts|+| |Card verification|+| |Chargebacks|+| |Notes|- when using the Apple Pay methodthe American Express, Mastercard and Visa payment cards can be used - the following features apply tothe 4th generation Payment Page: - customers can only usedevices that are supported by the Apple Pay service \([details](https://support.apple.com/en-gb/HT208531)\) - Safari is the only supported browser - Payment Page can only be opened in a new browser tab\(without other options\) - customers can be allowed to select different currencies in the payment form \([details](en_pp_currency_choice.md)\) - the following features apply to the 5th generation Payment Page: - customers can useany devices and browsers as long as they comply with the supported use cases \([details](pm_applepay.md#section_ljp_2l5_xgc)\) - all supported options can be used to open the payment form \([details](en_PP_Integration.md)\), but for options to open the payment form in an iframe element or in a modal window, registration of the merchant domains in the Apple Pay service is required \([details](en_dbl_projects.md#)\) - customers can be allowed to select different currencies in the payment form \([details](en_pp_currency_choice.md)\) - collecting customer data by using the Apple Pay service is supported \([details](pm_applepay.md#section_p5j_fgl_ggb)\) - the following features apply to purchases by using Gate: - the domain of the web serviceshould be registered in the Apple services \([details](https://developer.apple.com/documentation/applepaywebmerchantregistrationapi/registering_with_apple_pay_and_applying_to_use_the_api)\) - the web service should supportscripting functionality for starting an Apple Pay session \([details](https://developer.apple.com/documentation/apple_pay_on_the_web)\) - customers can only usedevices that are supported by the Apple Pay service \([details](https://support.apple.com/en-gb/HT208531)\) - Safari is the only supported browser - payouts can only be made to payment cards registered in the Apple Pay service only after at least one purchase has been processed using such a card - An Apple Pay branded payment button can be embedded into the interface of the web service to ensure the capability of processing express checkout payments, in which case the interaction between the web service and the platform will differ from the one described in this article \([details](en_pp_embedded_payment_buttons.md#)\) | |Onboarding and access fee|refer to your Ecommpay key account manager, additional information available in the [Ecommpay shop](https://ecommpay.com/shop/payment-methods/apple-pay/)| ### Interaction diagram {#section_tsp_gzk_ggb .section} Payment processing by using the Apple Pay method involves the merchant's web service, one of Ecommpay interfaces, the Ecommpay payment platform, and technical facilities of the Apple Pay service. ![](images/pm/en_applepay_functional.svg) ### Operations support {#section_rnx_4cl_ggb .section} Various platform interfaces can be used to process payments and perform operations using the Apple Pay method. Purchases can be processed by using Payment Page, Gate and Dashboard \(using payment links\), refunds and payouts—by using Gate and Dashboard. ### Processing scenarios {#section_fgt_sdl_ggb .section} To perform a purchase by using the Apple Pay method, the payment session must be initiated and the customer needs to perform the required steps, while to make a refund you need to receive a request from the customer and notify the customer about the result of the refund via the web service. To process a payout, you need to notify the customer via the web service. ![](images/pm/eng_applepay_interfaces_pp.svg "Purchase by using Payment Page") ![](images/pm/eng_applepay_interfaces_gate.svg "Purchase by using Gate") ![](images/pm/eng_applepay_interfaces_gate_refund.svg "Refund by using Gate") ![](images/pm/en_applepay_interfaces_gate_payout.svg "Payout by using Gate") Scenarios for performing operations via the main interfaces of the payment platform correspond to those presented in the diagrams. Similarly, when additional features \(such as payment links\) are used, scenarios for performing operations also correspond to the specifics of those features. ## One-time purchases by using Payment Page {#en_pm_applepay_pp_purchase} ### General information {#section_gtg_vxk_m2b .section} To process a purchase through Payment Pageby using the Apple Pay method, the merchant's web service is required to send a request with all required parameters and signature to the Ecommpay URL and receive a callback with the result. In case of a two-step purchase, it might be required, at a later point, to confirm the capture of the held funds.The full sequence and special aspects of one-step purchase processing are provided below. ![](images/pm/eng_applepay_uml_pp.svg) 1. A customer initiates a purchase in the web service. 2. The web service sends the request for opening Payment Page to the specified Ecommpay URL. 3. The request for opening Payment Page is sent to the payment platform. 4. The payment platform receives the request and validates the required parameters and signature. 5. Payment Page is generated based on the project and request parameters. 6. Payment Page is displayed to the customer. 7. The customer selects the Apple Pay method. 8. The payment platform receives the request for processing the payment by using the Apple Pay method. 9. The payment platform processes the request and sends it to the Apple Pay service. 10. The request for starting payment session is processed and the session data is generated on the Apple Pay service side. 11. The payment platform receives the payment session information from the Apple Pay service. 12. Payment Page receives the payment session initialisation data from the payment platform. 13. Payment Page initiates the payment session and displays the Apple Pay app or interface for purchase confirmation to the customer. 14. The customer completes all required steps and confirms the purchase. 15. The customer data is processed on the Apple Pay service side. 16. The customer is redirected to the Payment Page loading page. 17. The payment platform receives encrypted customer data from the Apple Pay service. 18. The payment platform processes the request and sends it to the card organisation service. 19. The purchase is processed in the card organisation service. 20. The card organisation service sends a notification about the result to the payment platform. 21. The payment platform sends the payment result callback to the web service. 22. The payment platform sends the result information to Payment Page. 23. The result information is displayed to the customer on Payment Page. In case of a two-step purchase, the process of placing the authorisation hold via Payment Page using the Apple Pay method is identical to the workflow sequence of a one-step purchase, with the exception that instead of an immediate debiting of funds an authorisation hold is initiated and executed. Information about the formats of requests and callbacks used for processing payments by using the Apple Pay method via Payment Page is presented [further](pm_applepay.md#section_p5j_fgl_ggb) in this section; general information about working with the Payment Page API is presented in [Interaction concepts](en_pp_interaction_organisation.md#). ### Browser-specific workflows {#section_ljp_2l5_xgc .section} Payments using the Apple Pay method via the 5th generation Payment Page can be made through various browsers. Primarily, the customer can use Apple’sSafari browser on any supported device or a third-party browser on an Apple mobile devicerunning iOS 18 or iPadOS 18 \(or later versions\). In this case, the [basic process](pm_applepay.md#fig_rdy_fpx_dhb) described above applies. Additionally, the customer can use a third-party browser on any other supported device. In this case: 1. After the customer selects the Apple Pay method in the payment form, a QR code for the initiated payment is generated and displayed. 2. The customer scans the QR code using their iPhone or iPad camera and confirms the payment using the Apple Pay service\(using integrated technologies such as Face ID or Touch ID\). 3. Once the payment is processed on the Apple Pay service side, the result is displayed to the customer\(on the customer's mobile device as well as in the browser where the payment form with the QR code was initially displayed\). ![](images/ecommpay/pm_pp_scenario/pm_applepay_1.svg "Selecting the method") ![](images/ecommpay/pm_pp_scenario/pm_applepay_3.svg "Redirecting to the Apple Pay service") ![](images/ecommpay/pm_pp_scenario/pm_applepay_4.svg "Confirming the payment") ![](images/ecommpay/pm_pp_scenario/pm_applepay_5.svg "Redirecting to the payment form") **Note:** Just like in the default case \(when Safari is used\) additional features are available when payments are made with the Apple Pay method by using third-party browsers. These include the capability for customers to select payment currencies \([details](en_pp_currency_choice.md)\) and payment retries \([details](en_PP_Try_Again.md)\). ### Request format {#section_p5j_fgl_ggb .section} There are several things you need to consider when sending purchase requests by using the Apple Pay method: 1. The following parameters required for any payment must be specified: - `project_id`—project identifier obtained from Ecommpay during integration - `payment_id`—payment identifier unique within the project - `payment_currency`—payment currency code in the ISO-4217 alpha-3 format - `payment_amount`—payment amount in the smallest currency unit - `customer_id`—customer identifier unique within the project 2. To specify the type of purchase that is different from the default one set for the specific project, pass `sale` \(for immediate withdrawal of funds during one-step purchase processing\) or `auth`\(to place an authorisation hold during two-step purchase processing\) in the `operation_type` parameter. 3. If you need to have payment form displayed with the Apple Pay method selected, set the `force_payment_method` parameter to: - `apple_pay_core`—to open Payment Page with pre-selected payment method Apple Pay - `card`—for the ability of payment by using either a payment card or Apple Pay. In this case customer can chose the payment method on Payment Page 4. To collect specific customer data on the Apple Pay service side \(in cases when the 5th generation of Payment Page is used and such data collection is not configured for all payments within the project; [details](en_PP_Gathering_customer_data.md)\), pass the `payment_methods_options` parameter with a list of the requested data in the `billing_contact_fields` array included in the `apple_pay_core` object. The following information can be requested: - `email`—the customer's email address - `name`—the customer's first and last name - `phone`—the customer's phone number - `postal_code`—the postal code from the customer's address - `billing_address`—the customer's billing address For example, to collect the customer's email address and phone number, pass the `payment_methods_options` parameter as follows. ``` {#codeblock_csj_dkz_5gc .language-json} "payment_methods_options": {"apple_pay_core":{"billing_contact_fields":["email","phone"]}} ``` ``` {#codeblock_oql_sd1_vgc .language-json} "payment_methods_options": {\"apple_pay_core\":{\"billing_contact_fields\":[\"email\",\"phone\"]}} ``` 5. Additionally, any other parameters available for working with Payment Page can be used \([details](en_PP_Parameters.md)\). 6. After all target parameters are specified, generate a signature \([details](en_platform_signature.md#)\). Thus, a correct request for opening the payment form using the Apple Pay method must contain the project identifier, basic payment information \(identifier, amount, and currency code\), customer identifier and signature. ```language-json { "project_id": 120, "payment_id": "580", "payment_amount": 1000, "payment_currency": "USD", "customer_id": "customer1", "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg==" } ``` **Warning:** In order to enhance the quality of payment processing and ensure compliance with industry standards, starting from January 15, 2026, merchants in certain business categories must specify the `booking_info` parameter containing information about the start and end dates of the booked service \([details](en_pp_additional_data.md#)\), for each initiated [card purchase](en_pm_cardpayments.md). This requirement applies to merchants with [Merchant Category Codes \(MCC\)](en_glossary.md#) 3000–3999, 4411, 4511, 4722, 5962, 6513, 7011, 7012, 7512, 7519, and 7922. ### Callback format {#section_dpx_2hl_ggb .section} The Apple Pay method uses the standard format for callbacks to deliver purchase results. For more information, see [Handling callbacks](en_platform_callbacks.md#). The callbacks containing information about processed purchases include the token of the card in the `token` parameter of the `account` object, which can only be used for initiating payouts. The following is the example of a callback with information about a `1,000.00 USD` purchase in the `580` project. ```language-json { "project_id": 580, "payment": { "id": "ECT_TEST_15671726468667687", "type": "purchase", "status": "success", "date": "2019-08-30T13:58:12+0000", "method": "etoken", "sum": { "amount": 100000, "currency": "USD" }, "description": "ECT_TEST_1567172646866" }, "account": { "number": "431422******0056" }, "operation": { "id": 47478000001698, "type": "sale", "status": "success", "date": "2019-08-30T13:58:12+0000", "created_date": "2019-08-30T13:58:06+0000", "request_id": "0a5cb476be3a55010fb050ec1c1cbd35361ac912a3", "sum_initial": { "amount": 100000, "currency": "USD" }, "sum_converted": { "amount": 100000, "currency": "USD" }, "provider": { "id": 1187, "payment_id": "24fb3f30-000f-5000-8000-1c329d900c68", "date": "2019-08-30T13:58:09+0000", "auth_code": "591748" }, "code": "0", "message": "Success" }, "signature": "5DtWEGy+dMGZZnm3Owjgw9ly67Mb9siv7+WD1u7AyIYdQ==" } } ``` The following is the example of a callback for a purchase declined due to insufficient funds on card. ```language-json { "account": { "number": "431422******0056" }, "customer": { "id": "964282" }, "payment": { "date": "2019-08-06T12:57:03+0000", "id": "10906183900", "method": "etoken", "status": "decline", "sum": { "amount": 1030000, "currency": "USD" }, "type": "purchase", "description": "test" }, "project_id": 312, "country": "GB", "product_name": "Visa Rewards", "issuer_name": "Example Bank", "operation": { "id": 45047000000055, "type": "sale", "status": "decline", "date": "2019-08-06T12:57:03+0000", "created_date": "2019-08-06T12:57:00+0000", "request_id": "f92c3dfdf76133d5e1a9d26279b3b77b7da32e", "sum_initial": { "amount": 1030000, "currency": "USD" }, "sum_converted": { "amount": 1030000, "currency": "USD" }, "provider": { "id": 1187, "payment_id": "5cb2f2fb-e4df-4807-8839-067f9366d506", "auth_code": "" }, "code": "10105", "message": "Insufficient funds on card" }, "signature": "9CIXvWMsKOcQsWEHKLsSVSRo8YNjIxHPjEEQSmLAtClQ==" } } ``` ### Useful links {#section_xpz_thl_ggb .section} The following articles can be useful when implementing purchases via Payment Page: - [Interaction concepts](en_pp_interaction_organisation.md#)—about the interaction with the payment platform by using Payment Page. - [Signature generation and verification](en_platform_signature.md#)—about the procedure of generating and verifying signatures in requests and callbacks. - [Payment processing](en_platform_payment_model.md)—about the types, processing models, and possible statuses of supported payments and operations. - [One-time one-step purchase](en_platform_sms_model.md)—about processing of one-time one-step purchases by using Payment Page. - [Handling operation processing information](en_platform_payment_info_codes.md)—about error and response codes that are used in the payment platform to record information about performing of operations. ## One-time purchases by using Gate {#en_pm_applepay_gate_purchase} ### General information {#section_lsx_3jl_ggb .section} To process a purchase through Gate by using the Apple Pay method, the merchant's web service is required to do the following: 1. Send a request for starting payment session with all the required parameters and signature to the Ecommpay URL. 2. Receive customer and payment session data in an intermediate callback. 3. Send a purchase request with all the required parameters and signature to the Ecommpay URL. 4. Get the final callback with the payment result from the payment platform. The full sequence and special aspects of purchase processing are provided below. ![](images/pm/eng_applepay_uml_gate.svg) 1. A customer initiates a purchase by using the Apple Pay method in the web service. 2. The web service sends the request for processing the purchase by using Gate to the specified Ecommpay URL. 3. The payment platform receives the request. 4. The payment platform validates the required parameters and signature in the request. 5. The request for starting the payment session is redirected to the Apple Pay service. 6. The request for starting the payment session is processed on the Apple Pay service side. 7. The payment platform receives the payment session data from the Apple Pay service. 8. The payment platform sends the callback with the data for starting the payment session to the web service. 9. The web service initiates the payment session and displays the Apple Pay app or interface for purchase confirmation to the customer. 10. The customer completes all required payment steps and confirms the purchase. 11. The customer data is processed on the Apple Pay service side. 12. The customer is redirected to the web service loading page. 13. The web service receives encrypted customer data from the Apple Pay service. 14. The web service sends the request for purchase processing to the specified Ecommpay URL. 15. The payment platform receives the request for processing the payment. 16. The payment platform validates the required parameters and signature in the request. 17. The payment platform sends the response to the web service with information about the receipt of the request and its validity \([details](en_gate_interaction_organisation.md#)\). 18. The payment platform performs further processing of the request \(with parameter consistency check\) and sends it to the card organisation service. 19. The request is processed on the card organisation service side. 20. The card organisation service sends the payment result notification to the payment platform. 21. The payment platform sends the payment result callback to the web service. 22. The customer receives the payment result information from the web service. To initiate a payment session on the side of the merchant's web service, you need to implement integration with the Apple Pay service according to its [documentation](https://applepaydemo.apple.com/). A range of supplementary features supported by the service can be used in such integrations including the functionality of collecting customer data. Information about the formats of requests and callbacks used for interacting with the Ecommpay payment platform to process payments by using the Apple Pay method via Gate is presented further in this section. General information about working with the Gate API is presented in [Interaction concepts](en_gate_interaction_organisation.md#). ### Request format for starting the payment session {#section_osx_3jl_ggb .section} There are several things you need to consider when sending requests for starting the payment session by using the Apple Pay method: 1. To start each session, send a separate POST request to the [/v2/session/applepay](https://api-developers.ecommpay.com/api-specification/apple-pay/post-v2-session-applepay). 2. Each request must include the following objects and parameters: - Object `general`—general purchase information: - `project_id`—project identifierobtained from Ecommpay during integration - `validation_url`—URL for validation - `domain_name`—domain name of the merchant web service - `display_name`—the name of the project to display, must contain no more than 64 characters - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) ```language-json { "general" : { "project_id": 175, "signature": "VJ/h5ogVuQ6oMNLLxvvKeYBT6o+Se5mDLXHChlDZrjJX...==", "validation_url": "https://apple-pay-gateway.apple.com/paymentservices/startSession", "domain_name": "appay.eu.ngrok.io", "display_name": "test payment" } } ``` ### Purchase request format {#section_f1d_551_1jb .section} There are several things you need to consider when sending purchase requests by using the Apple Pay method: 1. To initiate each purchase, send a separate POST requestto one of the following endpoints: - [/v2/payment/applepay/sale](https://api-developers.ecommpay.com/api-specification/apple-pay/post-v2-payment-applepay-sale) for one-step purchases - [/v2/payment/applepay/auth](https://api-developers.ecommpay.com/api-specification/apple-pay/post-v2-payment-applepay-auth) for two-step purchases 2. Each request must include the following objects and parameters: - Object `general`—general purchase information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - Object `payment`—payment information: - `amount`—payment amount in the smallest currency unit - `currency`—payment currency codein the ISO-4217 alpha-3 format - `cryptocurrency_type`—the indicator that specifies the type of the cryptocurrency, required for Mastercard and Visa payments involving cryptocurrencies. This parameter should be assigned one of the following values: - `cbdc`—a central bank digital currency or tokenized deposit issued by a central bank, reserve bank, or other national monetary authority; - `stablecoins_fiat_backed`—a fiat-backed digital asset with reserves held by a licensed financial institution; - `native_tokens`—a digital currency native to a specific blockchain, required for transactions within its network, including fee payments; - `other`—a non-fiat digital asset that does not fit other types or cannot be classified at the time of transaction initiation. - Object `customer`—customer information: - `id`—customer identifierunique within the project - `ip_address`—customer IP addressrelevant for the initiated payment - `etoken`— information about token that represents card details received from the Apple Pay service: - `token`—token received from Apple Pay in JSON format after user identification, must be specified as a string. The value of this parameter can contain such information as the payment identifier on the Apple Pay side, the type of the international payment system, and various service data. ```language-json { "paymentData":{ "version":"EC_v1", "data":"perkYfGgfMXL/lTG DCSDfR7x4Qz2E/p7WZqBBJJ+/z2iWUIEBNDsovnwhwTeVXAAAAAAAA==", "header":{ "ephemeralPublicKey":"MWnwEQ==", "publicKeyHash":"tl+QgkoijbTvIomdnCLsdfbvwauh5656we9wvth2+1w=", "transactionId":"u85785def5ce96a8ada846sre2v6r6yry5htj93e50152" } }, "paymentMethod":{ "displayName":"Visa 1005", "network":"Visa", "type":"debit" }, "transactionIdentifier":"TFDG767HGSFDSJ7AL4435393E5882652" } ``` ```language-json "token": "{"paymentData":{"version":"EC_v1","data":"perkYfGgfMXL/lTGDCSDfR7x4Qz2E/p7WZqBBJJ+/z2iWUIEBNDsovnwhwTeVXAAAAAAAA==","header":{"ephemeralPublicKey":"MWnwEQ==","publicKeyHash":"tl+QgkoijbTvIomdnCLsdfbvwauh5656we9wvth2+1w=","transactionId":"u85785def5ce96a8ada846sre2v6r6yry5htj93e50152"}},"paymentMethod":{"displayName":"Visa 1005","network":"Visa","type":"debit"},"transactionIdentifier":"TFDG767HGSFDSJ7AL4435393E5882652"}" ``` 3. Additionally, any other parameters included in the specification can be used. Thus, a correct purchase request by using the Apple Pay method must contain the project identifier, basic payment information \(identifier, amount, and currency code\), customer identifier and IP address, the Apple Pay token, as well as signature. ```language-json { "general": { "project_id": 580, "payment_id": "TEST_15427033321774", "signature": "96c+hWk1zweuGKwDRrl+Se5mDLXHChlDZrjJXZw7ew6ow3RpGYv4U...==" }, "customer": { "ip_address": "192.0.2.0", "id": "123" }, "payment": { "amount": 1000, "currency": "USD" }, "etoken": { "token": "..." } } ``` ```language-json { "general": { "project_id": 580, "payment_id": "TEST_15427033321774", "signature": "96c+hWk1zweuGKwDRrl+Se5mDLXHChlDZrjJXZw7ew6ow3RpGYv4U...==" }, "customer": { "ip_address": "192.0.2.0", "id": "123" }, "payment": { "amount": 1000, "currency": "USD" }, "etoken": { "token": "..." } } ``` **Warning:** In order to enhance the quality of payment processing and ensure compliance with industry standards, starting from January 15, 2026, merchants in certain business categories must specify the `booking_info` object containing information about the start and end dates of the booked service \([details](en_gate_additional_data.md#)\), for each initiated [card purchase](en_pm_cardpayments.md). This requirement applies to merchants with [Merchant Category Codes \(MCC\)](en_glossary.md#) 3000–3999, 4411, 4511, 4722, 5962, 6513, 7011, 7012, 7512, 7519, and 7922. ### Two-step purchase debiting request format {#section_zpl_x34_nkb .section} There are several things you need to consider when sending debiting requests by using the Apple Pay method: 1. To initiate each debiting, send a separate POST request to the [/v2/payment/applepay/capture](https://api-developers.ecommpay.com/api-specification/apple-pay/post-v2-payment-applepay-capture) endpoint. 2. Each request must include the following objects and parameters: - Object `general`—general purchase information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - Object `payment`—payment information: - `amount`—payment amount in the smallest currency unit - `currency`—payment currency codein the ISO-4217 alpha-3 format 3. The amount and currency must match the values in the authorisation request. 4. Additionally, any other parameters included in the specification can be used. Thus, a correct purchase request by using the Apple Pay method must contain the project identifier, basic payment information \(identifier, amount, and currency code\), as well as signature. ```language-json { "general": { "project_id": 580, "payment_id": "TEST_15427033321774", "signature": "96c+hWk1zweuGKLXHChlDZrjJXZw7ew6ow3RpGYv4U...==" }, "payment": { "amount": 1000, "currency": "USD" } ``` ### Two-step purchase cancellation request format {#section_p2j_dm4_nkb .section} There are several things you need to consider when sending purchase cancellation requests by using the Apple Pay method: 1. To initiate each cancellation, send a separate POST request to the [/v2/payment/applepay/cancel](https://api-developers.ecommpay.com/api-specification/apple-pay/post-v2-payment-applepay-cancel-etoken) endpoint. 2. Each request must include the following objects and parameters: - Object `general`—general purchase information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) 3. Additionally, any other parameters included in the specification can be used. Thus, a correct purchase request by using the Apple Pay method must contain the project and payment identifiers, as well as signature. ```language-json { "general": { "project_id": 580, "payment_id": "TEST_15427033321774", "signature": "9DRrl+Se5mDLXHChlDZrjJXZw7ew6ow3RpGYv4U...==" } ``` ### Callback format {#section_wsx_3jl_ggb .section} The Apple Pay method uses the standard format for callbacks to deliver purchase results. For more information, see [Handling callbacks](en_platform_callbacks.md#). The callbacks containing information about processed purchases include the token of the card in the `token` parameter of the `account` object, which can only be used for initiating payouts. The following is the example of a callback with information about a `1,000.00 USD` purchase made in the `580` project. ```language-json { "project_id": 580, "payment": { "id": "ECT_TEST_15671726468667687", "type": "purchase", "status": "success", "date": "2019-08-30T13:58:12+0000", "method": "etoken", "sum": { "amount": 100000, "currency": "USD" }, "description": "ECT_TEST_1567172646866" }, "account": { "number": "431422******0056" }, "operation": { "id": 47478000001698, "type": "sale", "status": "success", "date": "2019-08-30T13:58:12+0000", "created_date": "2019-08-30T13:58:06+0000", "request_id": "0a5cb476be3a55010fb050ec1c1cbd35361ac912a3", "sum_initial": { "amount": 100000, "currency": "USD" }, "sum_converted": { "amount": 100000, "currency": "USD" }, "provider": { "id": 1187, "payment_id": "24fb3f30-000f-5000-8000-1c329d900c68", "date": "2019-08-30T13:58:09+0000", "auth_code": "591748" }, "code": "0", "message": "Success" }, "signature": "5DtWEGy+dMGZZnm3Owjgw9ly67Mb9siv7+WD1u7AyIYdQ==" } } ``` The following is the example of a callback for a purchase declined due to insufficient funds on card. ```language-json { "account": { "number": "431422******0056" }, "customer": { "id": "964282" }, "payment": { "date": "2019-08-06T12:57:03+0000", "id": "10906183900", "method": "etoken", "status": "decline", "sum": { "amount": 1030000, "currency": "USD" }, "type": "purchase", "description": "test" }, "project_id": 312, "country": "GB", "product_name": "Visa Rewards", "issuer_name": "Example Bank", "operation": { "id": 45047000000055, "type": "sale", "status": "decline", "date": "2019-08-06T12:57:03+0000", "created_date": "2019-08-06T12:57:00+0000", "request_id": "f92c3dfdf76133d5e1a9d26279b3b77b7da32e", "sum_initial": { "amount": 1030000, "currency": "USD" }, "sum_converted": { "amount": 1030000, "currency": "USD" }, "provider": { "id": 1187, "payment_id": "5cb2f2fb-e4df-4807-8839-067f9366d506", "auth_code": "" }, "code": "10105", "message": "Insufficient funds on card" }, "signature": "9CIXvWMsKOcQsWEHKLsSVSRo8YNjIxHPjEEQSmLAtClQ==" } } ``` ### Useful links {#section_xsx_3jl_ggb .section} The following articles can be useful when implementing purchases via Gate: - [Interaction concepts](en_gate_interaction_organisation.md#)—about the interaction with the payment platform by using Gate. - [Signature generation and verification](en_platform_signature.md#)—about the procedure of generating and verifying signatures in requests and callbacks. - [Payment processing](en_platform_payment_model.md)—about the types, processing models, and possible statuses of supported payments and operations. - [One-time one-step purchase](en_platform_sms_model.md)—about processing of one-time one-step purchases by using Gate. - [Handling operation processing information](en_platform_payment_info_codes.md)—about error and response codes that are used in the payment platform to record information about performing of operations. ## COF purchases by using Payment Page {#en_pm_applepay_pp_recurring} ### General information {#section_gtg_vxk_m2b .section} The Apple Pay payment method provides the ability to perform COF purchases—regular on-demand payments. For more information about COF purchases, see [On-demand COF purchase](en_platform_recurring_model.md). Registration of a COF purchases is also available by using Payment Page. For registration the web service must send a request containing the required parameters and signature, as well as data for registering a COF purchase in the `recurring` object, to the Ecommpay URL and accept a callback with the result. In the callback about registering a COF purchase, you will get its ID, which you need to use to make or cancel regular payments via Gate or Dashboard. For more information, see the section [COF purchases by using Gate](pm_applepay.md#). Information about the formats of requests and callbacks used for processing payments by using the Apple Pay method via Payment Page is presented further in this section; general information about working with the Payment Page API is presented in [Interaction concepts](en_pp_interaction_organisation.md#). ### Request format {#section_p5j_fgl_ggb .section} There are several things you need to consider when sending purchase requests for registering COF purchases by using the Apple Pay method: 1. The following parameters required for any payment must be specified: - `project_id`—project identifier obtained from Ecommpay during integration - `payment_id`—payment identifier unique within the project - `payment_currency`—payment currency code in the ISO-4217 alpha-3 format - `payment_amount`—payment amount in the smallest currency unit - `customer_id`—customer identifier unique within the project 2. To register a COF purchase, you must specify a `recurring` object containing the registration attribute and the necessary information. To register regular payments, the request must contain information about the frequency, amount, and beginning and end time of regular payments. The full list of parameters that can be passed in the `recurring` object is shown in the [COF purchase registration](en_pp_recurring.md) section. 3. If you need to have payment form displayed with the Apple Pay method selected, set the `force_payment_method` parameter to: - `apple_pay_core`—to open Payment Page with pre-selected payment method Apple Pay - `card`—for the ability of payment by using either a payment card or Apple Pay. In this case customer can chose the payment method on Payment Page 4. Additionally, any other parameters available for working with Payment Page can be used \([details](en_PP_Parameters.md)\). 5. After all target parameters are specified, generate a signature \([details](en_platform_signature.md#)\). Thus, a correct request for opening the payment form using the Apple Pay method must contain the project identifier, basic payment information \(identifier, amount, and currency code\), customer identifier and signature. ```language-json { "project_id": 120, "payment_id": "580", "payment_amount": 100000, "payment_currency": "USD", "customer_id": "customer1", "recurring": {"register":true,"type":"R","expiry_year":2025,"expiry_month":"01","period":"D","time":"10:00:00","start_date":"15-11-2020","scheduled_payment_id":"A2323"}, "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg==" } ``` ### Callback format {#section_dpx_2hl_ggb .section} The Apple Pay method uses the standard format for callbacks to deliver COF purchase results. For more information, see [Handling callbacks](en_platform_callbacks.md#). The following is the example of a callback with information about a successful COF purchase registration made by a customer in the `208` project. ```language-json { "project_id": 208, "payment": { "id": "payment", "type": "purchase", "status": "success", "date": "2018-11-20T08:44:46+0000", "method": "etoken", "sum": { "amount": 300, "currency": "USD" }, "description": "payment" }, "account": { "number": "431422******0056" }, "recurring": { "id": 1000030038, "currency": "USD", "valid_thru": "-0001-11-30T00:00:00+0000" }, "operation": { "id": 1000034, "type": "recurring", "status": "success", "date": "2018-11-20T08:44:46+0000", "created_date": "2018-11-20T08:44:41+0000", "request_id": "07fd7ade7cf010", "sum_initial": { "amount": 300, "currency": "USD" }, "sum_converted": { "amount": 300, "currency": "USD" }, "provider": { "id": 1381, "payment_id": "2548950091", "date": "2020-11-20T08:44:45+0000", "auth_code": "" }, "code": "0", "message": "Success" }, "signature": "x2tsnvLCRXZMX8Kwyr9a8+I3RipuPWUod5c89cDSQ6cRq...==" } ``` ### Useful links {#section_xpz_thl_ggb .section} The following articles can be useful when implementing purchases via Payment Page: - [Interaction concepts](en_pp_interaction_organisation.md#)—about the interaction with the payment platform by using Payment Page. - [Signature generation and verification](en_platform_signature.md#)—about the procedure of generating and verifying signatures in requests and callbacks. - [Payment processing](en_platform_payment_model.md)—about the types, processing models, and possible statuses of supported payments and operations. - [One-time one-step purchase](en_platform_sms_model.md)—about processing of one-time one-step purchases by using Payment Page. - [Handling operation processing information](en_platform_payment_info_codes.md)—about error and response codes that are used in the payment platform to record information about performing of operations. ## COF purchases by using Gate {#en_pm_applepay_gate_recurring} ### General information {#section_lsx_3jl_ggb .section} The Apple Pay payment method provides the ability to perform COF purchases—regular on-demand payments. For more information about COF purchases, see [On-demand COF purchase](en_platform_recurring_model.md). Information about the formats of requests and callbacks used for processing payments by using the Apple Pay method via Gate is presented further in this section. General information about working with the Gate API is presented in [Interaction concepts](en_gate_interaction_organisation.md#). ### COF purchase registration {#section_qhf_wsn_j3b .section} To register a COF purchase by using Gate, the merchant is required to send a request for purchase with all the required parameters \(including the `register` parameter of the `recurring` object, set to the value `true`\) to the Ecommpay URL and get the callback with the payment result from the payment platform. To register a regular payment the request should also contain information about the frequency, amount, start and end dates of regular payments. The COF purchase registration callback contains its identifier, which can be used to process or cancel regular payments. For more information about purchase processing by using Gate, see [One-time purchases by using Gate](pm_applepay.md#). ### Format of requests for registration of COF purchases {#section_osx_3jl_ggb .section} There are several things you need to consider when sending requests for registering COF purchases by using the Apple Pay method: 1. To register each COF purchase, send a separate POST request to one of the following endpoints: [/v2/payment/applepay/sale](https://api-developers.ecommpay.com/api-specification/apple-pay/post-v2-payment-applepay-sale) or [/v2/payment/applepay/auth](https://api-developers.ecommpay.com/api-specification/apple-pay/post-v2-payment-applepay-auth). 2. Each request must include the following objects and parameters: - Object `general`—general purchase information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - Object `payment`—payment information: - `amount`—payment amount in the smallest currency unit - `currency`—payment currency codein the ISO-4217 alpha-3 format - `cryptocurrency_type`—the indicator that specifies the type of the cryptocurrency, required for Mastercard and Visa payments involving cryptocurrencies. This parameter should be assigned one of the following values: - `cbdc`—a central bank digital currency or tokenized deposit issued by a central bank, reserve bank, or other national monetary authority; - `stablecoins_fiat_backed`—a fiat-backed digital asset with reserves held by a licensed financial institution; - `native_tokens`—a digital currency native to a specific blockchain, required for transactions within its network, including fee payments; - `other`—a non-fiat digital asset that does not fit other types or cannot be classified at the time of transaction initiation. - Object `customer`—customer information: - `id`—customer identifierunique within the project - `ip_address`—customer IP addressrelevant for the initiated payment - Object `recurring`—COF purchase information: - `register`—payment registration as a COF purchase - `type`—type of the COF purchase: `R` \(for Regular payment\), `C` \(for OneClick payment\), or `U` \(for Autopayment\), for more information, refer to [Overview](en_Gate__saved_cards_payments_type.md) - `scheduled_payment_id`—assigned to the payment within which scheduled debits are performed; it must differ from the identifier of the payment made to register a COF purchase and must be unique within the project - `start_date`—the start date of regular payments, in the `DD-MM-YYYY` format \(must be at least one day later than the date of registration\) - `amount`—amount of debiting - `period`—regular payment performing period - `interval`— regular payment performing interval - `time`—regular payment performing time in the `hh:mm:ss (UTC0)` format 3. Additionally, any other parameters included in the specification can be used. Thus, a correct COF purchase registration request by using the Apple Pay method must contain the project identifier, basic payment information \(identifier, amount, and currency code\), customer identifier and IP address, the registration parameter and the conditions for regular payments, as well as signature. ```language-javascript { "general": { "project_id": 208, "payment_id": "TEST_15427007172789", "signature": "DH0v2pZnkK9hwytQ6/ZtDSQh+wwx/OqrWdbltzO5GMSkzd0Iq6lM2...==", }, "customer": { "id": "123", "ip_address": "192.0.2.0" }, "payment": { "amount": 1000, "currency": "USD" }, "recurring": { "register": true, "type": "R", "amount": 1000, "interval": 1, "cycle": "week", "start_date": "21-11-2018" } } ``` ### Format of requests for COF purchase processing {#section_isb_3xn_j3b .section} After the payment is registered, the funds are debited according to the specified regular payment conditions. You initiate COF purchase by sending a `recurring` request to the payment platform. There are several things you must consider when processing COF purchases performing by using the Apple Pay method: 1. To process each purchase, send a separate POST request to the [/v2/payment/applepay/recurring](https://api-developers.ecommpay.com/api-specification/apple-pay/post-v2-payment-applepay-recurring) endpoint. 2. Each request must include the following objects and parameters: - Object `general`—general purchase information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - Object `payment`—payment information: - `amount`—payment amount in the smallest currency unit - `currency`—payment currency codein the ISO-4217 alpha-3 format - `cryptocurrency_type`—the indicator that specifies the type of the cryptocurrency, required for Mastercard and Visa payments involving cryptocurrencies. This parameter should be assigned one of the following values: - `cbdc`—a central bank digital currency or tokenized deposit issued by a central bank, reserve bank, or other national monetary authority; - `stablecoins_fiat_backed`—a fiat-backed digital asset with reserves held by a licensed financial institution; - `native_tokens`—a digital currency native to a specific blockchain, required for transactions within its network, including fee payments; - `other`—a non-fiat digital asset that does not fit other types or cannot be classified at the time of transaction initiation. - Object `customer`—customer information: - `ip_address`—customer IP addressrelevant for the initiated payment - Object `recurring`—COF purchase information: - `id`—registered COF purchase identifier 3. Additionally, any other parameters included in the specification can be used. Thus, a correct purchase request by using the Apple Pay method must contain the project identifier, basic payment information \(identifier, amount, and currency code\), customer IP address, COF purchase identifier, as well as signature. ```language-javascript { "general": { "project_id": 208, "payment_id": "TEST_15427007172789", "signature": "DH0v2pZnkK9hwytQ6wx/OqrWdbltzO5GMSkzd0Iq6lM2...==", }, "customer": { "ip_address": "192.0.2.0" }, "payment": { "amount": 1000, "currency": "USD" }, "recurring": { "id": 1234567890 } } ``` ### Format of request for cancellation of COF purchases {#section_rrj_cyj_k3b .section} Until the expiration date of a COF purchase, you can cancel it. Also, to change the conditions of COF purchases, you must cancel it and send a request to register a new one. There are several things you must consider when cancelling COF purchases by using the Apple Pay method: 1. To cancel each purchase, send a separate POST request to the [/v2/payment/applepay/recurring/cancel](https://api-developers.ecommpay.com/api-specification/apple-pay/post-v2-payment-applepay-recurring-cancel) endpoint. 2. Each request must include the following objects and parameters: - Object `general`—general purchase information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - Object `recurring`—COF purchase information: - `id`—registered COF purchase identifier 3. Additionally, any other parameters included in the specification can be used. Thus, a correct purchase request by using the Apple Pay method must contain the project, payment and COF purchase identifiers, as well as signature. ```language-javascript { "general": { "project_id": 208, "payment_id": "TEST_15427007172789", "signature": "DH0v2pZnkK9hwytQ6/ZtDzO5GMSkzd0Iq6lM2v8...==", }, "recurring": { "id": 1234567890 } } ``` ### Callback format {#section_wsx_3jl_ggb .section} The standard format for callbacks is used to deliver the results of actions with COF purchases. For more information, see [Handling callbacks](en_platform_callbacks.md#). The following is the example of a callback with an information about COF purchase registration for a customer in the `208` project. ```language-json { "project_id": 208, "payment": { "id": "payment", "type": "recurring", "status": "success", "date": "2018-11-20T08:44:46+0000", "method": "etoken", "sum": { "amount": 300, "currency": "USD" }, "description": "payment" }, "account": { "number": "431422******0056" }, "recurring": { "id": 1000030038, "currency": "USD", "valid_thru": "-0001-11-30T00:00:00+0000" }, "operation": { "id": 1000034, "type": "recurring", "status": "success", "date": "2018-11-20T08:44:46+0000", "created_date": "2018-11-20T08:44:41+0000", "request_id": "07fd7ade7cf010", "sum_initial": { "amount": 300, "currency": "USD" }, "sum_converted": { "amount": 300, "currency": "USD" }, "provider": { "id": 1381, "payment_id": "2548950091", "date": "2020-11-20T08:44:45+0000", "auth_code": "" }, "code": "0", "message": "Success" }, "signature": "x2tsnvLCRXZMXr9a8+I3RipuPWUod5c89cDSQ6cRq...==" } ``` The following is the example of a callback after COF purchase cancellation. ```language-json { "project_id": 208, "payment": { "id": "payment", "type": "recurring", "status": "success", "date": "2018-11-20T08:44:46+0000", "method": "etoken", "sum": { "amount": 300, "currency": "USD" }, "description": "payment" }, "account": { "number": "431422******0056" }, "recurring": { "id": 1000030038, "currency": "USD", "valid_thru": "-0001-11-30T00:00:00+0000" }, "operation": { "id": 1000034, "type": "recurring_cancel", "status": "success", "date": "2018-11-20T08:44:46+0000", "created_date": "2018-11-20T08:44:41+0000", "request_id": "07fd7ade7cf010", "sum_initial": { "amount": 300, "currency": "USD" }, "sum_converted": { "amount": 300, "currency": "USD" }, "provider": { "id": 1381, "payment_id": "2548950091", "date": "2020-11-20T08:44:45+0000", "auth_code": "" }, "code": "0", "message": "Success" }, "signature": "x2tsnvLCRXZMX8Kwyr9a8+I3RipuPWUod5c89cDSQ6cRq...==" } ``` The following is the example of a callback with an information about a declined registration of a COF purchase. ```language-json { "project_id": 208, "payment": { "id": "payment", "type": "recurring", "status": "success", "date": "2018-11-20T08:44:46+0000", "method": "etoken", "sum": { "amount": 300, "currency": "USD" }, "description": "payment" }, "errors": [ { "code": "2701", "message": "Rules Failed Code", "description": "fatal: RULES_FAILED_CODE" } ], "recurring": { "id": 1000700, "currency": "USD", "valid_thru": "-0001-11-30T00:00:00+0000" }, "operation": { "id": 1000034, "type": "recurring", "status": "decline", "date": "2018-11-20T08:44:46+0000", "created_date": "2018-11-20T08:44:41+0000", "request_id": "07fd7ade7cf010", "sum_initial": { "amount": 300, "currency": "USD" }, "sum_converted": { "amount": 300, "currency": "USD" }, "provider": { "id": 1381, "payment_id": "2548950091", "date": "2020-11-20T08:44:45+0000", "auth_code": "" }, "code": "2701", "message": "Rules Failed Code" }, "signature": "x2tsnvLCRXZMX8Kwyr9a8+I3RipuPWUod5c89cDSQ6cRq...==" } ``` ### Useful links {#section_xsx_3jl_ggb .section} The following articles can be useful when implementing purchases via Gate: - [Interaction concepts](en_gate_interaction_organisation.md#)—about the interaction with the payment platform by using Gate. - [Signature generation and verification](en_platform_signature.md#)—about the procedure of generating and verifying signatures in requests and callbacks. - [Payment processing](en_platform_payment_model.md)—about the types, processing models, and possible statuses of supported payments and operations. - [Handling operation processing information](en_platform_payment_info_codes.md)—about error and response codes that are used in the payment platform to record information about performing of operations. ## Refunds by using Gate {#en_pm_applepay_gate_refund} ### General information {#section_lsx_3jl_ggb .section} To perform a refund through Gate by using the Apple Pay method, send a request with all required parameters and signature to the Ecommpay URL and receive a callback with the result.The full sequence and special aspects of refund performing are provided below. ![](images/pm/eng_applepay_uml_gate_refund.svg) 1. A customer initiates a refund. 2. The web service sends the request for performing the refund by using Gate to the specified Ecommpay URL. 3. The payment platform receives the request. 4. The payment platform validates the required parameters and signature in the request. 5. The payment platform sends the response to the web service with information about the receipt of the request and its validity \([details](en_gate_interaction_organisation.md#)\). 6. The payment platform performs further processing of the request \(with parameter consistency check\) and sends it to the card organisation service. 7. The refund is processed on the side of the card organisation service. 8. The card organisation service sends the result notification to the payment platform. 9. The payment platform sends the result callback to the web service. 10. The customer receives the refund result information from the web service. Information about the formats of requests and callbacks used for performing refunds by using the Apple Pay method via Gate is presented further in this section. General information about working with the Gate API is presented in [Interaction concepts](en_gate_interaction_organisation.md#). ### Request format {#section_osx_3jl_ggb .section} There are several things you need to consider when sending refund requests by using the Apple Pay method: 1. To initiate each refund, send a separate POST request to the [/v2/payment/applepay/refund](https://api-developers.ecommpay.com/api-specification/apple-pay/post-v2-payment-applepay-refund) endpoint. 2. Each request must include the following objects and parameters: - Object `general`—general refund information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—identifier of the payment that needs to be refunded - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - Object `payment`—refund information: - `description`—refund description or comment - `amount`—refund amount in the smallest currency unit \(required for a partial refund\) - `currency`—refund currency codein the ISO-4217 alpha-3 format \(required for a partial refund\) - Object `customer`—customer information: - `ip_address`—customer IP addressrelevant for the initiated refund 3. Additionally, any other parameters included in the specification can be used. Thus, a correct refund request by using the Apple Pay method must contain the project and payment identifiers, description of the refund, the customer IP address, signature, and, if necessary, currency code and refund amount. ```language-json { "general": { "project_id": 210, "payment_id": "test_payment", "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA==" }, "payment": { "description": "test refund", "amount": 1000, "currency": "USD" }, "customer": { "ip_address": "192.0.2.0" } } ``` ```language-json { "general": { "project_id": 210, "payment_id": "test_payment", "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA==" }, "payment": { "description": "test refund", "amount": 1000, "currency": "USD" }, "customer": { "ip_address": "192.0.2.0" } } ``` ### Callback format {#section_wsx_3jl_ggb .section} The Apple Pay method uses the standard format for callbacks to deliver refund results. For more information, see [Handling callbacks](en_platform_callbacks.md#). The following is the example of a callback with information about a `10,00 USD` refund made in the `260` project. ``` { "project_id": 260, "payment": { "id": "TEST_15792507735", "type": "purchase", "status": "refunded", "date": "2020-01-20T08:31:36+0000", "method": "etoken", "sum": { "amount": 1000, "currency": "USD" }, "description": "" }, "customer": { "id": "1888" }, "account": { "number": "431422******0056" }, "operation": { "id": 69512000019571, "type": "refund", "status": "success", "date": "2020-01-20T08:31:36+0000", "created_date": "2020-01-20T08:31:35+0000", "request_id": "e0069513" "sum_initial": { "amount": 1000, "currency": "USD" }, "sum_converted": { "amount": 1000, "currency": "USD" }, "code": "0", "message": "Success", "provider": { "id": 1911, "payment_id": "0000438583", "auth_code": "" } }, "signature": "beJ1deUiEDd+7zuo6YrfSRzgEQj34sKAStuW8Fg==" } ``` The following is the example of a callback with information about a declined refund. ```language-json { "project_id": 260, "payment": { "id": "TEST_1579250773501", "type": "purchase", "status": "success", "date": "2020-01-20T08:31:36+0000", "method": "etoken", "sum": { "amount": 100, "currency": "USD" }, "description": "" }, "customer": { "id": "1888" }, "account": { "number": "431422******0056" }, "operation": { "sum_initial": { "amount": 1000, "currency": "USD" }, "sum_converted": { "amount": 1000, "currency": "USD" }, "code": "3283", "message": "Refund amount more than init amount", "provider": { "id": 1911, "payment_id": "0000438582", "auth_code": "" }, "id": 69512000019571, "type": "refund", "status": "decline", "date": "2020-01-20T08:31:36+0000", "created_date": "2020-01-20T08:31:35+0000", "request_id": "e0069142" }, "signature": "beJ1deUiEDd+7zuooJzgEQj34sKAStuW8Fg==" } } ``` ### Useful links {#section_xsx_3jl_ggb .section} The following articles can be useful when implementing refunds via Gate: - [Interaction concepts](en_gate_interaction_organisation.md#)—about the interaction with the payment platform by using Gate. - [Signature generation and verification](en_platform_signature.md#)—about the procedure of generating and verifying signatures in requests and callbacks. - [Payment processing](en_platform_payment_model.md)—about the types, processing models, and possible statuses of supported payments and operations. - [Purchase refunds](en_Gate_Refund.md)—about performing of refunds by using Gate. - [Handling operation processing information](en_platform_payment_info_codes.md)—about error and response codes that are used in the payment platform to record information about performing of operations. ## Payouts by using Gate {#en_pm_applepay_gate_payout} ### General information {#section_lsx_3jl_ggb .section} To process a payout through Gateby using the Apple Pay method, send a request with all required parameters and signature to the Ecommpay URL and receive a callback with the result.The full sequence and special aspects of payout processing are provided below. ![](images/pm/en_applepay_uml_gate_payout.svg) 1. A customer initiates a payout by using the Apple Pay method in the web service. 2. The web service sends the request for processing the payout by using Gate to the specified Ecommpay URL. 3. The payment platform receives the request. 4. The payment platform validates the required parameters and signature in the request. 5. The payment platform sends the response to the web service with information about the receipt of the request and its validity \([details](en_gate_interaction_organisation.md#)\). 6. The payment platform performs further processing of the request \(with parameter consistency check\) and sends it to the card organisation service. 7. The payout is processed on the side of the card organisation service. 8. The card organisation service sends the result notification to the payment platform. 9. The payment platform sends the result callback to the web service. 10. The customer receives the payout result information from the web service. Information about the formats of requests and callbacks used for processing payouts by using the Apple Pay method via Gate is presented further in this section. General information about working with the Gate API is presented in [Interaction concepts](en_gate_interaction_organisation.md#). ### Request format {#section_osx_3jl_ggb .section} There are several things you need to consider when sending payout requests by using the Apple Pay method: 1. To initiate each payout send a separate POST request to the [/v2/payment/card/payout/token](https://api-developers.ecommpay.com/api-specification/card-payments/post-v2-payment-card-payout-token) endpoint. 2. Each request must include the following objects and parameters: - Object `general`—general payout information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - Object `payment`—payment information: - `amount`—payout amount in the smallest currency unit - `currency`—payout currency codein the ISO-4217 alpha-3 format - Object `customer`—customer information: - `id`—customer identifierunique within the project - `first_name`—customer first name - `middle_name`—customer middle name or patronymic - `last_name`—customer last name - `ip_address`—customer IP addressrelevant for the initiated payout - Object `card`—card information: - `card_holder`—full name of the cardholder - `token`—token of the card received from Ecommpay in the parameter included in a callback with information about a processed purchase. 3. In the case of a payout to Visa card issued in Canada, the request must contain the `recipient` object with the payout recipient's address data: - `country`—recipient's country code in ISO 3166-1 alpha-2 - `city`—recipient's city - `address`—recipient's address - if the specified country code is [CA](references/en/countries/CA.md) or [US](references/en/countries/US.md), also pass the `state` parameter that provides information about the recipient's state, province, or any other region 4. In the case of a payout processed as part of the Visa Money Transfer program to a card issued in Brazil or Qatar, the request must contain the sender's phone number in the `phone` parameter of the `sender` object. 5. In the case of a payout that originates from a physical person and that is processed as part of the programs supported for the Mastercard MoneySend service, the request must contain the information about the payout recipient's name in the `first_name` and `last_name` parameters of the `recipient` object and the information about the payout sender in the `sender` object: - number of the sender's payment instrument—`pan` for the sender's card or `wallet_id` for the sender's electronic wallet - `first_name`—sender's first name - `last_name`—sender's last name - `address`—sender's address - `city`—sender's city - `zip`—sender's postal code - `country`—sender's country code in ISO 3166-1 alpha-2 - if the specified country code is [CA](references/en/countries/CA.md) or [US](references/en/countries/US.md), also pass the `state` parameter that provides information about the sender's state, province, or any other region 6. Additionally, any other parameters included in the specification can be used. Thus, a correct payout request by using the Apple Pay method must contain the project identifier, basic payment information \(identifier, amount, and currency code\), customer information, as well as token and signature. ```language-json { "general": { "project_id": 210, "payment_id": "test_payment", "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA==" }, "payment": { "amount": 1000, "currency": "USD" }, "customer": { "id": "customer123", "first_name": "John", "middle_name": "Jr", "last_name": "Jonson", "ip_address": "192.0.2.0" }, "card": { "card_holder": "John Johnson" }, "token": "a989f5ef7ab159dd5c3016eee7563736f" } ``` ```language-json { "general": { "project_id": 210, "payment_id": "test_payment", "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA==" }, "payment": { "amount": 1000, "currency": "USD" }, "customer": { "id": "customer123", "first_name": "John", "middle_name": "Jr", "last_name": "Jonson", "ip_address": "192.0.2.0" }, "card": { "card_holder": "John Johnson" }, "token": "a989f5ef7ab159dd5c3016eee7563736f" } ``` ### Callback format {#section_dpx_2hl_ggb .section} The Apple Pay method uses the standard format for callbacks to deliver payout results. For more information, see [Handling callbacks](en_platform_callbacks.md#). The following is the example of a callback with information about a `1.00 EUR` payout made in the `123` project. ```language-json { "payment": { "method": "card", "sum": { "amount": 100, "currency": "EUR" }, "id": "test_id", "type": "payout", "status": "success", "date": "2023-11-07T07:37:27+0000", "description": "Test payout" }, "customer": { "id": "Test", "ip": "192.0.2.0", "first_name": "Test", "last_name": "Test" }, "account": { "number": "1234******4567", "token": "a9608ce50413260e4201d13dbfcdc75", "type": "visa", "card_holder": "TEST TEST", "expiry_month": "01", "expiry_year": "2031" }, "project_id": 123, "rrn": "331140338636", "testdebet": "credit", "opeation": { "last_processor_message": "Success" }, "operation": { "created_date": "2023-11-07T07:37:22+0000", "request_id": "d22a4c02f61ed9a82140045-00049491", "sum_initial": { "amount": 100, "currency": "EUR" }, "sum_converted": { "amount": 100, "currency": "EUR" }, "code": "0", "message": "Success", "provider": { "id": 414, "payment_id": "0040000018267721", "auth_code": "408112", "endpoint_id": 414, "date": "2023-11-07T07:37:24+0000" }, "id": 49490010084733, "type": "payout", "status": "success", "date": "2023-11-07T07:37:27+0000" }, "signature": "TL2BLpOE/xAVCmYf8SIUXYqmlF1WHtaHQ==" } ``` The following is the example of a callback with information about a declined payout. ```language-json { "payment": { "method": "card", "sum": { "amount": 100, "currency": "EUR" }, "id": "test_id", "type": "payout", "status": "decline", "date": "2023-11-07T07:38:27+0000", "description": "Test payout" }, "customer": { "id": "Test", "ip": "192.0.2.0", "first_name": "Test", "last_name": "Test" }, "account": { "number": "1234******4567", "token": "a9608ce50413260e4201d13dbfcdc75", "type": "visa", "card_holder": "TEST TEST", "expiry_month": "01", "expiry_year": "2031" }, "project_id": 123, "rrn": "", "testdebet": "credit", "opeation": { "last_processor_message": "Decline" }, "operation": { "created_date": "2023-11-07T07:38:22+0000", "request_id": "d22a4c02f61ed9a82140045-00049492", "sum_initial": { "amount": 100, "currency": "EUR" }, "sum_converted": { "amount": 100, "currency": "EUR" }, "code": "20000", "message": "General decline", "provider": { "id": 414, "payment_id": "0040000018267721", "auth_code": "", "endpoint_id": 414, "date": "2023-11-07T07:38:24+0000" }, "id": 49490010084733, "type": "payout", "status": "decline", "date": "2023-11-07T07:38:27+0000" }, "signature": "TL2BLpOE/xAVCmYf8SIUXYqmlF1WHtaHA==" } ``` ### Useful links {#section_xsx_3jl_ggb .section} The following articles can be useful when implementing payouts via Gate: - [Interaction concepts](en_gate_interaction_organisation.md#)—about the interaction with the payment platform by using Gate. - [Signature generation and verification](en_platform_signature.md#)—about the procedure of generating and verifying signatures in requests and callbacks. - [Payment processing](en_platform_payment_model.md)—about the types, processing models, and possible statuses of supported payments and operations. - [Payouts](en_Gate_payout.md)—about processing of payouts by using Gate. - [Handling operation processing information](en_platform_payment_info_codes.md)—about error and response codes that are used in the payment platform to record information about performing of operations. ## Payouts by using Dashboard {#en_pm_applepay_dash_payout} When working with Dashboard, you can process payoutsby using the Apple Pay method using batch requests.Each batch can contain one or more payout requests. To process a number of payouts, prepare and upload a file with information about all target payouts, send a batch request, and verify that the payouts have been processed. Use a CSV file structured according to the requirements presented in the [Mass payments data](en_dbl_payments.md#) section.The payout parameters must comply with the [requirements](pm_applepay.md#) \(you do not have to generate a signature because it is specified by Dashboard\). More information about processing payouts by using Dashboard is presented in a [separate section](en_dbl_payments.md#). ## Payment card verification {#en_pm_applepay_acc_ver} ### General information {#section_lsx_3jl_ggb .section} To perform a payment card verification by using Apple Pay method, the merchant web service must send a request with all the required parameters and signature to Ecommpay URL, and receive a callback with the information about the result. Payment card verification processing for this method is the same as standard processing sequence which is provided in the section [Payment instrument verification](en_gate_account_verification.md). ### Format of request for payment card verification {#section_osx_3jl_ggb .section} There are several things you need to consider when sending payment card verification requests by using the Apple Pay method: 1. To initiate each verification, send a separate POST request to the [/v2/payment/applepay/account\_verification](https://api-developers.ecommpay.com/api-specification/apple-pay/post-v2-payment-applepay-account-verification) endpoint. 2. Each request must include the following objects and parameters: - Object `general`—general purchase information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - Object `payment`—payment information: - `amount`—payment amount in the smallest currency unit - `currency`—payment currency codein the ISO-4217 alpha-3 format - Object `customer`—customer information: - `id`—customer identifierunique within the project - `ip_address`—customer IP addressrelevant for the initiated payment - `etoken`— information about token that represents card details received from the Apple Pay service: - `token`—token received from Apple Pay in JSON format after user identification, must be specified as a string. The value of this parameter can contain such information as the payment identifier on the Apple Pay side, the type of the international payment system, and various service data. ```language-json { "paymentData":{ "version":"EC_v1", "data":"perkYfGgfMXL/lTG DCSDfR7x4Qz2E/p7WZqBBJJ+/z2iWUIEBNDsovnwhwTeVXAAAAAAAA==", "header":{ "ephemeralPublicKey":"MWnwEQ==", "publicKeyHash":"tl+QgkoijbTvIomdnCLsdfbvwauh5656we9wvth2+1w=", "transactionId":"u85785def5ce96a8ada846sre2v6r6yry5htj93e50152" } }, "paymentMethod":{ "displayName":"Visa 1005", "network":"Visa", "type":"debit" }, "transactionIdentifier":"TFDG767HGSFDSJ7AL4435393E5882652" } ``` ```language-json "token": "{"paymentData":{"version":"EC_v1","data":"perkYfGgfMXL/lTGDCSDfR7x4Qz2E/p7WZqBBJJ+/z2iWUIEBNDsovnwhwTeVXAAAAAAAA==","header":{"ephemeralPublicKey":"MWnwEQ==","publicKeyHash":"tl+QgkoijbTvIomdnCLsdfbvwauh5656we9wvth2+1w=","transactionId":"u85785def5ce96a8ada846sre2v6r6yry5htj93e50152"}},"paymentMethod":{"displayName":"Visa 1005","network":"Visa","type":"debit"},"transactionIdentifier":"TFDG767HGSFDSJ7AL4435393E5882652"}" ``` 3. The payment amount must be zero. 4. Additionally, any other parameters included in the specification can be used. Thus, a correct purchase request by using the Apple Pay method must contain the project identifier, basic payment information \(identifier, amount, and currency code\), customer identifier and IP address, Apple Pay token information, as well as signature. ```language-json { "general": { "project_id": 238, "payment_id": "TEST_15427033321774", "signature": "96c+hWk1zweuGKwDRrl+DZrjJXZw7ew6ow3RpGYv4U...==" }, "customer": { "ip_address": "192.0.2.0" }, "payment": { "amount": 0, "currency": "USD" }, "etoken": { "token": "..." } } ``` ```language-json { "general": { "project_id": 238, "payment_id": "TEST_15427033321774", "signature": "96c+hWk1zweuGKwDRrl+DZrjJXZw7ew6ow3RpGYv4U...==" }, "customer": { "ip_address": "192.0.2.0" }, "payment": { "amount": 0, "currency": "USD" }, "etoken": { "token": "..." } } ``` ### Callback format {#section_wsx_3jl_ggb .section} The Apple Pay method uses the standard format for callbacks to deliver results. For more information, see [Payment instrument verification](en_gate_account_verification.md). ### Useful links {#section_xsx_3jl_ggb .section} The following articles can be useful when implementing purchases via Gate: - [Interaction concepts](en_gate_interaction_organisation.md#)—about the interaction with the payment platform by using Gate. - [Signature generation and verification](en_platform_signature.md#)—about the procedure of generating and verifying signatures in requests and callbacks. - [Payment processing](en_platform_payment_model.md)—about the types, processing models, and possible statuses of supported payments and operations. - [One-time one-step purchase](en_platform_sms_model.md)—about processing of one-time one-step purchases by using Gate. - [Handling operation processing information](en_platform_payment_info_codes.md)—about error and response codes that are used in the payment platform to record information about performing of operations. ## Testing {#en_pm_applepay_testing} ### General information {#section_zqw_xfw_xjb .section} For the Apple Pay method, it is possible to test one-step and two-step purchases by using Payment Page and Gate, as well as payment card verification by using Gate. To enable and disable testing, as well getting assistance with setting up a test project, refer to Ecommpay technical support. When testing purchases by using Gate the web service must adhere to the following requirements: - The we service domain should be registered in the Apple services. For registration contact the Ecommpay technical support [support@ecommpay.com](mailto:support@ecommpay.com) - The site supports scripting functionality to start an Apple session according to [documentation](https://developer.apple.com/documentation/apple_pay_on_the_web) Other notes which are specified in the [General information](pm_applepay.md#section_tbf_2zk_ggb) table should be taken into account when testing purchases. When testing payments and operations keep in mind that the test project identifier must be indicated in requests, the interfaces of the emulator of Payment Page and Apple Pay payment forms, the 3‑D Secure authentication page can differ from the production environment. To avoid errors during purchase testing it is recommended to use a payment card which is already registered in the Apple Pay service. This does not influence the processing of real payments by using such cards, but allows to perform full-fledged testing. ### Statuses of test payment and operations {#section_j1z_1s5_zjb .section} The final status of test payments and operations is determined by the amount specified in the request. Test one-step and two-step purchases: - `1000` amount to get the `success` status - `2000`, `5000` or `10001` amount to get the `decline` status Test payment card verification: - `0` amount to get the `success` status - any other amount to get the `decline` status ### One-step purchases by using Payment Page {#section_xjx_rpz_cqb .section} To perform a test one-step purchase by using Payment Page, do the following: 1. Send a correct test request for Payment Page opening to the payment platform. 2. If the `card` or `apple_pay_core` method was not specified in the request—select the method on the emulator page. 3. Confirm the purchase. 4. Receive the final callback with information about the payment result. More information about processing purchases by using the Apple Pay method via Payment Page is provided in the [One-time purchases by using Payment Page](pm_applepay.md#) section. ### One-step purchases by using Gate {#section_zjx_rpz_cqb .section} To perform a test one-step purchase by using Gate, do the following: 1. Send a correct test request for starting a payment session to the payment platform. 2. Receive customer and payment session data. 3. Confirm the purchase. 4. Send a correct test purchase request to the payment platform. 5. Receive the final callback with information about the payment result. More information about processing purchases by using the Apple Pay method via Gate is provided in the [One-time purchases by using Gate](pm_applepay.md#) section. ### One-step purchases by performing authorization hold via Payment Page and capture or cancellation via Gate {#section_bkx_rpz_cqb .section} To perform a test one-step purchase by performing authorization hold via Payment Page and capture or cancellation via Gate, do the following: 1. Send a correct test request for Payment Page opening to the payment platform. 2. If the `card` or `apple_pay_core` method was not specified in the request—select the method on the emulator page. 3. Confirm the purchase. 4. Accept a callback with information about successful authorization hold. 5. Send a capture or cancellation request. 6. Receive the final callback with information about the result. More information about processing purchases by using the Apple Pay method via Gate is provided in the [One-time purchases by using Payment Page](pm_applepay.md#) and [One-time purchases by using Gate](pm_applepay.md#) sections. ### One-step purchases by performing authorization hold and capture or cancellation via Gate {#section_dkx_rpz_cqb .section} To perform a test one-step purchase by performing authorization hold and capture or cancellation via Gate, do the following: 1. Send a correct test request for starting a payment session to the payment platform. 2. Receive customer and payment session data. 3. Send a correct test purchase request to the payment platform. 4. Confirm the purchase. 5. Accept a callback with information about successful authorization hold. 6. Send a capture or cancellation request. 7. Receive the final callback with information about the result. More information about processing purchases by using the Apple Pay method via Gate is provided in the [One-time purchases by using Gate](pm_applepay.md#) section. ### Payment card verification by using Gate {#section_fkx_rpz_cqb .section} To process a test payment card verification by using Gate, send a valid test request for a verification to the payment platform and receive a final callback with information about the verification result. More information about performing payment card verification by using the Apple Pay method via Gate is provided in the [Payment card verification](pm_applepay.md#) section. ## Analysis of payments results {#en_pm_applepay_dash_analysis} To analyse information about payments made with the Apple Pay method and other methods, you can use: - Dashboardinterface toolkitwith various lists and analytic panels. - Reports in CSV file format, available via the **Reports** section \(one-time and periodically\). - Data in JSON format, sent by program requests to a specified URL by using the Data API interface. If you have any questions, refer to the documentation \([Dashboard](en_dbl_about.md) and [Using Data API](en_dbl_api_protocol.md)\) and Ecommpay technical support.