Paypal

Overview

Introduction

Paypal is a payment method which allows to process payments in several currencies by using the Paypal e-wallet in different countries. This method supports one-time and credential-on-file purchases, refunds and payouts.

This article provides information about working with the Paypal 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

Payment method type digital wallet payments
Payment instruments digital wallets
Countries and regions in accordance with the list
Payment currencies AUD, BRL (only in Brazil), CAD, CZK, DKK, EUR, HKD, HUF, INR (only in India), ILS, JPY, MYR (only in Malaysia), MXN, TWD, NZD, NOK, PHP, PLN, GBP, SGD, SEK, CHF, THB, USD
Currency conversion on the ecommpay side
One-time purchases +
Credential-on-file purchases +
Full refunds +
Partial refunds +
Payouts +
Chargebacks +
Notes
  • amounts in HUF, JPY, TWD currencies must be indicated in major currency units (without the decimal part)
  • for merchants registered in the USA there are limitations regarding regions available for payment processing (for more information refer to your ecommpay key account manager)
  • the maximum allowed time for holding funds is calculated starting from the moment the auth operation is created in the ecommpay payment platform and is three days by default, after which the automatic release of funds (cancel) is performed. To reduce the allotted time or change the operation type to withdrawal (capture) refer to your ecommpay key account manager.
Onboarding and access fee in accordance with the procedure, presented further, additional information is available in ecommpay shop

Onboarding

To enable this payment method the merchant needs to grant ecommpay the rights to process payments in the Paypal service (onboarding). Such rights include the right to process purchases and refunds and the right to process payouts. To grant any of these rights the merchant is required to do the following:

  1. Inform the ecommpay key account manager about the readiness to enable the Paypal payment method.
  2. Receive the email with the link to Paypal website from ecommpay.
  3. Follow the link and grant ecommpay the right to process payments. An existing Paypal business account can be used or a new one can be registered.
  4. Receive the email from ecommpay which confirms the right to process payments with the specified Paypal merchant identifier. After that, the technical setup on the ecommpay side must be performed. Usually the setup is complete within three days.
  5. Receive the email from ecommpay which confirms the readiness to process payments by using the Paypal method. After that, the onboarding is complete and the payment method is ready to be used.

If necessary, any of the granted rights may be revoked by the merchant on the side of the Paypal service upon confirmation with the ecommpay key account manager.

Interaction diagram

Payment processing by using the Paypal payment method involves the merchant's web service, one of ecommpay interfaces, and the ecommpay payment platform,and technical facilities of the Paypal service.

Operations support

Various platform interfaces can be used to process payments and perform operations using the Paypal method. Purchases can be processed by using Payment Page, Gate and Dashboard (using payment links), refunds and payouts—by using Gate and Dashboard. At the same time, regardless of the interfaces used, the following properties and limitations are applicable.

When working with the Paypal the following amount limits are applicable.

Amounts, USD ¹ Times ²
minimum maximum basic threshold
Purchases 60,000.00 * 1 minute 3 days
Payouts * 1 minute 30 days
Full refunds 35 days
Partial refunds 35 days
Note:
  1. For more information refer to your ecommpay key account manager.
  2. The base and threshold times are defined as follows:
    • The base time is the average estimated time between the moment a payment is initiated in the payment platform to the moment the payment result is sent to the web service. The base time evaluation is made on the assumption of normal operation of all technical facilities and communication channels and typical customer behaviour (if any input from the customer is required). Use the base time to estimate when to react to the absence of payment result callbacks or when to check payment status (details).
    • The threshold time is the maximum possible time between the moment a payment is initiated in the payment platform to the moment the web service receives the callback with the payment result. A payment is automatically assigned the decline status if it wasn't processed within the threshold time. For individual customisation of the threshold time limit, contact ecommpay technical support.

Processing scenarios

To perform a purchase operation, you need to redirect a customer to the Paypal service, 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 initiate a payout, you need to notify the customer via the web service.

The customer scenario of a one-step purchase via Payment Page looks like this.

General scenarios of processing purchases and payouts can be presented as follows.

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

General information

To process a purchase through Payment Page by using the Paypal 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. The full sequence and special aspects of purchase processing are provided below.

Figure 11. Purchase processing by using Payment Page: step-by-step description
  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 Paypal method.
  8. The payment platform receives the request for processing the payment by using the Paypal method.
  9. The payment platform processes the request and sends it to the Paypal service.
  10. The request is processed on the Paypal service side.
  11. The data for redirecting the customer to the Paypal service is sent from the Paypal service to the payment platform.
  12. The data for redirecting the customer is sent from the payment platform to Payment Page.
  13. The customer is redirected to the Paypal service.
  14. The customer completes all required payment steps.
  15. The purchase is processed on the in the Paypal service.
  16. The customer is redirected to Payment Page.
  17. The Paypal service sends a notification about the result to the payment platform.
  18. The payment platform sends the payment result callback to the web service.
  19. The payment platform sends the result information to Payment Page.
  20. The result information is displayed to the customer on Payment Page.

Information about the formats of requests and callbacks used for processing payments by using the Paypal method via Payment Page is presented further in this section; general information about working with the Payment Page API is presented in Interaction concepts.

Request format

There are several things you need to consider when sending purchase requests by using the Paypal 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. The following parameters required for any payment must be specified: project_id, payment_id, payment_currency, payment_amount, customer_id.
  3. Depending on the merchant business type, to improve payment acceptance rate, it may be relevant to specify the following parameters (partially or completely; information on parameters recommended in specific cases can be clarified with the ecommpay account manager):
    • customer_email—customer email address;
    • customer_first_name—customer first name;
    • customer_last_name—customer last name;
    • customer_country—customer country code in ISO 3166-1 alpha-2 format;
    • customer_phone—customer phone number;
    • payment_methods_options—a string object the name of which is the paypal_wallet method indicator and the value of which is the additional_data object containing additional customer information:
      • sender_create_date—customer account creation time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00);
      • payments_count—number of payments made by the merchant's web service for the customer during the previous three months before the payment was initiated;
      • pin_verification—determines whether the customer's identity for this payment is confirmed using a PIN code (if yes—Y must be specified in the value, if no—N);
      • face_id_verification—determines whether the customer's identity for this payment is confirmed using a facial recognition system (if yes—Y must be specified in the value, if no—N);
      • additional_verification—a combination of four indicators that mark the fulfillment of a number of conditions for confirming information on the web service side in a given sequence. The numbers 0 or 1 should be used as such indicators (0—not confirmed, 1—confirmed). These conditions include:
        1. Phone number confirmation
        2. Identifying photo confirmation
        3. Payment card confirmation
        4. Bank account confirmation

        Example: 1101.

      • ota_type—OTA (online travel agency) type (for example Car rental)
      • ota_service_start_date—OTA service start time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00)
      • ota_service_end_date—OTA service end time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00)
      • ota_change_guest_t_f—indicates whether the customer is able to be changed (if yes—1, if no—0)
      • ota_start_country—code of the country where the services start to be provided to the customer
      • ota_start_city—name of the city where the services start to be provided to the customer
      • ota_start_zipcode—full zip code of the place where the services start to be provided to the customer
  4. If you need to have the payment form displayed with the Paypal method selected, set the force_payment_method parameter to paypal-wallet.
  5. Additionally, any other parameters available for working with Payment Page can be used (details).
  6. After all target parameters are specified, generate a signature (details).

Thus, a correct request for opening the payment form using the Paypal method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer identifier, signature, as well as possible additional parameters.

{
   "project_id": 120,
   "payment_id": "580",
   "payment_amount": 100000,
   "payment_currency": "USD",
   "customer_id": "customer1",
   "payment_methods_options": {"paypal_wallet":{"additional_data":{"sender_create_date": "2022-01-25T10:15:30+00:00", "payments_count": 123, "pin_verification": "Y", "face_id_verification": "N","additional_verification": "1101", "ota_type": "Car rental", "ota_service_start_date": "2022-01-26T10:15:30+00:00", "ota_service_end_date": "2022-02-25T10:15:30+00:00", "ota_change_guest_t_f": 0, "ota_start_country": "US", "ota_start_city": "Dallas", "ota_start_zipcode": "12345"}}}
   "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg=="
}
Figure 12. Example of sufficient data in a purchase request
{
   "project_id": 120,
   "payment_id": "580",
   "payment_amount": 100000,
   "payment_currency": "USD",
   "customer_id": "customer1",
   "payment_methods_options": {"paypal_wallet":{"additional_data":{"sender_create_date": "2022-01-25T10:15:30+00:00", "payments_count": 123, "pin_verification": "Y", "face_id_verification": "N","additional_verification": "1101", "ota_type": "Car rental", "ota_service_start_date": "2022-01-26T10:15:30+00:00", "ota_service_end_date": "2022-02-25T10:15:30+00:00", "ota_change_guest_t_f": 0, "ota_start_country": "US", "ota_start_city": "Dallas", "ota_start_zipcode": "12345"}}}
   "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg=="
}

Callback format

The Paypal method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with an information about a 10.00 USD purchase in the 210 project.

