PayPal

Overview

Paypal is a payment method that allows customers to perform payments by using e-wallets. Purchases are perfomed by using Payment Page and Gate, refunds by using Gate and payouts by using Gate and Dashboard.

General information

Payment method type e-wallet payments
Countries and regions all countries
Payment currencies AUD, BRL (available only in Brazil), CAD, CZK, DKK, EUR, HKD, HUF, INR (available only in India), ILS, JPY, MYR (available only in Malaysia), MXN, TWD, NZD, NOK, PHP, PLN, GBP, RUB, SGD, SEK, CHF, THB, USD
Currency conversion on the ecommpay side *
Purchases +
Payouts +
Stored credentials payments
Full refunds +
Partial refunds +
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 refer to your ecommpay key account manager

* For more information refer to your ecommpay key account manager.

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 requires merchant's web service, one of ecommpay interfaces, and the ecommpay payment platform, as well as Paypal technical facilities.

Operations support

  Interfaces Amounts, USD Times **
Payment Page CMS Plug-ins Gate Dashboard 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

* For more information refer to your ecommpay key account manager.

** The basic and threshold times are defined as follows:
  • The basic 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 initiator. The basic 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 customer is required). Use the basic time to estimate when to react to the absence of payment result notifications or when to check payment status.
  • The threshold time is the maximum possible time between the moment a payment is initiated in the payment platform to the moment the initiator receives the callback with the payment result. A payment is automatically declined, if its waiting time exceeds the threshold time. For individual setting 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 initiate a refund or a payout, you need to receive a request from a customer via your web service.

Figure: Purchase by using Payment Page



Figure: Purchase by using Gate



Figure: Refund by using Gate



Figure: Payout by using Gate



The sections that follow provide detailed information about what you need to perform payments and how you can analyse the information on payments and operations.

Purchase by using Payment Page

General information

In the Paypal method, when processing a purchase by using Payment Page, the merchant web service should send a request with all the required parameters and signature to the ecommpay URL and get the callback with the payment result from the payment platform. When opening Payment Page, you can have Payment Page opened with the Paypal method selected. For more information about preselecting payment methods, see Preselecting payment methods. The full sequence and particularities of the purchase process are provided below.

Figure: Purchase by using Payment Page

  1. Customer initiates a purchase by using the web service.
  2. The merchant web service sends the request for processing the purchase by using Payment Page to the specified ecommpay URL.
  3. The payment platform receives the request for processing the purchase by using Payment Page.
  4. The payment platform performs the initial request processing that involves validation of the required parameters and signature.
  5. Requested Payment Page is generated in the ecommpay payment platform as specified in the project settings and the request parameters.
  6. Payment Page is displayed to the customer.
  7. The customer selects the Paypal method.
  8. The payment platform receives the purchase request for payment processing in the Paypal service.
  9. The payment platform performs the internal purchase request processing and sends it to the Paypal service.
  10. The purchase request is processed on the Paypal side.
  11. The Paypal service generates the data for redirecting the customer and sends it to the payment platform.
  12. The payment platform sends the customer redirection data to Payment Page.
  13. The customer is redirected to the Paypal website.
  14. The customer completes all the required payment steps.
  15. The payment is processed on the Paypal side.
  16. The customer is redirected to Payment Page.
  17. The Paypal service sends the result notification to the payment platform.
  18. The payment platform sends a callback with the payment result to the web service.
  19. The payment platform sends payment results to Payment Page.
  20. A page with the payment result information is displayed to the customer on Payment Page.

The sections that follow discuss in more details the request format and the Payment Page parameters to use in the Paypal payment method and provide the information on the format of callbacks with payment results. For the general information on how to use the API, see Payment Page API Description.

Request format

There are several things you need to consider when using the Paypal method:

  1. You must provide values for the basic minimum of parameters. Listed below are the parameters that are mandatory for any payment method:
    • project_id—the project ID obtained from ecommpay
    • payment_id—payment ID unique within the project
    • payment_currency—payment currency in ISO-4217 alpha-3 format
    • payment_amount—payment amount in minor units
    • customer_id—customer ID unique within the project
  2. If you need to have payment form displayed with the Paypal method selected, set the force_payment_method parameter to paypal-wallet.
  3. If required, you can also add any other additional parameters Payment Page supports.
  4. After you specify all the parameters you need, you must create the signature for the request. For instructions on how to sign a payment request, see Signature generation and verification.

