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 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, RUB, 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 |
|
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:
- Inform the ecommpay key account manager about the readiness to enable the Paypal payment method.
- Receive the email with the link to Paypal website from ecommpay.
- 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.
- 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.
- 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 |
- For more information refer to your ecommpay key account manager.
- 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.
Figure: Purchase by using Payment Page
Figure: Purchase by using Gate
Figure: Refund by using Gate
Figure: Payout by using Gate
Scenarios for performing operations via the main interfaces of the payment platform correspond to those presented in the diagrams. Similarly, when additional features (such as payment links) are used, scenarios for performing operations also correspond to the specifics of those features.
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: Purchase processing by using Payment Page: step-by-step description
- A customer initiates a purchase in the web service.
- The web service sends the request for opening Payment Page to the specified ecommpay URL.
- The request for opening Payment Page is sent to the payment platform.
- The payment platform receives the request and validates the required parameters and signature.
- Payment Page is generated based on the project and request parameters.
- Payment Page is displayed to the customer.
- The customer selects the Paypal method.
- The payment platform receives the request for processing the payment by using the Paypal method.
- The payment platform processes the request and sends it to the Paypal service.
- The request is processed on the Paypal service side.
- The data for redirecting the customer to the Paypal service is sent from the Paypal service to the payment platform.
- The data for redirecting the customer is sent from the payment platform to Payment Page.
- The customer is redirected to the Paypal service.
- The customer completes all required payment steps.
- The purchase is processed on the in the Paypal service.
- The customer is redirected to Payment Page.
- The Paypal service sends a notification about the result to the payment platform.
- The payment platform sends the payment result callback to the web service.
- The payment platform sends the result information to Payment Page.
- 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:
- The following parameters required for any payment must be specified:
project_id
—project identifier obtained from ecommpay during integrationpayment_id
—payment identifier unique within the projectpayment_currency
—payment currency code in the ISO-4217 alpha-3 formatpayment_amount
—payment amount in the smallest currency unitcustomer_id
—customer identifier unique within the project
- The following parameters required for any payment must be specified:
project_id
,payment_id
,payment_currency
,payment_amount
,customer_id
. - If you need to have the payment form displayed with the Paypal method selected, set the
force_payment_method
parameter topaypal-wallet
. - Additionally, any other parameters available for working with Payment Page can be used (details).
- 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 and signature.
{ "project_id": 120, "payment_id": "580", "payment_amount": 1000, "payment_currency": "USD", "customer_id": "customer1", "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg==" }
Figure: Example of sufficient data in a purchase request
{ "project_id": 120, "payment_id": "580", "payment_amount": 1000, "payment_currency": "USD", "customer_id": "customer1", "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: 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: 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:
- Interaction concepts—about the interaction with the payment platform by using Payment Page.
- Signature generation and verification—about the procedure of generating and verifying signatures in requests and callbacks.
- Payment models and statuses—about the types, processing models, and possible statuses of supported payments and operations.
- One-time one-step purchase—about processing of one-time one-step purchases by using Payment Page.
- Information of operations performing—about error and response codes that are used in the payment platform to record information about performing of operations.
Purchase by using Gate
General information
To process a purchase through Gate by using the Paypal method, the merchant's web service is required to do the following:
- Send a request with all the required parameters and signature to the ecommpay URL.
- Receive an intermediate callback from the payment platform and redirect the customer to the Paypal service.
- Receive the final callback from the payment platform.
The full sequence and special aspects of purchase processing are provided below.
Figure: Purchase processing by using Gate: step-by-step description
- A customer initiates a purchase by using the Paypal method in the web service.
- The web service sends the request for processing the purchase by using Gate to the specified ecommpay URL.
- The payment platform receives the request.
- The payment platform validates the required parameters and signature in the request.
- The payment platform sends the response to the web service with information about the receipt of the request and its validity (details).
- The payment platform performs further processing of the request (with parameter consistency check) and sends it to the Paypal service.
- The request is processed on the Paypal service side.
- The Paypal service sends the redirection data to the payment platform.
- The payment platform sends the callback with the redirection data to the web service.
- The customer is redirected to the Paypal service.
- The customer completes all required payment steps.
- The purchase is processed on the side of the Paypal service.
- The customer is redirected to the web service.
- The Paypal service sends the payment result notification to the payment platform.
- The payment platform sends the payment result callback to the web service.
- 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 is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.
Purchase request format
There are several things you need to consider when sending purchase requests by using the Paypal method:
- To initiate each purchase send a separate POST request to one of the following endpoints:
/v2/payment/wallet/paypal/sale
for one-step purchases (belongs to the group /v2/payment/wallet/{payment_method}/sale);/v2/payment/wallet/paypal/auth
for two-step purchases (belongs to the group /v2/payment/wallet/{payment_method}/auth);
- Each request must include the following objects and parameters:
- Object
general
—general purchase information:project_id
—project identifier obtained from ecommpay during integrationpayment_id
—payment identifier unique within the projectsignature
—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 unitcurrency
—payment currency code in the ISO-4217 alpha-3 format
- Object
customer
—customer information:id
—customer identifier unique within the projectip_address
—customer IP address relevant for the initiated payment
- Object
- 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
-
- When making a two-step purchase request it is required to specify the
return
parameter in thereturn_url
object. The parameter contains URL for redirecting a customer during any step of the purchase. - 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
—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 example2022-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 numbers0
or1
should be used as such indicators (0
—not confirmed,1
—confirmed). These conditions include:- Phone number confirmation
- Identifying photo confirmation
- Payment card confirmation
- Bank account confirmation
Example:
1101
.
- Object
- 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 and URLs for redirection.
{ "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" }, "return_url": { "success": "http://example.com/success", "decline": "http://example.com/decline" } }
Figure: 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" }, "return_url": { "success": "http://example.com/success", "decline": "http://example.com/decline" } }
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).
{ "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": "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" } }
Figure: Example of sufficient data in a two-step purchase 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": "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 intermediate callbacks for customer redirection
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 bodymethod
—parameter specifying the HTTP method for sending the request (GET
orPOST
)url
—parameter containing a link for redirection
Figure: redirect_data example
"redirect_data": { "body": {}, "method": "GET", "url": "https://www.example.com/pay" }
Request format for debiting of authorised amount
There are several things you must consider when sending debiting requests by using the Paypal method:
- 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). - Each request must include the following objects and parameters:
- Object
general
—general purchase information:project_id
—project identifier obtained from ecommpay during integrationpayment_id
—payment identifier unique within the projectsignature
—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
- Object
- 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: Example of sufficient data in 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 sending release requests by using the Paypal method:
- 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). - Each request must include the following objects and parameters:
- Object
general
—general purchase information:project_id
—project identifier obtained from ecommpay during integrationpayment_id
—payment identifier unique within the projectsignature
—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
- Object
- 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: Example of sufficient data in a release request
{ "general": { "project_id": 580, "payment_id": "TEST_15427033321774", "signature": "96c+hWk1zweuGKwDRrl+Se5mDLXHChlDZrjJXZw7ew6ow3RpGY==" }
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: 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: 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: 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: 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: 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: 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: 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: 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==" }
Useful links
The following articles can be useful when implementing purchases via Gate:
- Interaction concepts—about the interaction with the payment platform by using Gate.
- Signature generation and verification—about the procedure of generating and verifying signatures in requests and callbacks.
- Payment models and statuses—about the types, processing models, and possible statuses of supported payments and operations.
- One-time one-step purchase—about processing of one-time one-step purchases by using Payment Page.
- Information of operations performing—about error and response codes that are used in the payment platform to record information about performing of operations.
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: Refund performing by using Gate: step-by-step description
- A customer initiates a refund.
- The web service sends the request for performing the refund by using Gate to the specified ecommpay URL.
- The payment platform receives the request.
- The payment platform validates the required parameters and signature in the request.
- The payment platform sends the response to the web service with information about the receipt of the request and its validity (details).
- The payment platform performs further processing of the request (with parameter consistency check) and sends it to the Paypal service.
- The refund is processed on the side of the Paypal service.
- The Paypal service sends the result notification to the payment platform.
- The payment platform sends the result callback to the web service.
- 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:
- 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. - Each request must include the following objects and parameters:
- Object
general
—general refund information:project_id
—project identifier obtained from ecommpay during integrationpayment_id
—identifier of the payment that needs to be refundedpayment identifiersignature
—request signature generated after all required parameters are specified (details—in the Signature generation and verification)
- Object
payment
—refund information:description
—refund description or commentamount
—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)
- Object
- 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: 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: 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: 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:
- Interaction concepts—about the interaction with the payment platform by using Gate.
- Signature generation and verification—about the procedure of generating and verifying signatures in requests and callbacks.
- Payment models and statuses—about the types, processing models, and possible statuses of supported payments and operations.
- Purchase refunds—about performing of refunds by using Gate.
- Information of operations performing—about error and response codes that are used in the payment platform to record information about performing of operations.
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: Payout processing by using Gate: step-by-step description
- A customer initiates a payout by using the Paypal method in the web service.
- The web service sends the request for processing the payout by using Gate to the specified ecommpay URL.
- The payment platform receives the request.
- The payment platform validates the required parameters and signature in the request.
- The payment platform sends the response to the web service with information about the receipt of the request and its validity (details).
- The payment platform performs further processing of the request (with parameter consistency check) and sends it to the Paypal service.
- The payout is processed on the side of the Paypal service.
- The Paypal service sends the result notification to the payment platform.
- The payment platform sends the result callback to the web service.
- 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:
- 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. - Each request must include the following objects and parameters:
- Object
general
—general payout information:project_id
—project identifier obtained from ecommpay during integrationpayment_id
—payment identifier unique within the projectsignature
—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 unitcurrency
—payout currency code in the ISO-4217 alpha-3 format
- Object
customer
—customer information:id
—customer identifier unique within the projectip_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.
- Object
- 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: 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: 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: 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:
- Interaction concepts—about the interaction with the payment platform by using Gate.
- Signature generation and verification—about the procedure of generating and verifying signatures in requests and callbacks.
- Payment models and statuses—about the types, processing models, and possible statuses of supported payments and operations.
- Payouts—about processing of payouts by using Gate.
- Information of operations performing—about error and response codes that are used in the payment platform to record information about performing of operations.
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.