Figure 13. Example of callback data indicating that the purchase has been processed
{
        "project_id": 210,
        "payment": {
            "id": "test_payment_1",
            "type": "purchase",
            "status": "success",
            "date": "2019-12-25T09:48:29+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 1000,
                "currency": "USD"
            },
            "description": ""
        },
        "account": {
            "number": "VSAFYPWDD123"
        },
        "customer": {
            "id": "7895623"
        },
        "operation": {
            "id": 63460000012251,
            "type": "sale",
            "status": "success",
            "date": "2019-12-25T09:48:29+0000",
            "created_date": "2019-12-25T09:47:54+0000",
            "request_id": "55aa73dcab3dd0a37f3a4eeb72f7-00063461",
            "sum_initial": {
                "amount": 1000,
                "currency": "USD"
            },
            "sum_converted": {
                "amount": 1000,
                "currency": "USD"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 1556,
                "payment_id": "14C27062M77937123",
                "auth_code": "",
                "date": "2019-12-25T09:48:27+0000"
            }
        },
        "signature": "bLraFo85nfQ+kMyaximHVkuL3THI1oHRkukafnk3A=="
    }

The following is the example of a callback with information about a declined purchase.

Figure 14. Example of callback data indicating that the purchase has been declined
{
        "project_id": 210,
        "payment": {
            "id": "test_payment_2",
            "type": "purchase",
            "status": "decline",
            "date": "2019-12-18T09:00:07+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 900,
                "currency": "USD"
            },
            "description": "test_paypal"
        },
        "customer": {
            "id": "156787"
        },
        "operation": {
            "id": 55628000009581,
            "type": "sale",
            "status": "decline",
            "date": "2019-12-18T09:00:07+0000",
            "created_date": "2019-12-18T08:59:30+0000",
            "request_id": "b8d98d70def1760df9f52dc00ffb6-00055629",
            "sum_initial": {
                "amount": 900,
                "currency": "USD"
            },
            "sum_converted": {
                "amount": 900,
                "currency": "USD"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 1556,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "OEDB1Gox..TOaeB+W8q64WLUnsj6gsW5qen7MrDC2o3Rg=="
    }

Useful links

The following articles can be useful when implementing purchases via Payment Page:

COF purchases by using Payment Page

General information

The Paypal payment method provides the ability to perform COF purchases—regular on-demand payments. For more information about COF purchases, see On-demand COF purchase.

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. For more information, see COF purchases by using Gate.

Information about the formats of requests and callbacks used for processing payments by using the Paypal method via Payment Page is presented further in this section; general information about working with the Payment Page API is presented in Interaction concepts.

Request format

There are several things you need to consider when creating requests to open a payment form for registering COF purchases by using the Paypal 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. The following parameters required for any payment must be specified: project_id, payment_id, payment_currency, payment_amount, customer_id.
  3. If you need to have the payment form displayed with the Paypal method selected, set the force_payment_method parameter to paypal-wallet.
  4. For specifying the properties of a COF purchase, the request should contain the recurring parameter as a JSON object—if the payment form is opened via the JavaScript library of ecommpay—or as a string generated as a result of URL encoding—if the payment form is opened via another method. The recurring parameter must contain the main details about COF purchase registration:
    • register, boolean—parameter which indicates whether the payment should be registered as recurring and which should be assigned the true value.
    • type, string—COF purchase type which should be assigned one of the following values:
      • U—autopurchase
      • R—regular purchase
    • period, string—frequency of debits (for a regular purchase), this parameter should be assigned one of the following values:
      • D—daily
      • W—weekly
      • M—monthly (if the set day is not available in the next month, for example, 31, the payment is performed on the last day of the month)
      • Q—quarterly
      • Y—annually
    • time, string—time of performing subsequent debits (for a regular purchase) in hh:mm:ss format. The parameter is used if the period parameter is specified in the request.
    • interval, integer—interval of performing regular purchases. This parameter should be assigned a numeric value from 1 to 100 (for example, each three weeks) and is necessarily used in conjunction with the period parameter.
  5. For specifying the properties of a regular purchase, the recurring parameter can also contain other details:
    • amount, integer—fixed amount of subsequent debits in the smallest currency unit
    • expiry_day, integer or string—COF purchase expiry day
    • expiry_month, integer or string—COF purchase expiry month
    • expiry_year, integer—COF purchase expiry year
    • start_date, string—date on which the first debit is performed in the dd-mm-yyyy format (the parameter is necessarily used in conjunction with the scheduled_payment_id parameter)
    • scheduled_payment_id, string—identifier 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; (also, not to be confused with the debiting series record identifier specified in the id parameter of the recurring object that is specified in the callback with the COF purchase registration information)
      Warning: If the identifier that should be assigned to the COF purchase (scheduled_payment_id) matches the identifier of the payment made to register a COF purchase (payment_id), the request to register a COF purchase is declined.
  6. Depending on the merchant business type, to improve payment acceptance rate, it may be relevant to specify the following parameters (partially or completely; information on parameters recommended in specific cases can be clarified with the ecommpay account manager):
    • customer_email—customer email address;
    • customer_first_name—customer first name;
    • customer_last_name—customer last name;
    • customer_country—customer country code in ISO 3166-1 alpha-2 format;
    • customer_phone—customer phone number;
    • payment_methods_options—a string object the name of which is the paypal_wallet method indicator and the value of which is the additional_data object containing additional customer information:
      • sender_create_date—customer account creation time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00);
      • payments_count—number of payments made by the merchant's web service for the customer during the previous three months before the payment was initiated;
      • pin_verification—determines whether the customer's identity for this payment is confirmed using a PIN code (if yes—Y must be specified in the value, if no—N);
      • face_id_verification—determines whether the customer's identity for this payment is confirmed using a facial recognition system (if yes—Y must be specified in the value, if no—N);
      • additional_verification—a combination of four indicators that mark the fulfillment of a number of conditions for confirming information on the web service side in a given sequence. The numbers 0 or 1 should be used as such indicators (0—not confirmed, 1—confirmed). These conditions include:
        1. Phone number confirmation
        2. Identifying photo confirmation
        3. Payment card confirmation
        4. Bank account confirmation

        Example: 1101.

      • ota_type—OTA (online travel agency) type (for example Car rental)
      • ota_service_start_date—OTA service start time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00)
      • ota_service_end_date—OTA service end time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00)
      • ota_change_guest_t_f—indicates whether the customer is able to be changed (if yes—1, if no—0)
      • ota_start_country—code of the country where the services start to be provided to the customer
      • ota_start_city—name of the city where the services start to be provided to the customer
      • ota_start_zipcode—full zip code of the place where the services start to be provided to the customer
  7. Additionally, any other parameters available for working with Payment Page can be used (details).
  8. After all target parameters are specified, generate a signature (details).

Thus, a correct request for opening the payment form using the Paypal method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer identifier, the registration parameter and the conditions for regular payments, as well as signature.

{
   "project_id": 120,
   "payment_id": "580",
   "payment_amount": 100000,
   "payment_currency": "USD",
   "customer_id": "customer1",
   "force_payment_method": "paypal-wallet",
   "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"},
   "payment_methods_options": {"paypal_wallet":{"additional_data":{"sender_create_date": "2022-01-25T10:15:30+00:00", "payments_count": 123, "pin_verification": "Y", "face_id_verification": "N","additional_verification": "1101", "ota_type": "Car rental", "ota_service_start_date": "2022-01-26T10:15:30+00:00", "ota_service_end_date": "2022-02-25T10:15:30+00:00", "ota_change_guest_t_f": 0, "ota_start_country": "US", "ota_start_city": "Dallas", "ota_start_zipcode": "12345"}}}
   "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg=="
}
Figure 15. Example of sufficient data in a COF purchase registration request
{
   "project_id": 120,
   "payment_id": "580",
   "payment_amount": 100000,
   "payment_currency": "USD",
   "customer_id": "customer1",
   "force_payment_method": "paypal-wallet",
   "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"},
   "payment_methods_options": {"paypal_wallet":{"additional_data":{"sender_create_date": "2022-01-25T10:15:30+00:00", "payments_count": 123, "pin_verification": "Y", "face_id_verification": "N","additional_verification": "1101", "ota_type": "Car rental", "ota_service_start_date": "2022-01-26T10:15:30+00:00", "ota_service_end_date": "2022-02-25T10:15:30+00:00", "ota_change_guest_t_f": 0, "ota_start_country": "US", "ota_start_city": "Dallas", "ota_start_zipcode": "12345"}}}
   "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg=="
}

Callback format

The Paypal method uses the standard format for callbacks to deliver COF purchase registration results. For more information, see Callbacks.

The following is the example of a callback with an information about a processed COF purchase.

Figure 16. Example of callback data indicating that the COF purchase has been processed
{
    "project_id": 1037,
    "payment": {
        "id": "ORDER_ID_123",
        "type": "recurring",
        "status": "success",
        "date": "2024-04-05T16:49:20+0000",
        "method": "PayPal Wallet",
        "sum": {
            "amount": 1500,
            "currency": "USD"
        },
        "description": "Book order"
    },
    "account": {
        "number": "1234******abc"
    },
    "customer": {
        "id": "123"
    },
    "provider_extra_fields": {
        "holder": "John Doe",
        "email": "****************"
    },
    "recurring": {
        "id": 11607,
        "currency": "USD"
    },
    "operation": {
        "id": 3486000011257,
        "type": "recurring",
        "status": "success",
        "date": "2024-04-05T16:49:20+0000",
        "created_date": "2024-04-05T16:48:20+0000",
        "request_id": "5562e4dfe5dc45dfe142b2cbe-00003487",
        "sum_initial": {
            "amount": 1500,
            "currency": "USD"
        },
        "sum_converted": {
            "amount": 1500,
            "currency": "USD"
        },
        "code": "0",
        "message": "Success",
        "provider": {
            "id": 1782,
            "payment_id": "0DL958510G965733C",
            "auth_code": "",
            "date": "2024-04-05T16:49:01+0000"
        }
    },
    "signature": "pMFA9Onino0suaGv+kJxuEhHhHJ8MtHfg7Weg=="
}