Thus, a correct payment request in the Paypal method must include project, and payment IDs, the currency and the amount of a payment, customer ID, as well as the signature, as shown in the following example:

    { payment_id: 'ID_1547', 
      payment_amount: 1000, 
      payment_currency: 'USD', 
      project_id: 210, 
      customer_id: 'customer1',
      signature: "kUi2x9dKHAVNU0FYldJrxh4yo+52Kt8KU+Y1Y4HASCQ9vySO\
                                /RLCvhtT4DqtVUkDJrOcZzUCwX6R\/ekpZhkIQg=="
    }

For information about all parameters available in the Paypal method, see Parameters for opening payment form.

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 successful 10.00 USD purchase in the 210 project.

Figure: Example of a successful purchase callback

{
        "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": "55aa73dcab3dd00c239565d5d98d27dc766da37f3a4eeb72f7-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+ozqLbMjCbr3hdUfpfn...VhVkMyaximHVkuL3THI1oHRkukafnk3A=="
    }

The following is the example of a callback for a declined purchase.

Figure: Example of a declined purchase callback

{
        "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": "b8d98d70def1762c0b6170f5fc525996f9b0df9f52dc00ffb6-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": "OEDB1GoxL9wsMnrPmuJ1Glccx2S...TOaeB+W8q64WLUnsj6gsW5qen7MrDC2o3Rg=="
    }

Related topics

The following topics might be useful when implementing payments by using Payment Page:

Purchase by using Gate

General information

In the Paypal method, when processing a purchase by using Gate, the merchant web service is required to do the following:

  1. Send a request with all the required parameters and signature to the ecommpay URL.
  2. Perform the redirection of a customer to the Paypal service.
  3. Get the callback with the payment result from the payment platform.

The following diagram provides the detailed picture of the payment processing procedure.

Figure: Purchase by using Gate

  1. A customer initiates a purchase on the merchant's web service side by using the Paypal method.
  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 for processing the purchase from Gate.
  4. The payment platform performs the initial request processing that includes validation of the required parameters and signature.
  5. The payment platform sends the response with request receipt confirmation and correctness check result to the web service. For more information, see Response format.
  6. The payment platform performs the internal payment request processing and sends it to the Paypal service.
  7. The request is processed on the Paypal side.
  8. The Paypal generates the data for redirecting the customer to the Paypal and sends it to the payment platform.
  9. The payment platform sends the callback with the redirection data in the redirect_data object to the web service.
  10. The customer is redirected to the Paypal service.
  11. The customer completes all the required payment steps.
  12. The payment is processed on the Paypal side.
  13. The customer is redirected to the merchant's web service.
  14. The Paypal service sends the payment result notification to the payment platform.
  15. The payment platform sends a callback to the web service.
  16. The customer receives the payment result on the web service.

The sections that follow discuss in more details the request format and the Gate parameters to use in the Paypal payment method and provide the information on the format of callbacks with purchase results. For general information on how to use the API, see API Description.

Purchase request format

There are several things you must consider when using purchase requests in the Paypal method:

  1. You send HTTP POST requests to the following endpoints:
  2. The following objects and parameters must be specified in any request:
    • Object general—general purchase information:
      • project_id—the project ID obtained from ecommpay
      • payment_id—payment ID unique within the project
      • signature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification
    • Object payment—purchase information:
      • amount—purchase amount in minor units
      • currency—payment currency in the ISO-4217 alpha-3 format.
    • Object customer—customer information:
      • id—unique ID within the merchant project
      • ip_address—customer IP address
  3. When making a one-step purchase request it is required to specify the following parameters in the return_url object (which contains the 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
  4. When making a two-step purchase request it is required to specify the return parameter in the return_url object. The parameter contains URL for redirecting a customer during any step of the purchase.
  5. Also processing a two-step purchase can required additional parameters depending on the merchant business type (refer to your ecommpay key account manager for more information):
    • Object customer—customer information:
      • email—email address;
      • first_name—first name;
      • last_name—last name;
      • country—country code in ISO 3166-1 alpha-2 format;
      • phone—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.

  6. If required, you can also add any other additional parameters Gate supports.
  7. After you specify all the parameters you need, you must create the signature for the request. For instructions on how to sign a payment request, see Signature generation and verification.

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 and URLs for redirection, as shown in the following example:

Figure: Example of a one-step purchase request

{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JvC7vQsaC6tajQVVLhNN5e7cV+VHq3L
                        wY3T\/pOMeSaRfBaNIipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 1000,
    "currency": "USD"
  },
  "customer": {
    "ip_address": "1.1.1.1",
    "id": "123"
  },
  "return_url": {
    "success": "http://example.com/success",
    "decline": "http://example.com/decline"
  }
}