Useful links

The following articles can be useful when implementing purchases via Payment Page:

One-time purchases by using Gate

General information

Overview

Payments via Gate by using the Paypal method can be processed in two ways: directly through the Gate API, and also by using the Paypal SDK and Gate API. On the web service side, the differences between the processing ways concern sending requests and redirecting customers, the choice of a specific way remains with the merchant.

Setup of payment processing by using the Paypal SDK and Gate API

Before processing payments via the Paypal SDK and Gate API by using the Paypal method, the merchant's web service is required to do the following:

  1. Set up the Paypal SDK in accordance with the official documentation (https://developer.paypal.com/sdk/js/)
  2. Set up the display of the button for selecting this payment method on the web service side, also in accordance with the official documentation (https://developer.paypal.com/docs/checkout/standard/customize/standalone-buttons/, https://developer.paypal.com/demo/checkout/#/pattern/server)
  3. Reference the Paypal JavaScript library on the client side of the web service using the following link.
    <script src="https://www.paypal.com/sdk/js?client-id=<CLIENT_ID>&merchant-id=<MERCHANT_ID>&currency=USD"></script>

    This link uses the variables <CLIENT_ID>—the identifier of the payment platform in the Paypal service, which is determined after granting ecommpay the rights to make payments on behalf of the merchant, and <MERCHANT_ID>—the identifier of the merchant in the Paypal service.

Payment processing by using the Paypal SDK and Gate API

After setting up to process payments through the Paypal SDK and Gate API by using the Paypal method, to process each payment the merchant's web service is required to do the following:

  1. Send a request with all the required parameters and signature to the ecommpay URL.
  2. Receive an intermediate callback from the payment platform and redirect the customer to the Paypal service.
  3. Receive the final callback from the payment platform.

The full sequence and special aspects of purchase processing are provided below.



Figure 17. Purchase processing by using the SDK
  1. A customer initiates a purchase by using the Paypal method in the web service.
  2. The web service sends the data for generating the purchase request to the Paypal SDK.
  3. The Paypal SDK sends the request for processing the purchase by using Gate to the specified ecommpay URL.
  4. The payment platform receives the request.
  5. The payment platform validates the required parameters and signature in the request.
  6. The payment platform sends the response to the web service with information about the receipt of the request and its validity (details).
  7. The payment platform performs further processing of the request (with parameter consistency check) and sends it to the Paypal service.
  8. The request is processed on the Paypal service side.
  9. The Paypal service sends the redirection data to the payment platform.
  10. The payment platform sends the callback with the redirection data to the web service.
  11. The web service sends the redirection data to the Paypal SDK.
  12. The customer is redirected to the Paypal service by the Paypal SDK.
  13. The customer completes all required payment steps.
  14. The purchase is processed on the side of the Paypal service.
  15. The Paypal service sends the payment result notification to the payment platform.
  16. The payment platform sends the payment result callback to the web service.
  17. The customer receives the payment result information from the web service.

Information about the formats of requests and callbacks used for processing payments by using the Paypal method via the Paypal SDK and Gate API is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.

Payment processing by using the Gate API directly

To process payments through Gate directly by using the Paypal method, the merchant's web service is required to do the following:

  1. Send a request with all the required parameters and signature to the ecommpay URL.
  2. Receive an intermediate callback from the payment platform and redirect the customer to the Paypal service.
  3. Receive the final callback from the payment platform.

The full sequence and special aspects of purchase processing are provided below.



Figure 18. Purchase processing by using the API directly: step-by-step description
  1. A customer initiates a purchase by using the Paypal 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 payment platform sends the response to the web service with information about the receipt of the request and its validity (details).
  6. The payment platform performs further processing of the request (with parameter consistency check) and sends it to the Paypal service.
  7. The request is processed on the Paypal service side.
  8. The Paypal service sends the redirection data to the payment platform.
  9. The payment platform sends the callback with the redirection data to the web service.
  10. The customer is redirected to the Paypal service.
  11. The customer completes all required payment steps.
  12. The purchase is processed on the side of the Paypal service.
  13. The customer is redirected to the web service.
  14. The Paypal service sends the payment result notification to the payment platform.
  15. The payment platform sends the payment result callback to the web service.
  16. The customer receives the payment result information from the web service.

Information about the formats of requests and callbacks used for processing payments by using the Paypal method via Gate directly is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.

Format of requests for processing of one-step purchases

Parameters to be specified

There are several things you need to consider when sending purchase requests by using the Paypal method:

  1. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
    • Object payment—payment information:
      • amount—payment amount in the smallest currency unit
      • currency—payment currency code in the ISO-4217 alpha-3 format
    • Object customer—customer information:
      • id—customer identifier unique within the project
      • ip_address—customer IP address relevant for the initiated payment
    • Object return_url—URLs to which customer is redirected while or after payment processing:
      • success—URL to redirect the customer to the web service after the customer completes all the required actions on the Paypal service side
      • decline—URL to redirect the customer to the web service after the customer doesn't complete all the required actions on the Paypal service side
  2. Additional parameters can be required depending on the merchant business type (refer to your ecommpay key account manager for more information):
    • Object customer—customer information:
      • email—customer email address;
      • first_name—customer first name;
      • last_name—customer last name;
      • country—customer country code in ISO 3166-1 alpha-2 format;
      • phone—customer phone number;
    • Object additional_data—additional customer information in the merchant service:
      • sender_create_date—customer account creation time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00);
      • payments_count—number of payments made by the merchant's web service for the customer during the previous three months before the payment was initiated;
      • pin_verification—determines whether the customer's identity for this payment is confirmed using a PIN code (if yes—Y must be specified in the value, if no—N);
      • face_id_verification—determines whether the customer's identity for this payment is confirmed using a facial recognition system (if yes—Y must be specified in the value, if no—N);
      • additional_verification—a combination of four indicators that mark the fulfillment of a number of conditions for confirming information on the web service side in a given sequence. The numbers 0 or 1 should be used as such indicators (0—not confirmed, 1—confirmed). These conditions include:
        1. Phone number confirmation
        2. Identifying photo confirmation
        3. Payment card confirmation
        4. Bank account confirmation

        Example: 1101.

      • ota_type—OTA (online travel agency) type (for example Car rental)
      • ota_service_start_date—OTA service start time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00)
      • ota_service_end_date—OTA service end time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00)
      • ota_change_guest_t_f—indicates whether the customer is able to be changed (if yes—1, if no—0)
      • ota_start_country—code of the country where the services start to be provided to the customer
      • ota_start_city—name of the city where the services start to be provided to the customer
      • ota_start_zipcode—full zip code of the place where the services start to be provided to the customer
  3. Additionally, any other parameters included in the specification can be used.

Thus, a correct one-step payment request in the Paypal method must include project and payment IDs, the signature, currency and amount of the purchase, customer IP address, URLs for redirection and additional information (if required).

{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JNIipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 1000,
    "currency": "USD"
  },
  "customer": {
    "ip_address": "192.0.2.0",
    "id": "123"
  },
  "additional_data": {
    "sender_create_date": "2022-01-25T10:15:30+00:00",
    "payments_count": 123,
    "pin_verification": "Y",
    "face_id_verification": "N",
    "additional_verification": "1101",
    "ota_type": "Car rental",
    "ota_service_start_date": "2022-01-26T10:15:30+00:00",
    "ota_service_end_date": "2022-02-25T10:15:30+00:00",
    "ota_change_guest_t_f": 0,
    "ota_start_country": "US",
    "ota_start_city": "Dallas",
    "ota_start_zipcode": "12345"
  },
  "return_url": {
    "success": "http://example.com/success",
    "decline": "http://example.com/decline"
  }
}
Figure 19. Example of sufficient data in a one-step purchase request
{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JNIipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 1000,
    "currency": "USD"
  },
  "customer": {
    "ip_address": "192.0.2.0",
    "id": "123"
  },
  "additional_data": {
    "sender_create_date": "2022-01-25T10:15:30+00:00",
    "payments_count": 123,
    "pin_verification": "Y",
    "face_id_verification": "N",
    "additional_verification": "1101",
    "ota_type": "Car rental",
    "ota_service_start_date": "2022-01-26T10:15:30+00:00",
    "ota_service_end_date": "2022-02-25T10:15:30+00:00",
    "ota_change_guest_t_f": 0,
    "ota_start_country": "US",
    "ota_start_city": "Dallas",
    "ota_start_zipcode": "12345"
  },
  "return_url": {
    "success": "http://example.com/success",
    "decline": "http://example.com/decline"
  }
}

Sending requests by using the Paypal SDK and Gate API

When sending requests by using the Paypal SDK and Gate API it is necessary that these requests correspond to the format supported by the Paypal SDK. To initiate each purchase send a separate POST request to the /v2/payment/wallet/paypal/sale endpoint.

As an example, the implementation of the request sending function may look like the following.

 const test = {
      createOrder: function (data) {
        return fetch('https://api.ecommpay.com/v2/payment/wallet/paypal/sale', {
          method: 'POST',
          body: JSON.stringify(data),
          });
      },
    };
    test.createOrder({ project_id: 123, payment_amount: '10000', ... })

Sending requests by using the Gate API directly

To initiate each purchase, send a separate POST request to the /v2/payment/wallet/paypal/sale endpoint. This endpoint belongs to the group /v2/payment/wallet/{payment_method}/sale.

Format of requests for authorization hold

Parameters to be specified

There are several things you need to consider when sending authorization hold requests by using the Paypal method:

  1. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
    • Object payment—payment information:
      • amount—payment amount in the smallest currency unit
      • currency—payment currency code in the ISO-4217 alpha-3 format
    • Object customer—customer information:
      • id—customer identifier unique within the project
      • ip_address—customer IP address relevant for the initiated payment
    • Object return_url—the URLs to which customer is redirected while or after payment processing:
      • return—URL for redirecting a customer during any step of the purchase.
  2. Additional parameters can be required depending on the merchant business type (refer to your ecommpay key account manager for more information):
    • Object customer—customer information:
      • email—customer email address;
      • first_name—customer first name;
      • last_name—customer last name;
      • country—customer country code in ISO 3166-1 alpha-2 format;
      • phone—customer phone number;
    • Object additional_data—additional customer information in the merchant service:
      • sender_create_date—customer account creation time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00);
      • payments_count—number of payments made by the merchant's web service for the customer during the previous three months before the payment was initiated;
      • pin_verification—determines whether the customer's identity for this payment is confirmed using a PIN code (if yes—Y must be specified in the value, if no—N);
      • face_id_verification—determines whether the customer's identity for this payment is confirmed using a facial recognition system (if yes—Y must be specified in the value, if no—N);
      • additional_verification—a combination of four indicators that mark the fulfillment of a number of conditions for confirming information on the web service side in a given sequence. The numbers 0 or 1 should be used as such indicators (0—not confirmed, 1—confirmed). These conditions include:
        1. Phone number confirmation
        2. Identifying photo confirmation
        3. Payment card confirmation
        4. Bank account confirmation

        Example: 1101.

      • ota_type—OTA (online travel agency) type (for example Car rental)
      • ota_service_start_date—OTA service start time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00)
      • ota_service_end_date—OTA service end time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00)
      • ota_change_guest_t_f—indicates whether the customer is able to be changed (if yes—1, if no—0)
      • ota_start_country—code of the country where the services start to be provided to the customer
      • ota_start_city—name of the city where the services start to be provided to the customer
      • ota_start_zipcode—full zip code of the place where the services start to be provided to the customer
  3. Additionally, any other parameters included in the specification can be used.

A correct authorization hold request in the Paypal method must include project and payment IDs, the signature, currency and amount of the purchase, customer IP address, URL for redirection and additional information (if required).

{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JIipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 1000,
    "currency": "USD"
  },
  "customer": {
    "ip_address": "192.0.2.0",
    "id": "customer123",
    "email": "test@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "3572437356",
    "country": "GB"
  },   
  "additional_data": {
    "sender_create_date": "2022-01-25T10:15:30+00:00",
    "payments_count": 123,
    "pin_verification": "Y",
    "face_id_verification": "N",
    "additional_verification": "1101",
    "ota_type": "Car rental",
    "ota_service_start_date": "2022-01-26T10:15:30+00:00",
    "ota_service_end_date": "2022-02-25T10:15:30+00:00",
    "ota_change_guest_t_f": 0,
    "ota_start_country": "US",
    "ota_start_city": "Dallas",
    "ota_start_zipcode": "12345"
  },
  "return_url": {
    "return": "http://example.com/return"
  }
}
Figure 20. Example of sufficient data in a authotization hold request
{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JIipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 1000,
    "currency": "USD"
  },
  "customer": {
    "ip_address": "192.0.2.0",
    "id": "customer123",
    "email": "test@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "3572437356",
    "country": "GB"
  },   
  "additional_data": {
    "sender_create_date": "2022-01-25T10:15:30+00:00",
    "payments_count": 123,
    "pin_verification": "Y",
    "face_id_verification": "N",
    "additional_verification": "1101",
    "ota_type": "Car rental",
    "ota_service_start_date": "2022-01-26T10:15:30+00:00",
    "ota_service_end_date": "2022-02-25T10:15:30+00:00",
    "ota_change_guest_t_f": 0,
    "ota_start_country": "US",
    "ota_start_city": "Dallas",
    "ota_start_zipcode": "12345"
  },
  "return_url": {
    "return": "http://example.com/return"
  }
}

Sending requests by using the Paypal SDK and Gate API

When sending requests by using the Paypal SDK and Gate API it is necessary that these requests correspond to the format supported by the Paypal SDK. To initiate each purchase send a separate POST request to the /v2/payment/wallet/paypal/auth endpoint.

As an example, the implementation of the request sending function may look like the following.

 const test = {
      createOrder: function (data) {
        return fetch('https://api.ecommpay.com/v2/payment/wallet/paypal/auth, {
          method: 'POST',
          body: JSON.stringify(data),
          });
      },
    };
    test.createOrder({ project_id: 123, payment_amount: '10000', ... })

Sending requests by using the Gate API directly

To initiate each purchase, send a separate POST request to the /v2/payment/wallet/paypal/auth endpoint. This endpoint belongs to the group /v2/payment/wallet/{payment_method}/auth.

Format of requests for debiting of authorized amount

There are several things you must consider when sending debiting requests by using the Paypal method:

  1. To initiate each debiting of funds, send a separate POST request to the /v2/payment/wallet/paypal/capture endpoint (belongs to the group /v2/payment/wallet/{payment_method}/capture).
  2. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
  3. Additionally, any other parameters included in the specification can be used.

Thus, a correct debiting request by using the Paypal method must include project and payment IDs, as well as signature.