Thus, a correct two-step payment 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), as shown in the following example:

Figure: Example of a two-step purchase request

{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JvC7vQsaC6tajQVVLhNN5e7cV+VHq3L
                        wY3T\/pOMeSaRfBaNIipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 1000,
    "currency": "USD"
  },
  "customer": {
    "ip_address": "123.45.67.89",
    "id": "customer123",
    "email": "test@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "3572437356",
    "country": "RU"
  },   
  "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"
  },
  "return_url": {
    "return": "http://example.com/return"
  }
}

Formats of customer redirection data

To redirect a customer from the web service to the Paypal site, you must receive a callback from the payment platform containing the URL for redirection in the redirect_data.url parameter and data to be sent in the request body in the redirect_data.body parameter, and use these parameters when opening the HTML page using the method specified in the redirect_data.method parameter.

The following is the callback fragment containing the redirect data.

  "redirect_data": {
    "body": {},
    "method": "GET",
    "url": "https://www.sandbox.paypal.com/checkoutnow?token=123"
  }

Request format for debiting of authorised amount

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

  1. You send purchase requests by using HTTP method POST to the endpoint /v2/payment/wallet/paypal/capture (belongs to the request group /v2/payment/wallet/{payment_method}/capture).
  2. The following objects and parameters must be specified in any request:
    • Object general—general purchase information:
      • project_id—the project ID obtained from ecommpay
      • payment_id—payment ID unique within the project
      • signature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification
  3. If required, you can also add any other additional parameters Gate supports.

Thus, a correct payment request in the Paypal method must include project and payment IDs, as well as signature, as shown in the following example:

Figure: Example of a debiting request