{
  "general": {
    "project_id": 580,
    "payment_id": "TEST_15427033321774",
    "signature": "96c+hWk1zweuGKwDRrl+Se5mDLXHChlDZrjJXZw7ew6ow3RpGYv4U...=="
  }
Figure 21. Example of sufficient data in a debiting request
{
  "general": {
    "project_id": 580,
    "payment_id": "TEST_15427033321774",
    "signature": "96c+hWk1zweuGKwDRrl+Se5mDLXHChlDZrjJXZw7ew6ow3RpGYv4U...=="
  }

Format of requests for release of authorized amount

There are several things you must consider when sending release requests by using the Paypal method:

  1. To initiate each release, send a separate POST request to the /v2/payment/wallet/paypal/cancel endpoint (belongs to the group /v2/payment/wallet/{payment_method}/cancel).
  2. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
  3. Additionally, any other parameters included in the specification can be used.

Thus, a correct release request by using the Paypal method must include project and payment IDs, and signature.

{
  "general": {
    "project_id": 580,
    "payment_id": "TEST_15427033321774",
    "signature": "96c+hWk1zweuGKwDRrl+Se5mDLXHChlDZrjJXZw7ew6ow3RpGY=="
  }
Figure 22. Example of sufficient data in a release request
{
  "general": {
    "project_id": 580,
    "payment_id": "TEST_15427033321774",
    "signature": "96c+hWk1zweuGKwDRrl+Se5mDLXHChlDZrjJXZw7ew6ow3RpGY=="
  }

Formats of intermediate callbacks for customer redirection

Data format when using the Paypal SDK and Gate API

Each payment made with the Paypal method requires redirection of customers from the merchant's web service to the Paypal service. To redirect a customer it is necessary to receive an intermediate callback from the payment platform and use the order identifier on the Paypal service side (orderID) in accordance with the official documentation. This identifier is specified in the payment_id parameter of the provider object included in the operation object. The format of intermediate callbacks is standard (details).

Figure 23. examples of the operation object and the payment_id parameter
"operation": {
            "sum_initial": {
                "amount": 50000,
                "currency": "USD"
            },
            "sum_converted": {
                "amount": 50000,
                "currency": "USD"
            },
            "code": "9999",
            "message": "Awaiting processing",
            "provider": {
                "id": 1556,
                "payment_id": "14C27062M77937123",
                "auth_code": ""
            }

Data format when using the Gate API directly

Each payment made with the Paypal method requires redirection of customers from the merchant's web service to the Paypal service. To redirect a customer it is necessary to receive an intermediate callback from the payment platform and use the information included in the redirect_data object. The format of such callbacks is standard (details), and the following objects and parameters are included in the redirect_data object:

  • body—object with data to be sent in the request body
  • method—parameter specifying the HTTP method for sending the request (GET or POST)
  • url—parameter containing a link for redirection
Figure 24. redirect_data example
  "redirect_data": {
    "body": {},
    "method": "GET",
    "url": "https://www.example.com/pay"
  }

Callback format

The Paypal method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with an information about a 10.00 USD one-step purchase in the 210 project.

Figure 25. Example of callback data indicating that the purchase has been processed
{
        "project_id": 210,
        "payment": {
            "id": "test_payment_1",
            "type": "purchase",
            "status": "success",
            "date": "2019-12-25T09:48:29+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 1000,
                "currency": "USD"
            },
            "description": ""
        },
        "account": {
            "number": "ABCDEFG123456"
        },
        "provider_extra_fields": {
            "holder": "John Doe",
            "email": "customer@example.com"
        },
        "customer": {
            "id": "7895623"
        },
        "operation": {
            "id": 63460000012251,
            "type": "sale",
            "status": "success",
            "date": "2019-12-25T09:48:29+0000",
            "created_date": "2019-12-25T09:47:54+0000",
            "request_id": "55aa73dcab36da37f3a4eeb72f7-00063461",
            "sum_initial": {
                "amount": 1000,
                "currency": "USD"
            },
            "sum_converted": {
                "amount": 1000,
                "currency": "USD"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 1556,
                "payment_id": "14C27062M77937123",
                "auth_code": "",
                "date": "2019-12-25T09:48:27+0000"
            }
        },
        "signature": "bLraFo85nUfpfn...VhVkMyximHVkuL3THI1oHRkukafnk3A=="
    }

The following is the example of a callback with information about a declined purchase.

Figure 26. Example of callback data indicating that the purchase has been declined
{
        "project_id": 210,
        "payment": {
            "id": "test_payment_2",
            "type": "purchase",
            "status": "decline",
            "date": "2019-12-18T09:00:07+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 900,
                "currency": "USD"
            },
            "description": "test_paypal"
        },
        "customer": {
            "id": "156787"
        },
        "operation": {
            "id": 55628000009581,
            "type": "sale",
            "status": "decline",
            "date": "2019-12-18T09:00:07+0000",
            "created_date": "2019-12-18T08:59:30+0000",
            "request_id": "b8d98d70def1762f52dc00ffb6-00055629",
            "sum_initial": {
                "amount": 900,
                "currency": "USD"
            },
            "sum_converted": {
                "amount": 900,
                "currency": "USD"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 1556,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "OEDB1GoxL9wsMnrP2S...TOaeW5qen7MrDC2o3Rg=="
    }

The following is an example of a callback with the information about the 100,00 USD authorisation hold in the 1037 project.

Figure 27. Example of callback data indicating that the authorisation hold has been placed
{
        "project_id": 1037,
        "payment": {
            "id": "62153051",
            "type": "purchase",
            "status": "awaiting capture",
            "date": "2021-12-15T13:04:15+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 10000,
                "currency": "USD"
            },
            "description": "Test sale"
        },
        "account": {
            "number": "ABCDEFG123456"
        },
        "customer": {
            "id": "123"
        },
        "provider_extra_fields": {
            "holder": "John Doe",
            "email": "customer@example.com"
        },
        "operation": {
            "id": 62,
            "type": "auth",
            "status": "success",
            "date": "2021-12-15T13:04:15+0000",
            "created_date": "2021-12-15T13:03:24+0000",
            "request_id": "363dedea310b7e3e35-00000001",
            "sum_initial": {
                "amount": 10000,
                "currency": "USD"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "USD"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 1782,
                "payment_id": "33007291SS518890B",
                "auth_code": "",
                "date": "2021-12-15T13:04:12+0000"
            }
        },
        "signature": "AAB6/UB0MJY+O/h11NfFIsO6WXRzCSnJDPXYg=="
    }

The following is the example of a callback for a declined authorisation hold request.

Figure 28. Example of callback data indicating that the authorisation hold request has been declined
{
        "project_id": 1037,
        "payment": {
            "id": "87764079",
            "type": "purchase",
            "status": "decline",
            "date": "2021-12-15T13:21:51+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 10000,
                "currency": "EUR"
            },
            "description": "Test sale"
        },
        "customer": {
            "id": "123"
        },
        "operation": {
            "id": 67,
            "type": "auth",
            "status": "decline",
            "date": "2021-12-15T13:21:51+0000",
            "created_date": "2021-12-15T13:21:39+0000",
            "request_id": "982fc18ec86c925d88-00000001",
            "sum_initial": {
                "amount": 10000,
                "currency": "EUR"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "EUR"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 1782,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "zZBZHvDTIKG1+SdwLGW642i03JQL238wkmhcLcg=="
    }

The following is the example of a callback with the information about the debiting of 100,00 EUR in the 1037 project.

Figure 29. Example of callback data indicating that the customer funds have been debited
{
        "project_id": 1037,
        "payment": {
            "id": "62153051",
            "type": "purchase",
            "status": "success",
            "date": "2021-12-15T13:05:00+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 10000,
                "currency": "EUR"
            },
            "description": "Test sale"
        },
        "account": {
            "number": "ABCDEFG123456"
        },
        "customer": {
            "id": "1234"
        },
        "operation": {
            "id": 63,
            "type": "capture",
            "status": "success",
            "date": "2021-12-15T13:05:00+0000",
            "created_date": "2021-12-15T13:04:50+0000",
            "request_id": "ea2e5888a65cf1b1f2b5-00000001",
            "sum_initial": {
                "amount": 10000,
                "currency": "EUR"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "EUR"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 1782,
                "payment_id": "7C035795EJ562523A",
                "auth_code": "",
                "date": "2021-12-15T13:04:57+0000"
            }
        },
        "signature": "uU6LOpEjEqxeqJ2GsDkDnaY+1p1m4aS5zTPkJA=="
    }

The following is the example of a callback with the information about a declined debiting of funds.

Figure 30. Example of callback data indicating that the request for debiting of customer funds has been declined
{
        "project_id": 1037,
        "payment": {
            "id": "59375393",
            "type": "purchase",
            "status": "awaiting capture",
            "date": "2021-12-15T14:29:38+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 100000,
                "currency": "EUR"
            },
            "description": "Test sale"
        },
        "account": {
            "number": "ABCDEFG123456"
        },
        "customer": {
            "id": "1234"
        },
        "operation": {
            "id": 84,
            "type": "capture",
            "status": "decline",
            "date": "2021-12-15T14:29:38+0000",
            "created_date": "2021-12-15T14:29:31+0000",
            "request_id": "776d5d3e602912e88858c922e34e5-00000001",
            "sum_initial": {
                "amount": 100000,
                "currency": "EUR"
            },
            "sum_converted": {
                "amount": 100000,
                "currency": "USD"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 1782,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "qjVnKRZX51lrxh5kqCzurbJbQQSAeFwqH7H9gk7gUYI3A=="
    }

The following is the example of a callback with the information about the cancelling of the 140,00 EUR authorisation hold in the 1037 project.

Figure 31. Example of callback data indicating that the authorisation hold has been canceled
{
        "project_id": 1037,
        "payment": {
            "id": "34121156",
            "type": "purchase",
            "status": "canceled",
            "date": "2021-12-15T13:13:43+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 10400,
                "currency": "EUR"
            },
            "description": "Test sale"
        },
        "account": {
            "number": "ABCDEFG123456"
        },
        "customer": {
            "id": "54356"
        },
        "operation": {
            "id": 65,
            "type": "cancel",
            "status": "success",
            "date": "2021-12-15T13:13:43+0000",
            "created_date": "2021-12-15T13:13:31+0000",
            "request_id": "93a233b6e894b9c75b04376500459-00000001",
            "sum_initial": {
                "amount": 10400,
                "currency": "EUR"
            },
            "sum_converted": {
                "amount": 10400,
                "currency": "EUR"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 1782,
                "payment_id": "83M31576986944942",
                "auth_code": "",
                "date": "2021-12-15T13:13:39+0000"
            }
        },
        "signature": "sxsHVGlOb0edv7HDMoW0KUB+PIrMns8/94pr17g=="
    }

The following is the example of a callback for declined cancelling of an authorisation hold.

Figure 32. Example of callback data indicating that the request for cancelling of an authorisation has been declined
{
        "project_id": 1037,
        "payment": {
            "id": "24594739",
            "type": "purchase",
            "status": "awaiting capture",
            "date": "2021-12-15T14:18:06+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 100000,
                "currency": "EUR"
            },
            "description": "Test sale"
        },
        "account": {
            "number": "ABCDEFG123456"
        },
        "customer": {
            "id": "134"
        },
        "operation": {
            "id": 81,
            "type": "cancel",
            "status": "decline",
            "date": "2021-12-15T14:18:06+0000",
            "created_date": "2021-12-15T14:17:58+0000",
            "request_id": "c5aa36c9134a1c629a23121add6-00000001",
            "sum_initial": {
                "amount": 100000,
                "currency": "EUR"
            },
            "sum_converted": {
                "amount": 100000,
                "currency": "EUR"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 1782,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "PZBiCA2ZFxnLw2SxfL+WnePV1m1zFY0Ys8vbz1g=="
    }

COF purchases by using Gate

General information

The Paypal payment method provides the ability to perform COF purchases—regular on-demand payments. For more information about COF purchases, see On-demand COF purchase and COF purchase with automatic debiting.

Information about the formats of requests and callbacks used for processing payments by using the Paypal method via Gate is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.

COF purchase registration

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.

Format of requests for registration of COF purchases when processing of one-time one-step purchases

There are several things you need to consider when sending requests for registering COF purchases via processing of one-time one-step purchases:

  1. To register each COF purchase, send a separate POST request to the /v2/payment/wallet/paypal/sale endpoint, which belongs to the group /v2/payment/wallet/{payment_method}/sale.
  2. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
    • Object payment—payment information:
      • amount—payment amount in the smallest currency unit
      • currency—payment currency code in the ISO-4217 alpha-3 format
    • Object customer—customer information:
      • id—customer identifier unique within the project
      • ip_address—customer IP address relevant for the initiated payment
    • Object return_url—URLs to which customer is redirected while or after payment processing:
      • success—URL to redirect the customer to the web service after the customer completes all the required actions on the Paypal service side
      • decline—URL to redirect the customer to the web service after the customer doesn't complete all the required actions on the Paypal service side
    • Object recurring—COF purchase information:
      • register—payment registration as a COF purchase
      • type—type of the COF purchase: R (for Regular payment) or U (for Autopayment), for more information, refer to Overview
      • scheduled_payment_id—identifier of the next COF purchase
      • 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. Additional parameters can be required depending on the merchant business type (refer to your ecommpay key account manager for more information):
    • Object customer—customer information:
      • email—customer email address;
      • first_name—customer first name;
      • last_name—customer last name;
      • country—customer country code in ISO 3166-1 alpha-2 format;
      • phone—customer phone number;
    • Object additional_data—additional customer information in the merchant service:
      • sender_create_date—customer account creation time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00);
      • payments_count—number of payments made by the merchant's web service for the customer during the previous three months before the payment was initiated;
      • pin_verification—determines whether the customer's identity for this payment is confirmed using a PIN code (if yes—Y must be specified in the value, if no—N);
      • face_id_verification—determines whether the customer's identity for this payment is confirmed using a facial recognition system (if yes—Y must be specified in the value, if no—N);
      • additional_verification—a combination of four indicators that mark the fulfillment of a number of conditions for confirming information on the web service side in a given sequence. The numbers 0 or 1 should be used as such indicators (0—not confirmed, 1—confirmed). These conditions include:
        1. Phone number confirmation
        2. Identifying photo confirmation
        3. Payment card confirmation
        4. Bank account confirmation

        Example: 1101.

      • ota_type—OTA (online travel agency) type (for example Car rental)
      • ota_service_start_date—OTA service start time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00)
      • ota_service_end_date—OTA service end time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00)
      • ota_change_guest_t_f—indicates whether the customer is able to be changed (if yes—1, if no—0)
      • ota_start_country—code of the country where the services start to be provided to the customer
      • ota_start_city—name of the city where the services start to be provided to the customer
      • ota_start_zipcode—full zip code of the place where the services start to be provided to the customer
  4. Additionally, any other parameters included in the specification can be used.

Thus, a correct COF purchase registration request by using the Paypal method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer information, URLs for redirection, the registration parameter and the conditions for regular payments, as well as signature.

 {
  "general": {
    "project_id": 208,
    "payment_id": "TEST_15427007172789",
    "signature": "DH0v2pZnkK9hwytQSkzd0Iq6lM2...==",
  },
  "customer": {
    "id": "123",
    "ip_address": "192.0.2.0"
  },
  "payment": {
    "amount": 1000,
    "currency": "USD",
    "email": "test@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "3572437356",
    "country": "US"
  },   
  "additional_data": {
    "sender_create_date": "2022-01-25T10:15:30+00:00",
    "payments_count": 123,
    "pin_verification": "Y",
    "face_id_verification": "N",
    "additional_verification": "1101",
    "ota_type": "Car rental",
    "ota_service_start_date": "2022-01-26T10:15:30+00:00",
    "ota_service_end_date": "2022-02-25T10:15:30+00:00",
    "ota_change_guest_t_f": 0,
    "ota_start_country": "US",
    "ota_start_city": "Dallas",
    "ota_start_zipcode": "12345"
  },
  "return_url": {
    "success": "http://example.com/success",
    "decline": "http://example.com/decline"
  },
  "recurring": {
    "register": true,
    "type": "R",
    "amount": 1000,
    "interval": 1,
    "cycle": "week",
    "start_date": "21-11-2018"
  }
}
Figure 33. Example of sufficient data in a COF purchase registration request
 {
  "general": {
    "project_id": 208,
    "payment_id": "TEST_15427007172789",
    "signature": "DH0v2pZnkK9hwytQSkzd0Iq6lM2...==",
  },
  "customer": {
    "id": "123",
    "ip_address": "192.0.2.0"
  },
  "payment": {
    "amount": 1000,
    "currency": "USD",
    "email": "test@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "3572437356",
    "country": "US"
  },   
  "additional_data": {
    "sender_create_date": "2022-01-25T10:15:30+00:00",
    "payments_count": 123,
    "pin_verification": "Y",
    "face_id_verification": "N",
    "additional_verification": "1101",
    "ota_type": "Car rental",
    "ota_service_start_date": "2022-01-26T10:15:30+00:00",
    "ota_service_end_date": "2022-02-25T10:15:30+00:00",
    "ota_change_guest_t_f": 0,
    "ota_start_country": "US",
    "ota_start_city": "Dallas",
    "ota_start_zipcode": "12345"
  },
  "return_url": {
    "success": "http://example.com/success",
    "decline": "http://example.com/decline"
  },
  "recurring": {
    "register": true,
    "type": "R",
    "amount": 1000,
    "interval": 1,
    "cycle": "week",
    "start_date": "21-11-2018"
  }
}

Format of requests for registration of COF purchases when processing of one-time two-step purchases

There are several things you need to consider when sending requests for registering COF purchases via processing of one-time two-step purchases:

  1. To register each COF purchase, send a separate POST request to the /v2/payment/wallet/paypal/auth endpoint, which belongs to the group /v2/payment/wallet/{payment_method}/auth.
  2. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
    • Object payment—payment information:
      • amount—payment amount in the smallest currency unit
      • currency—payment currency code in the ISO-4217 alpha-3 format
    • Object customer—customer information:
      • id—customer identifier unique within the project
      • ip_address—customer IP address relevant for the initiated payment
    • Object return_url—the URLs to which customer is redirected while or after payment processing:
      • return—URL for redirecting a customer during any step of the purchase.
    • Object recurring—COF purchase information:
      • register—payment registration as a COF purchase
      • type—type of the COF purchase: R (for Regular payment) or U (for Autopayment), for more information, refer to Overview
      • scheduled_payment_id—identifier of the next COF purchase
      • 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. Depending on the merchant business type, to improve payment acceptance rate, it may be relevant to specify the following parameters (partially or completely; information on parameters recommended in specific cases can be clarified with the ecommpay account manager):
    • Object customer—customer information:
      • email—customer email address;
      • first_name—customer first name;
      • last_name—customer last name;
      • country—customer country code in ISO 3166-1 alpha-2 format;
      • phone—customer phone number;
    • Object additional_data—additional customer information in the merchant service:
      • sender_create_date—customer account creation time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00);
      • payments_count—number of payments made by the merchant's web service for the customer during the previous three months before the payment was initiated;
      • pin_verification—determines whether the customer's identity for this payment is confirmed using a PIN code (if yes—Y must be specified in the value, if no—N);
      • face_id_verification—determines whether the customer's identity for this payment is confirmed using a facial recognition system (if yes—Y must be specified in the value, if no—N);
      • additional_verification—a combination of four indicators that mark the fulfillment of a number of conditions for confirming information on the web service side in a given sequence. The numbers 0 or 1 should be used as such indicators (0—not confirmed, 1—confirmed). These conditions include:
        1. Phone number confirmation
        2. Identifying photo confirmation
        3. Payment card confirmation
        4. Bank account confirmation

        Example: 1101.

      • ota_type—OTA (online travel agency) type (for example Car rental)
      • ota_service_start_date—OTA service start time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00)
      • ota_service_end_date—OTA service end time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00)
      • ota_change_guest_t_f—indicates whether the customer is able to be changed (if yes—1, if no—0)
      • ota_start_country—code of the country where the services start to be provided to the customer
      • ota_start_city—name of the city where the services start to be provided to the customer
      • ota_start_zipcode—full zip code of the place where the services start to be provided to the customer
  4. Additionally, any other parameters included in the specification can be used.

Thus, a correct COF purchase registration request by using the Paypal method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer information, URL for redirection, the registration parameter and the conditions for regular payments, as well as signature.

 {
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JIipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 1000,
    "currency": "USD"
  },
  "customer": {
    "ip_address": "192.0.2.0",
    "id": "customer123",
    "email": "test@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "3572437356",
    "country": "US"
  },   
  "additional_data": {
    "sender_create_date": "2022-01-25T10:15:30+00:00",
    "payments_count": 123,
    "pin_verification": "Y",
    "face_id_verification": "N",
    "additional_verification": "1101",
    "ota_type": "Car rental",
    "ota_service_start_date": "2022-01-26T10:15:30+00:00",
    "ota_service_end_date": "2022-02-25T10:15:30+00:00",
    "ota_change_guest_t_f": 0,
    "ota_start_country": "US",
    "ota_start_city": "Dallas",
    "ota_start_zipcode": "12345"
  },
  "return_url": {
    "return": "http://example.com/return"
  },
  "recurring": {
    "register": true,
    "type": "R",
    "amount": 1000,
    "interval": 1,
    "cycle": "week",
    "start_date": "21-11-2018"
  }
}
Figure 34. Example of sufficient data in a COF purchase registration request
 {
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JIipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 1000,
    "currency": "USD"
  },
  "customer": {
    "ip_address": "192.0.2.0",
    "id": "customer123",
    "email": "test@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "3572437356",
    "country": "US"
  },   
  "additional_data": {
    "sender_create_date": "2022-01-25T10:15:30+00:00",
    "payments_count": 123,
    "pin_verification": "Y",
    "face_id_verification": "N",
    "additional_verification": "1101",
    "ota_type": "Car rental",
    "ota_service_start_date": "2022-01-26T10:15:30+00:00",
    "ota_service_end_date": "2022-02-25T10:15:30+00:00",
    "ota_change_guest_t_f": 0,
    "ota_start_country": "US",
    "ota_start_city": "Dallas",
    "ota_start_zipcode": "12345"
  },
  "return_url": {
    "return": "http://example.com/return"
  },
  "recurring": {
    "register": true,
    "type": "R",
    "amount": 1000,
    "interval": 1,
    "cycle": "week",
    "start_date": "21-11-2018"
  }
}