{
  "general": {
    "project_id": 580,
    "payment_id": "TEST_15427033321774",
    "signature": "96c+hWk1zweuGKwDRrl+Se5mDLXHChlDZrjJXZw7ew6ow3RpGYv4U...=="
  }

Request format for release of authorised amount

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

  1. You send purchase requests by using HTTP method POST to the endpoint /v2/payment/wallet/paypal/cancel (belongs to the request group /v2/payment/wallet/{payment_method}/cancel).
  2. The following objects and parameters must be specified in any request:
    • Object general—general purchase information:
      • project_id—the project ID obtained from ecommpay
      • payment_id—payment ID unique within the project
      • signature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification
  3. If required, you can also add any other additional parameters Gate supports.

Thus, a correct payment request in the Paypal method must include project and payment IDs, and signature:

Figure: Example of a release request

{
  "general": {
    "project_id": 580,
    "payment_id": "TEST_15427033321774",
    "signature": "96c+hWk1zweuGKwDRrl+Se5mDLXHChlDZrjJXZw7ew6ow3RpGYv4U...=="
  }

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 successful 10.00 USD one-step purchase in the 210 project.

Figure: Example of a successful purchase callback

{
        "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": "55aa73dcab3dd00c239565d5d98d27dc766da37f3a4eeb72f7-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+ozqLbMjCbr3hdUfpfn...VhVkMyaximHVkuL3THI1oHRkukafnk3A=="
    }

The following is the example of a callback for a declined one-step purchase.

Figure: Example of a declined purchase callback

{
        "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": "b8d98d70def1762c0b6170f5fc525996f9b0df9f52dc00ffb6-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": "OEDB1GoxL9wsMnrPmuJ1Glccx2S...TOaeB+W8q64WLUnsj6gsW5qen7MrDC2o3Rg=="
    }

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

Figure: Callback example of a successful authorisation hold

{
        "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": "363dedea362289833e5611b639a382c310b7e3e35-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/hEEZj9NJkTAeX+Cqlzh11NfFIsO6WXRzCSnJDPXYg=="
    }

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

Figure: Callback example of a declined authorisation hold

{
        "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": "982fc18ec872b1806c5ff4033c4fd14e486c925d88-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": "zZBZHvDTIKG12yYE+HENeup+SdwLGW642i03JQL238wkmhcLcg=="
    }

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

Figure: Callback example of a successful debiting of customer funds

{
        "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": "ea2e5888a67c369b93b4668fe1d66b2ec5cf1b1f2b5-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": "uU6LOpEjEqxeqdmD5B8IDCNUauA7Jo0J2GsDkDnaY+1p1m4aS5zTPkJA=="
    }

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

Figure: Callback example of a declined debiting of customer funds

{
        "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": "776d5d3e6e2af6ce83b0e8660d4a02912e88858c922e34e5-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": "qjVnKRZX51+IPClrxh5kqCzurbJbQQSAeFwqH7H9gk7gUYI3A=="
    }

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

Figure: Callback example of a successful cancelling of an authorisation hold

{
        "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": "93a233b6e894b9c8c4325a0c53634575b04376500459-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": "sxsHVGlOb0ezdOxtdmi19cdwf4Ddv7HDMoW0KUB+PIrMns8/94pr17g=="
    }

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

Figure: Callback example of a declined cancelling of an authorisation hold

{
        "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": "c5aa36c9134a1c60703d10a98476f629a23121add6-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": "PZBiCA2ZFxnLw2S/PN4buxfL+WnePV1m1zFY0Ys8vbz1g=="
    }

Related topics

The following topics might be useful when implementing payments through Gate:

Refund by using Gate

General information

Paypal supports full and partial refunds processing. In the Paypal method, any refund follows the usual procedure which is common to Gate: merchant's web service sends a request with all the required parameters and signature to ecommpay URL, Gate accepts the request and redirects to the payment platform for further processing. The full sequence of the refund process is provided below.

Figure: Refund by using Gate

  1. A customer orders a refund by using the web service.
  2. Merchant's web service sends the request for the refund processing by using Gate to the appropriate ecommpay URL.
  3. Gate redirects the request to the ecommpay payment platform.
  4. The payment platform performs all the necessary checks and processes the request.
  5. The response with the request processing results is sent to the merchant's web service. For more information, see Response format.
  6. The payment platform redirects the refund request to the Paypal service.
  7. The payment is processed on the Paypal side.
  8. Paypal sends the result notification to the payment platform.
  9. The payment platform sends a callback with the payment result to the web service.
  10. The customer receives the information about the receipt of the requested funds from the web service

The sections that follow discuss in more details the request format and the Gate parameters to use in the Paypal payment method and provide the information on the format of callbacks with refund results.

Request format

There are several things you must consider when using refund requests in the Paypal method:
  1. You perform a refund by sending the request to /v2/payment/wallet/paypal/refund by using HTTP method POST. This is an e-wallet refunds request group: /v2/payment/wallet/{payment_method}/refund.
  2. The following objects and parameters must be specified in any request:
    • Object general—general refund information:
      • project_id—the project ID obtained from ecommpay
      • payment_id—payment ID unique within the project
      • signature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification
    • Object payment—refund information:
      • amount—refund amount in minor units (mandatory for partial refunds only)
      • currency—refund currency in ISO-4217 alpha-3 format (mandatory for partial refunds only)
      • description—comment or description of the refund
  3. If required, you can also add any other additional parameters Gate supports.

Thus, a correct refund request in the Paypal method must include project and payment IDs, the signature, currency, amount and description of the refund, as shown in the following example:

Figure: Example of a refund request

{
    "general": {
        "project_id": 210,
        "payment_id": "test_refund_1",
        "signature": "U5LCm6489ly9cXCKIVBNV0mFruH4s05cFDqLks8ZJMR6iNdlUtm1EdHHdA3D19Qg=="
    },
    "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 successful 10.00 USD refund for the customer account 2626324568 in the 239 project.

Figure: Example of a successful refund callback

{
        "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": "ce8a135fe3c28ad2c669184d4ddcfa7a7002d80ad948284c-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": "TPqAIy7FUlH3iy/mz8mmSosn5Hpor...QxJ2MTdxuNofnt4or7LdABIrH6JGMGw=="
    }

The following is the example of a callback for a declined refund.

Figure: Example of a declined refund callback

{
        "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": "ce8a135fe3c28ad2c66c90184d4ddcfa7a7002d80ad948284c-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": "TPqAIy7FUlH3iy/mz8mmSosn5Hp...jGFi2MTdxuNofnt4or7LdABIrH6JGMGw=="
    }

Related topics

The following topics might be useful when implementing payments through Gate:

Payout by using Gate

General information

To perform a payout through the Paypal method, merchant's web service sends a request with all the required parameters and signature to ecommpay URL, and receives a callback with the payment result. The full sequence of the payout process is provided below.

Figure: Payout by using Gate

  1. A customer orders a payout through the Paypal system.
  2. Merchant's web service sends the request for the payout processing by using Gate to the appropriate ecommpay URL.
  3. Gate redirects the request to the ecommpay payment platform.
  4. The payment platform performs all the necessary checks and processes the request.
  5. The reply with the request processing results is sent to the merchant's web service. For more information, see Response format.
  6. The payment platform redirects the payout request to the Paypal service.
  7. The payout is processed on the Paypal side.
  8. Paypal sends the result notification to the payment platform.
  9. The payment platform sends a callback with the payment result to the web service.
  10. The customer receives the notification about the payout result from the web service.

The sections that follow discuss in more details the request format and the Gate parameters to use in the Paypal payment method and provide the information on the format of callbacks with payout results.

Request format

There are several things you must consider when using payout requests in the Paypal method:
  1. You send payout requests by sending the /v2/payment/wallet/paypal/payout request by using the POST HTTP method. This is an e-wallet payments request group /v2/payment/wallet/{payment_method}/payout.
  2. The following objects and parameters must be specified in any request:
    • Object general—general request identification information:
      • project_id—the project ID obtained from ecommpay
      • payment_id—payment ID unique within the project
      • signature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification.
    • Object payment—payout information:
      • amount—payout amount
      • currency—payout currency in the ISO-4217 alpha-3 format.
    • Object customer—customer information:
      • id—the ID of the customer within the project
      • ip_address—customer IP address
    • 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. If required, you can also add any other additional parameters Gate supports.

Thus, a correct payment request in the Paypal method must include project and payment IDs, currency and amount of the payout and customer data, as shown in the following example:

Figure: Example of a payout request

{
    "general": {
        "project_id": 603,
        "payment_id": "test_payoutt_1",
        "signature": "U5LCm6489ly9cXCKIVBNV0mFr4XiCruECSyQEbT1hSXJ70zuH4s05cFDqLks8ZJMR6iNdlUtm1EdHHdA3D19Qg=="
    },
    "payment": {
        "amount": 3000,
        "currency": "USD",
        "description": "Test PayPal payout"
    },
    "customer": {
        "ip_address": "1.2.3.4",
        "id": "34534543545"
    },
    "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 successful 10.00 GBP payout made to the DHEV3UAE54T3G e-wallet made by the 120005 customer in the 112 project.

Figure: Example of a successful payout callback

{
        "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": "678923242211798109ef056eb0b1c7adfdcad60e968f-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": "BmR11YQo8fszfS3kMMO66zXDCOpVLXd/y/v0mXN8Huy9V3gA=="
    }

The following is the example of a callback for a declined payout.

Figure: Example of a declined payout callback

{
        "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": "678923242211798109ef056eb0b1c7adfdcad60e968f-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=="
    }

Related topics

The following topics might be useful when implementing payments through Gate:

Payout 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 create a signature because it is specified by Dashboard).

More information Information about processing payouts by using Dashboard is presented in a separate section.

Analysis of payments results

As with other payment methods ecommpay offers, when using the Paypal method, you have several options to analyse the information about payments and operations performed by using the method—alone or in conjunction with other methods.

You can load and analyse all the necessary information in Dashboard, for instance you can use the analytic panels on the Analytics tab to this end.

Also, you can export the information for further analysis by using third party analytical tools. The following options are available:

  • Dashboard allows you to download reports in CSV and XLS formats—by using the tools on the Payments tab. You can perform export as a one-time download to your local computer or have payment data regularly exported and delivered to email addresses you specify.
  • Data API allows you to have payment information exported in JSON format and delivered to a URL you specify. The payment information is exported by using the /operations/get queries.

If you have any further questions regarding payment data analysis, contact ecommpay technical support.