Format of requests for COF purchase processing

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 Paypal method:

  1. To process each purchase, send a separate POST request to the /v2/payment/wallet/paypal/recurring endpoint, which belongs to the group /v2/payment/wallet/{payment_method}/recurring.
  2. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
    • Object payment—payment information:
      • amount—payment amount in the smallest currency unit
      • currency—payment currency code in the ISO-4217 alpha-3 format
    • Object customer—customer information:
      • ip_address—customer IP address relevant for the initiated payment
    • Object recurring—COF purchase information:
      • id—registered COF purchase identifier
  3. Depending on the merchant business type, to improve payment acceptance rate, it may be relevant to specify the following parameters (partially or completely; information on parameters recommended in specific cases can be clarified with the ecommpay account manager):
    • Object customer—customer information:
      • email—customer email address;
      • first_name—customer first name;
      • last_name—customer last name;
      • country—customer country code in ISO 3166-1 alpha-2 format;
      • phone—customer phone number;
    • Object additional_data—additional customer information in the merchant service:
      • sender_create_date—customer account creation time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00);
      • payments_count—number of payments made by the merchant's web service for the customer during the previous three months before the payment was initiated;
      • pin_verification—determines whether the customer's identity for this payment is confirmed using a PIN code (if yes—Y must be specified in the value, if no—N);
      • face_id_verification—determines whether the customer's identity for this payment is confirmed using a facial recognition system (if yes—Y must be specified in the value, if no—N);
      • additional_verification—a combination of four indicators that mark the fulfillment of a number of conditions for confirming information on the web service side in a given sequence. The numbers 0 or 1 should be used as such indicators (0—not confirmed, 1—confirmed). These conditions include:
        1. Phone number confirmation
        2. Identifying photo confirmation
        3. Payment card confirmation
        4. Bank account confirmation

        Example: 1101.

      • ota_type—OTA (online travel agency) type (for example Car rental)
      • ota_service_start_date—OTA service start time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00)
      • ota_service_end_date—OTA service end time (UTC+0) in ISO 8601 format (for example 2022-01-25T10:15:30+00:00)
      • ota_change_guest_t_f—indicates whether the customer is able to be changed (if yes—1, if no—0)
      • ota_start_country—code of the country where the services start to be provided to the customer
      • ota_start_city—name of the city where the services start to be provided to the customer
      • ota_start_zipcode—full zip code of the place where the services start to be provided to the customer
  4. Additionally, any other parameters included in the specification can be used.

Thus, a correct purchase request by using the Paypal method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer IP address, COF purchase identifier, as well as signature.

 {
  "general": {
    "project_id": 208,
    "payment_id": "TEST_15427007172789",
    "signature": "DH0v2pZnkK9hwytQ6wx/OqrWdbltzO5GMSkzd0Iq6lM2...==",
  },
  "customer": {
    "ip_address": "192.0.2.0"
  },
  "payment": {
    "amount": 1000,
    "currency": "USD",
    "email": "test@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "3572437356",
    "country": "US"
  },   
  "additional_data": {
    "sender_create_date": "2022-01-25T10:15:30+00:00",
    "payments_count": 123,
    "pin_verification": "Y",
    "face_id_verification": "N",
    "additional_verification": "1101",
    "ota_type": "Car rental",
    "ota_service_start_date": "2022-01-26T10:15:30+00:00",
    "ota_service_end_date": "2022-02-25T10:15:30+00:00",
    "ota_change_guest_t_f": 0,
    "ota_start_country": "US",
    "ota_start_city": "Dallas",
    "ota_start_zipcode": "12345"
  },
  "recurring": {
    "id": 1234567890
  }
}
Figure 35. Example of sufficient data in a COF purchase processing request
 {
  "general": {
    "project_id": 208,
    "payment_id": "TEST_15427007172789",
    "signature": "DH0v2pZnkK9hwytQ6wx/OqrWdbltzO5GMSkzd0Iq6lM2...==",
  },
  "customer": {
    "ip_address": "192.0.2.0"
  },
  "payment": {
    "amount": 1000,
    "currency": "USD",
    "email": "test@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "3572437356",
    "country": "US"
  },   
  "additional_data": {
    "sender_create_date": "2022-01-25T10:15:30+00:00",
    "payments_count": 123,
    "pin_verification": "Y",
    "face_id_verification": "N",
    "additional_verification": "1101",
    "ota_type": "Car rental",
    "ota_service_start_date": "2022-01-26T10:15:30+00:00",
    "ota_service_end_date": "2022-02-25T10:15:30+00:00",
    "ota_change_guest_t_f": 0,
    "ota_start_country": "US",
    "ota_start_city": "Dallas",
    "ota_start_zipcode": "12345"
  },
  "recurring": {
    "id": 1234567890
  }
}

Format of request for cancellation of COF purchases

Until the expiration date of a COF purchase, you can cancel it. There are several things you must consider when cancelling COF purchases by using the Paypal method:

  1. To cancel each purchase, send a separate POST request to the /v2/payment/wallet/paypal/recurring/cancel endpoint, which belongs to the group /v2/payment/wallet/{payment_method}/recurring/cancel.
  2. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
    • 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 Paypal method must contain the project, payment and COF purchase identifiers, as well as signature.

 {
  "general": {
    "project_id": 208,
    "payment_id": "TEST_15427007172789",
    "signature": "DH0v2pZnkK9hwytQ6/ZtDzO5GMSkzd0Iq6lM2v8...==",
  },
  "recurring": {
    "id": 1234567890
  }
}
Figure 36. Example of sufficient data in a COF purchase cancellation request
 {
  "general": {
    "project_id": 208,
    "payment_id": "TEST_15427007172789",
    "signature": "DH0v2pZnkK9hwytQ6/ZtDzO5GMSkzd0Iq6lM2v8...==",
  },
  "recurring": {
    "id": 1234567890
  }
}

Callback format

The standard format for callbacks is used to deliver the results of actions with COF purchases. For more information, see Callbacks.

The following is the example of a callback with an information about a processed COF purchase.

Figure 37. Example of callback data indicating that the COF purchase has been processed
{
    "project_id": 1037,
    "payment": {
        "id": "ORDER_ID_123",
        "type": "recurring",
        "status": "success",
        "date": "2024-04-05T16:49:20+0000",
        "method": "PayPal Wallet",
        "sum": {
            "amount": 1500,
            "currency": "USD"
        },
        "description": "Book order"
    },
    "account": {
        "number": "1234******abc"
    },
    "customer": {
        "id": "123"
    },
    "provider_extra_fields": {
        "holder": "John Doe",
        "email": "****************"
    },
    "recurring": {
        "id": 11607,
        "currency": "USD"
    },
    "operation": {
        "id": 3486000011257,
        "type": "recurring",
        "status": "success",
        "date": "2024-04-05T16:49:20+0000",
        "created_date": "2024-04-05T16:48:20+0000",
        "request_id": "5562e4dfe5dc45dfe142b2cbe-00003487",
        "sum_initial": {
            "amount": 1500,
            "currency": "USD"
        },
        "sum_converted": {
            "amount": 1500,
            "currency": "USD"
        },
        "code": "0",
        "message": "Success",
        "provider": {
            "id": 1782,
            "payment_id": "0DL958510G965733C",
            "auth_code": "",
            "date": "2024-04-05T16:49:01+0000"
        }
    },
    "signature": "pMFA9Onino0suaGv+kJxuEhHhHJ8MtHfg7Weg=="
}

The following is the example of a callback with an information about a cancelled COF purchase.

Figure 38. Example of callback data indicating that the COF purchase has been cancelled
{
        "project_id": 1037,
        "payment": {
            "id": "ORDER_ID_123",
            "type": "purchase",
            "status": "success",
            "date": "2024-04-02T10:41:15+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 1500,
                "currency": "USD"
            },
            "description": "Book order"
        },
        "account": {
            "number": "12345abc"
        },
        "customer": {
            "id": "123"
        },
        "operation": {
            "id": 1181000011193,
            "type": "recurring_cancel",
            "status": "success",
            "date": "2024-04-02T10:41:21+0000",
            "created_date": "2024-04-02T10:41:19+0000",
            "request_id": "63edae9a19b9e85b42681e-00001182",
            "sum_initial": {
                "amount": 0,
                "currency": ""
            },
            "sum_converted": {
                "amount": 0,
                "currency": ""
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 1782,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "6ti6P9U8uATRmEgh7u/5vFPAfK1qGWMRw=="
    }

Useful links

The following articles can be useful when implementing purchases via Gate:

Refunds by using Gate

General information

To perform a refund through Gate by using the Paypal 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.

Figure 39. Refund performing by using Gate: step-by-step description
  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).
  6. The payment platform performs further processing of the request (with parameter consistency check) and sends it to the Paypal service.
  7. The refund is processed on the side of the Paypal service.
  8. The Paypal 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 Paypal method via Gate is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.

Request format

There are several things you need to consider when sending refund requests by using the Paypal method:

  1. To initiate each refund, send a separate POST request to the /v2/payment/wallet/paypal/refund endpoint, which belongs to the group /v2/payment/wallet/{payment_method}/refund.
  2. Each request must include the following objects and parameters:
    • Object general—general refund information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_ididentifier of the payment that needs to be refundedpayment identifier
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification)
    • 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 code in the ISO-4217 alpha-3 format (required for a partial refund)
  3. Additionally, any other parameters included in the specification can be used.

Thus, a correct refund request by using the Paypal method must contain the project and payment identifiers, description of the refund, signature, and, if necessary, currency code and refund amount.

{
    "general": {
        "project_id": 210,
        "payment_id": "test_refund_1",
        "signature": "U5LCm6489ly9cXCKIVBNqLks8ZJMR6iNdlUtm1EdHHdA3D19Qg=="
    },
    "payment": {
        "amount": 1000,
        "currency": "USD",
        "description": "Test PayPal refund"
    }
}
Figure 40. Example of sufficient data in a refund request
{
    "general": {
        "project_id": 210,
        "payment_id": "test_refund_1",
        "signature": "U5LCm6489ly9cXCKIVBNqLks8ZJMR6iNdlUtm1EdHHdA3D19Qg=="
    },
    "payment": {
        "amount": 1000,
        "currency": "USD",
        "description": "Test PayPal refund"
    }
}

Callback format

The Paypal method uses the standard format for callbacks to deliver refund results. For more information, see Callbacks.

The following is the example of a callback with an information about a 10.00 USD refund for the customer account 2626324568 in the 239 project.

Figure 41. Example of callback data indicating that the refund has been processed
{
        "customer": {
            "id": "7895623"
        },
        "account": {
            "number": "VSAFYPWDD35123"
        },
        "project_id": 210,
        "payment": {
            "id": "test_refund_1",
            "type": "purchase",
            "status": "refunded",
            "date": "2019-12-25T09:52:32+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 0,
                "currency": "USD"
            },
            "description": ""
        },
        "operation": {
            "id": 63460000005982,
            "type": "refund",
            "status": "success",
            "date": "2019-12-25T09:52:33+0000",
            "created_date": "2019-12-25T09:52:08+0000",
            "request_id": "ce8a135fe3ca7a7002d80ad948284c-00063461",
            "sum_initial": {
                "amount": 1000,
                "currency": "USD"
            },
            "sum_converted": {
                "amount": 1000,
                "currency": "USD"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 1556,
                "payment_id": "8YC17810N19968319",
                "auth_code": "",
                "date": "2019-12-25T09:52:11+0000"
            }
        },
        "signature": "TPqAIy7FUpor...QxJ2MTxuNofnt4or7LdABIrH6JGMGw=="
    }

The following is the example of a callback with information about a declined refund.

Figure 42. Example of callback data indicating that the refund has been declined
{
        "customer": {
            "id": "7895623"
        },
        "account": {
            "number": "VSAFYPWDD35123"
        },
        "project_id": 210,
        "payment": {
            "id": "test_refund_2",
            "type": "purchase",
            "status": "success",
            "date": "2019-12-25T09:52:32+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 1000,
                "currency": "USD"
            },
            "description": ""
        },
        "operation": {
            "id": 63460000005982,
            "type": "refund",
            "status": "decline",
            "date": "2019-12-25T09:52:33+0000",
            "created_date": "2019-12-25T09:52:08+0000",
            "request_id": "ce8a135fe3c28ad280ad948284c-00063461",
            "sum_initial": {
                "amount": 1000,
                "currency": "USD"
            },
            "sum_converted": {
                "amount": 1000,
                "currency": "USD"
            },
            "code": "20100",
            "message": "Decline",
            "provider": {
                "id": 1556,
                "payment_id": "8YC17810N19968319",
                "auth_code": "",
                "date": "2019-12-25T09:52:11+0000"
            }
        },
        "signature": "TPqAIy7sn5Hp...jGFi2MTdxuNofnt4or7LdABIrH6JGMGw=="
    }

Useful links

The following articles can be useful when implementing refunds via Gate:

Payouts by using Gate

General information

To process a payout through Gate by using the Paypal 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.

Figure 43. Payout processing by using Gate: step-by-step description
  1. A customer initiates a payout by using the Paypal 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).
  6. The payment platform performs further processing of the request (with parameter consistency check) and sends it to the Paypal service.
  7. The payout is processed on the side of the Paypal service.
  8. The Paypal 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 Paypal method via Gate is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.

Request format

There are several things you need to consider when sending payout requests by using the Paypal method:

  1. To initiate each payout send a separate POST request to the /v2/payment/wallet/paypal/payout endpoint. This is an e-wallet payments request group /v2/payment/wallet/{payment_method}/payout.
  2. Each request must include the following objects and parameters:
    • Object general—general payout information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) details
    • Object payment—payment information:
      • amount—payout amount in the smallest currency unit
      • currency—payout currency code in the ISO-4217 alpha-3 format
    • Object customer—customer information:
      • id—customer identifier unique within the project
      • ip_address—customer IP address relevant for the initiated payout
    • Object account—customer e-wallet information:
      • number—wallet identifier or the email address to which the e-wallet is registered. The choice of the parameter value depends on the type of business of the merchant. For more information contact your ecommpay key account manager.
  3. Additionally, any other parameters included in the specification can be used.

Thus, a correct payout request by using the Paypal method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer identifier and IP address, as well as account number and signature.

{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 1000,
    "currency": "USD"
  },
  "customer": {
    "id": "customer123",
    "ip_address": "192.0.2.0"
  },
  "account": {
    "number": "DHEV3UAE54T6G"
  }
}
Figure 44. Example of sufficient data in a purchase request
{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 1000,
    "currency": "USD"
  },
  "customer": {
    "id": "customer123",
    "ip_address": "192.0.2.0"
  },
  "account": {
    "number": "DHEV3UAE54T6G"
  }
}

Callback format

The Paypal method uses the standard format for callbacks to deliver payout results. For more information, see Callbacks.

The following is the example of a callback with an information about a 10.00 GBP payout made to the DHEV3UAE54T3G e-wallet made by the 120005 customer in the 112 project.

Figure 45. Example of callback data indicating that the payout has been processed
{
        "customer": {
            "id": "120005"
        },
        "account": {
            "number": "DHEV3UAE54T3G"
        },
        "project_id": 112,
        "payment": {
            "id": "test_paypal_payout",
            "type": "payout",
            "status": "success",
            "date": "2020-01-27T12:50:35+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 1000,
                "currency": "GBP"
            },
            "description": "test_payout"
        },
        "operation": {
            "id": 56417000021431,
            "type": "payout",
            "status": "success",
            "date": "2020-01-27T12:50:35+0000",
            "created_date": "2020-01-27T12:50:11+0000",
            "request_id": "67892324221179817adfdcad60e968f-00056418",
            "sum_initial": {
                "amount": 1000,
                "currency": "GBP"
            },
            "sum_converted": {
                "amount": 1000,
                "currency": "GBP"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 1556,
                "payment_id": "2334",
                "auth_code": "",
                "date": "2020-01-27T12:50:17+0000"
            }
        },
        "signature": "BmR11YQo8fszf3kMMO66zXDCOpVLXd/y/v0mXN8Huy9V3gA=="
    }

The following is the example of a callback with information about a declined payout.

Figure 46. Example of callback data indicating that the payout has been declined
{
        "customer": {
            "id": "120005"
        },
        "account": {
            "number": "DHEV3UAE54T3G"
        },
        "project_id": 112,
        "payment": {
            "id": "test_paypal_payout2",
            "type": "payout",
            "status": "decline",
            "date": "2020-01-27T12:51:35+0000",
            "method": "PayPal Wallet",
            "sum": {
                "amount": 1000,
                "currency": "GBP"
            },
            "description": "test_payout2"
        },
        "operation": {
            "id": 56417000021432,
            "type": "payout",
            "status": "decline",
            "date": "2020-01-27T12:51:35+0000",
            "created_date": "2020-01-27T12:51:11+0000",
            "request_id": "67892324221179c7adfdcad60e968f-00056423",
            "sum_initial": {
                "amount": 1000,
                "currency": "GBP"
            },
            "sum_converted": {
                "amount": 1000,
                "currency": "GBP"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 1556,
                "payment_id": "2335",
                "auth_code": "",
                "date": "2020-01-27T12:51:17+0000"
            }
        },
        "signature": "BmR11YQo8fszfS3kMMO66zXDCOpVLXd/y/v0mXeqewqgV3gA=="
    }

Useful links

The following articles can be useful when implementing payouts via Gate:

Payouts by using Dashboard

When working with Dashboard, you can process single and mass payouts by using the Paypal method.

  • To process a single payout, open the payout form, specify all required parameters (including the payment method), send a request and verify that the payout has been processed.
  • To process a mass payout, 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 section. The payout parameters must comply with the requirements (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.

Analysis of payments results

To analyse information about payments made with the Paypal method and other methods, you can use:

  • Dashboard interface toolkit with 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 available by using the Data API interface.

If you have any questions, refer to the documentation (Dashboard and Using Data API) and ecommpay technical support.