Paypal
Overview
Introduction
Paypal is a payment method which allows to process payments in several currencies by using the Paypal e-wallet in different countries. This method supports one-time and credential-on-file purchases, refunds and payouts.
This article provides information about working with the Paypal method: general insights are presented in the Overview section, while information about the actions required to process payments and perform other actions is presented in the sections that follow.
General information
Payment method type | digital wallet payments |
---|---|
Payment instruments | digital wallets |
Countries and regions | in accordance with the list |
Payment currencies | AUD, BRL (only in Brazil), CAD, CZK, DKK, EUR, HKD, HUF, INR (only in India), ILS, JPY, MYR (only in Malaysia), MXN, TWD, NZD, NOK, PHP, PLN, GBP, SGD, SEK, CHF, THB, USD |
Currency conversion | on the ecommpay side |
One-time purchases | + |
Credential-on-file purchases | + |
Full refunds | + |
Partial refunds | + |
Payouts | + |
Chargebacks | + |
Notes |
|
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.
The customer scenario of a one-step purchase via Payment Page looks like this.
General scenarios of processing purchases and payouts can be presented as follows.
Scenarios for performing operations via the main interfaces of the payment platform correspond to those presented in the diagrams. Similarly, when additional features (such as payment links) are used, scenarios for performing operations also correspond to the specifics of those features.
One-time purchases by using Payment Page
General information
To process a purchase through Payment Page by using the Paypal method, the merchant's web service is required to send a request with all required parameters and signature to the ecommpay URL and receive a callback with the result. The full sequence and special aspects of purchase processing are provided below.
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
. - Depending on the merchant business type, to improve payment acceptance rate, it may be relevant to specify the following parameters (partially or completely; information on parameters recommended in specific cases can be clarified with the ecommpay account manager):
customer_email
—customer email address;customer_first_name
—customer first name;customer_last_name
—customer last name;customer_country
—customer country code in ISO 3166-1 alpha-2 format;customer_phone
—customer phone number;payment_methods_options
—a string object the name of which is thepaypal_wallet
method indicator and the value of which is theadditional_data
object containing additional customer information: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
.ota_type
—OTA (online travel agency) type (for exampleCar rental
)ota_service_start_date
—OTA service start time (UTC+0) in ISO 8601 format (for example2022-01-25T10:15:30+00:00
)ota_service_end_date
—OTA service end time (UTC+0) in ISO 8601 format (for example2022-01-25T10:15:30+00:00
)ota_change_guest_t_f
—indicates whether the customer is able to be changed (if yes—1
, if no—0
)ota_start_country
—code of the country where the services start to be provided to the customerota_start_city
—name of the city where the services start to be provided to the customerota_start_zipcode
—full zip code of the place where the services start to be provided to the customer
- 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, signature, as well as possible additional parameters.
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.
The following is the example of a callback with information about a declined purchase.
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.
COF purchases by using Payment Page
General information
The Paypal payment method provides the ability to perform COF purchases—regular on-demand payments. For more information about COF purchases, see On-demand COF purchase.
Registration of a COF purchases is also available by using Payment Page. For registration the web service must send a request containing the required parameters and signature, as well as data for registering a COF purchase in the recurring
object, to the ecommpay URL and accept a callback with the result. In the callback about registering a COF purchase, you will get its ID, which you need to use to make or cancel regular payments via Gate. For more information, see COF purchases by using Gate.
Information about the formats of requests and callbacks used for processing payments by using the Paypal method via Payment Page is presented further in this section; general information about working with the Payment Page API is presented in Interaction concepts.
Request format
There are several things you need to consider when creating requests to open a payment form for registering COF purchases by using the Paypal method:
- 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
. - For specifying the properties of a COF purchase, the request should contain the
recurring
parameter as a JSON object—if the payment form is opened via the JavaScript library of ecommpay—or as a string generated as a result of URL encoding—if the payment form is opened via another method. Therecurring
parameter must contain the main details about COF purchase registration:register
, boolean—parameter which indicates whether the payment should be registered as recurring and which should be assigned thetrue
value.type
, string—COF purchase type which should be assigned one of the following values:U
—autopurchaseR
—regular purchase
period
, string—frequency of debits (for a regular purchase), this parameter should be assigned one of the following values:D
—dailyW
—weeklyM
—monthly (if the set day is not available in the next month, for example, 31, the payment is performed on the last day of the month)Q
—quarterlyY
—annually
time
, string—time of performing subsequent debits (for a regular purchase) inhh:mm:ss
format. The parameter is used if theperiod
parameter is specified in the request.interval
, integer—interval of performing regular purchases. This parameter should be assigned a numeric value from1
to100
(for example, each three weeks) and is necessarily used in conjunction with theperiod
parameter.
- For specifying the properties of a regular purchase, the
recurring
parameter can also contain other details:amount
, integer—fixed amount of subsequent debits in the smallest currency unitexpiry_day
, integer or string—COF purchase expiry dayexpiry_month
, integer or string—COF purchase expiry monthexpiry_year
, integer—COF purchase expiry yearstart_date
, string—date on which the first debit is performed in thedd-mm-yyyy
format (the parameter is necessarily used in conjunction with thescheduled_payment_id
parameter)scheduled_payment_id
, string—identifier assigned to the payment within which scheduled debits are performed; it must differ from the identifier of the payment made to register a COF purchase and must be unique within the project; (also, not to be confused with the debiting series record identifier specified in theid
parameter of therecurring
object that is specified in the callback with the COF purchase registration information)Warning: If the identifier that should be assigned to the COF purchase (scheduled_payment_id
) matches the identifier of the payment made to register a COF purchase (payment_id
), the request to register a COF purchase is declined.
- Depending on the merchant business type, to improve payment acceptance rate, it may be relevant to specify the following parameters (partially or completely; information on parameters recommended in specific cases can be clarified with the ecommpay account manager):
customer_email
—customer email address;customer_first_name
—customer first name;customer_last_name
—customer last name;customer_country
—customer country code in ISO 3166-1 alpha-2 format;customer_phone
—customer phone number;payment_methods_options
—a string object the name of which is thepaypal_wallet
method indicator and the value of which is theadditional_data
object containing additional customer information: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
.ota_type
—OTA (online travel agency) type (for exampleCar rental
)ota_service_start_date
—OTA service start time (UTC+0) in ISO 8601 format (for example2022-01-25T10:15:30+00:00
)ota_service_end_date
—OTA service end time (UTC+0) in ISO 8601 format (for example2022-01-25T10:15:30+00:00
)ota_change_guest_t_f
—indicates whether the customer is able to be changed (if yes—1
, if no—0
)ota_start_country
—code of the country where the services start to be provided to the customerota_start_city
—name of the city where the services start to be provided to the customerota_start_zipcode
—full zip code of the place where the services start to be provided to the customer
- 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, the registration parameter and the conditions for regular payments, as well as signature.
Callback format
The Paypal method uses the standard format for callbacks to deliver COF purchase registration results. For more information, see Callbacks.
The following is the example of a callback with an information about a processed COF purchase.
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.
- Information of operations performing—about error and response codes that are used in the payment platform to record information about performing of operations.
One-time purchases by using Gate
General information
Overview
Payments via Gate by using the Paypal method can be processed in two ways: directly through the Gate API, and also by using the Paypal SDK and Gate API. On the web service side, the differences between the processing ways concern sending requests and redirecting customers, the choice of a specific way remains with the merchant.
Setup of payment processing by using the Paypal SDK and Gate API
Before processing payments via the Paypal SDK and Gate API by using the Paypal method, the merchant's web service is required to do the following:
- Set up the Paypal SDK in accordance with the official documentation (https://developer.paypal.com/sdk/js/)
- Set up the display of the button for selecting this payment method on the web service side, also in accordance with the official documentation (https://developer.paypal.com/docs/checkout/standard/customize/standalone-buttons/, https://developer.paypal.com/demo/checkout/#/pattern/server)
- Reference the Paypal JavaScript library on the client side of the web service using the following link.
<script src="https://www.paypal.com/sdk/js?client-id=<CLIENT_ID>&merchant-id=<MERCHANT_ID>¤cy=USD"></script>
This link uses the variables
<CLIENT_ID>
—the identifier of the payment platform in the Paypal service, which is determined after granting ecommpay the rights to make payments on behalf of the merchant, and<MERCHANT_ID>
—the identifier of the merchant in the Paypal service.
Payment processing by using the Paypal SDK and Gate API
After setting up to process payments through the Paypal SDK and Gate API by using the Paypal method, to process each payment the merchant's web service is required to do the following:
- 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.
Information about the formats of requests and callbacks used for processing payments by using the Paypal method via the Paypal SDK and Gate API is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.
Payment processing by using the Gate API directly
To process payments through Gate directly by using the Paypal method, the merchant's web service is required to do the following:
- 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.
Information about the formats of requests and callbacks used for processing payments by using the Paypal method via Gate directly is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.
Format of requests for processing of one-step purchases
Parameters to be specified
There are several things you need to consider when sending purchase requests by using the Paypal method:
- 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
return_url
—URLs to which customer is redirected while or after payment processing:success
—URL to redirect the customer to the web service after the customer completes all the required actions on the Paypal service sidedecline
—URL to redirect the customer to the web service after the customer doesn't complete all the required actions on the Paypal service side
- Object
- Additional parameters can be required depending on the merchant business type (refer to your ecommpay key account manager for more information):
- Object
customer
—customer information:email
—customer email address;first_name
—customer first name;last_name
—customer last name;country
—customer country code in ISO 3166-1 alpha-2 format;phone
—customer phone number;
- Object
additional_data
—additional customer information in the merchant service:sender_create_date
—customer account creation time (UTC+0) in ISO 8601 format (for 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
.ota_type
—OTA (online travel agency) type (for exampleCar rental
)ota_service_start_date
—OTA service start time (UTC+0) in ISO 8601 format (for example2022-01-25T10:15:30+00:00
)ota_service_end_date
—OTA service end time (UTC+0) in ISO 8601 format (for example2022-01-25T10:15:30+00:00
)ota_change_guest_t_f
—indicates whether the customer is able to be changed (if yes—1
, if no—0
)ota_start_country
—code of the country where the services start to be provided to the customerota_start_city
—name of the city where the services start to be provided to the customerota_start_zipcode
—full zip code of the place where the services start to be provided to the customer
- 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, URLs for redirection and additional information (if required).
Sending requests by using the Paypal SDK and Gate API
When sending requests by using the Paypal SDK and Gate API it is necessary that these requests correspond to the format supported by the Paypal SDK. To initiate each purchase send a separate POST request to the /v2/payment/wallet/paypal/sale
endpoint.
As an example, the implementation of the request sending function may look like the following.
const test = { createOrder: function (data) { return fetch('https://api.ecommpay.com/v2/payment/wallet/paypal/sale', { method: 'POST', body: JSON.stringify(data), }); }, }; test.createOrder({ project_id: 123, payment_amount: '10000', ... })
Sending requests by using the Gate API directly
To initiate each purchase, send a separate POST request to the /v2/payment/wallet/paypal/sale
endpoint. This endpoint belongs to the group /v2/payment/wallet/{payment_method}/sale.
Format of requests for authorization hold
Parameters to be specified
There are several things you need to consider when sending authorization hold requests by using the Paypal method:
- 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
return_url
—the URLs to which customer is redirected while or after payment processing:return
—URL for redirecting a customer during any step of the purchase.
- Object
- Additional parameters can be required depending on the merchant business type (refer to your ecommpay key account manager for more information):
- Object
customer
—customer information:email
—customer email address;first_name
—customer first name;last_name
—customer last name;country
—customer country code in ISO 3166-1 alpha-2 format;phone
—customer phone number;
- Object
additional_data
—additional customer information in the merchant service:sender_create_date
—customer account creation time (UTC+0) in ISO 8601 format (for 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
.ota_type
—OTA (online travel agency) type (for exampleCar rental
)ota_service_start_date
—OTA service start time (UTC+0) in ISO 8601 format (for example2022-01-25T10:15:30+00:00
)ota_service_end_date
—OTA service end time (UTC+0) in ISO 8601 format (for example2022-01-25T10:15:30+00:00
)ota_change_guest_t_f
—indicates whether the customer is able to be changed (if yes—1
, if no—0
)ota_start_country
—code of the country where the services start to be provided to the customerota_start_city
—name of the city where the services start to be provided to the customerota_start_zipcode
—full zip code of the place where the services start to be provided to the customer
- Object
- Additionally, any other parameters included in the specification can be used.
A correct authorization hold request in the Paypal method must include project and payment IDs, the signature, currency and amount of the purchase, customer IP address, URL for redirection and additional information (if required).
Sending requests by using the Paypal SDK and Gate API
When sending requests by using the Paypal SDK and Gate API it is necessary that these requests correspond to the format supported by the Paypal SDK. To initiate each purchase send a separate POST request to the /v2/payment/wallet/paypal/auth
endpoint.
As an example, the implementation of the request sending function may look like the following.
const test = { createOrder: function (data) { return fetch('https://api.ecommpay.com/v2/payment/wallet/paypal/auth, { method: 'POST', body: JSON.stringify(data), }); }, }; test.createOrder({ project_id: 123, payment_amount: '10000', ... })
Sending requests by using the Gate API directly
To initiate each purchase, send a separate POST request to the /v2/payment/wallet/paypal/auth
endpoint. This endpoint belongs to the group /v2/payment/wallet/{payment_method}/auth.
Format of requests for debiting of authorized amount
There are several things you must consider when sending debiting requests by using the Paypal method:
- 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.
Format of requests for release of authorized 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.
Formats of intermediate callbacks for customer redirection
Data format when using the Paypal SDK and Gate API
Each payment made with the Paypal method requires redirection of customers from the merchant's web service to the Paypal service. To redirect a customer it is necessary to receive an intermediate callback from the payment platform and use the order identifier on the Paypal service side (orderID
) in accordance with the official documentation. This identifier is specified in the payment_id
parameter of the provider
object included in the operation
object. The format of intermediate callbacks is standard (details).
Data format when using the Gate API directly
Each payment made with the Paypal method requires redirection of customers from the merchant's web service to the Paypal service. To redirect a customer it is necessary to receive an intermediate callback from the payment platform and use the information included in the redirect_data
object. The format of such callbacks is standard (details), and the following objects and parameters are included in the redirect_data
object:
body
—object with data to be sent in the request bodymethod
—parameter specifying the HTTP method for sending the request (GET
orPOST
)url
—parameter containing a link for redirection
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.
The following is the example of a callback with information about a declined purchase.
The following is an example of a callback with the information about the 100,00 USD
authorisation hold in the 1037
project.
The following is the example of a callback for a declined authorisation hold request.
The following is the example of a callback with the information about the debiting of 100,00 EUR
in the 1037
project.
The following is the example of a callback with the information about a declined debiting of funds.
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.
The following is the example of a callback for declined cancelling of an authorisation hold.
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.
COF purchases by using Gate
General information
The Paypal payment method provides the ability to perform COF purchases—regular on-demand payments. For more information about COF purchases, see On-demand COF purchase and COF purchase with automatic debiting.
Information about the formats of requests and callbacks used for processing payments by using the Paypal method via Gate is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.
COF purchase registration
To register a COF purchase by using Gate, the merchant is required to send a request for purchase with all the required parameters (including the register
parameter of the recurring
object, set to the value true
) to the ecommpay URL and get the callback with the payment result from the payment platform. To register a regular payment the request should also contain information about the frequency, amount, start and end dates of regular payments. The COF purchase registration callback contains its identifier, which can be used to process or cancel regular payments.
For more information about purchase processing by using Gate, see One-time purchases by using Gate.
Format of requests for registration of COF purchases when processing of one-time one-step purchases
There are several things you need to consider when sending requests for registering COF purchases via processing of one-time one-step purchases:
- To register each COF purchase, send a separate POST request to the
/v2/payment/wallet/paypal/sale
endpoint, which belongs to the group /v2/payment/wallet/{payment_method}/sale. - 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
return_url
—URLs to which customer is redirected while or after payment processing:success
—URL to redirect the customer to the web service after the customer completes all the required actions on the Paypal service sidedecline
—URL to redirect the customer to the web service after the customer doesn't complete all the required actions on the Paypal service side
- Object
recurring
—COF purchase information:register
—payment registration as a COF purchasetype
—type of the COF purchase:R
(for Regular payment) orU
(for Autopayment), for more information, refer to Overviewscheduled_payment_id
—identifier of the next COF purchasestart_date
—the start date of regular payments, in theDD-MM-YYYY
format (must be at least one day later than the date of registration)amount
—amount of debitingperiod
—regular payment performing periodinterval
— regular payment performing intervaltime
—regular payment performing time in thehh:mm:ss (UTC0)
format
- Object
- Additional parameters can be required depending on the merchant business type (refer to your ecommpay key account manager for more information):
- Object
customer
—customer information:email
—customer email address;first_name
—customer first name;last_name
—customer last name;country
—customer country code in ISO 3166-1 alpha-2 format;phone
—customer phone number;
- Object
additional_data
—additional customer information in the merchant service:sender_create_date
—customer account creation time (UTC+0) in ISO 8601 format (for 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
.ota_type
—OTA (online travel agency) type (for exampleCar rental
)ota_service_start_date
—OTA service start time (UTC+0) in ISO 8601 format (for example2022-01-25T10:15:30+00:00
)ota_service_end_date
—OTA service end time (UTC+0) in ISO 8601 format (for example2022-01-25T10:15:30+00:00
)ota_change_guest_t_f
—indicates whether the customer is able to be changed (if yes—1
, if no—0
)ota_start_country
—code of the country where the services start to be provided to the customerota_start_city
—name of the city where the services start to be provided to the customerota_start_zipcode
—full zip code of the place where the services start to be provided to the customer
- Object
- Additionally, any other parameters included in the specification can be used.
Thus, a correct COF purchase registration request by using the Paypal method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer information, URLs for redirection, the registration parameter and the conditions for regular payments, as well as signature.
Format of requests for registration of COF purchases when processing of one-time two-step purchases
There are several things you need to consider when sending requests for registering COF purchases via processing of one-time two-step purchases:
- To register each COF purchase, send a separate POST request to the
/v2/payment/wallet/paypal/auth
endpoint, which belongs to the group /v2/payment/wallet/{payment_method}/auth. - 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
return_url
—the URLs to which customer is redirected while or after payment processing:return
—URL for redirecting a customer during any step of the purchase.
- Object
recurring
—COF purchase information:register
—payment registration as a COF purchasetype
—type of the COF purchase:R
(for Regular payment) orU
(for Autopayment), for more information, refer to Overviewscheduled_payment_id
—identifier of the next COF purchasestart_date
—the start date of regular payments, in theDD-MM-YYYY
format (must be at least one day later than the date of registration)amount
—amount of debitingperiod
—regular payment performing periodinterval
— regular payment performing intervaltime
—regular payment performing time in thehh:mm:ss (UTC0)
format
- Object
- Depending on the merchant business type, to improve payment acceptance rate, it may be relevant to specify the following parameters (partially or completely; information on parameters recommended in specific cases can be clarified with the ecommpay account manager):
- Object
customer
—customer information:email
—customer email address;first_name
—customer first name;last_name
—customer last name;country
—customer country code in ISO 3166-1 alpha-2 format;phone
—customer phone number;
- Object
additional_data
—additional customer information in the merchant service:sender_create_date
—customer account creation time (UTC+0) in ISO 8601 format (for 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
.ota_type
—OTA (online travel agency) type (for exampleCar rental
)ota_service_start_date
—OTA service start time (UTC+0) in ISO 8601 format (for example2022-01-25T10:15:30+00:00
)ota_service_end_date
—OTA service end time (UTC+0) in ISO 8601 format (for example2022-01-25T10:15:30+00:00
)ota_change_guest_t_f
—indicates whether the customer is able to be changed (if yes—1
, if no—0
)ota_start_country
—code of the country where the services start to be provided to the customerota_start_city
—name of the city where the services start to be provided to the customerota_start_zipcode
—full zip code of the place where the services start to be provided to the customer
- Object
- Additionally, any other parameters included in the specification can be used.
Thus, a correct COF purchase registration request by using the Paypal method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer information, URL for redirection, the registration parameter and the conditions for regular payments, as well as signature.
Format of requests for COF purchase processing
After the payment is registered, the funds are debited according to the specified regular payment conditions. You initiate COF purchase by sending a recurring
request to the payment platform.
There are several things you must consider when processing COF purchases performing by using the Paypal method:
- To process each purchase, send a separate POST request to the
/v2/payment/wallet/paypal/recurring
endpoint, which belongs to the group /v2/payment/wallet/{payment_method}/recurring. - 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:ip_address
—customer IP address relevant for the initiated payment
- Object
recurring
—COF purchase information:id
—registered COF purchase identifier
- Object
- Depending on the merchant business type, to improve payment acceptance rate, it may be relevant to specify the following parameters (partially or completely; information on parameters recommended in specific cases can be clarified with the ecommpay account manager):
- Object
customer
—customer information:email
—customer email address;first_name
—customer first name;last_name
—customer last name;country
—customer country code in ISO 3166-1 alpha-2 format;phone
—customer phone number;
- Object
additional_data
—additional customer information in the merchant service:sender_create_date
—customer account creation time (UTC+0) in ISO 8601 format (for 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
.ota_type
—OTA (online travel agency) type (for exampleCar rental
)ota_service_start_date
—OTA service start time (UTC+0) in ISO 8601 format (for example2022-01-25T10:15:30+00:00
)ota_service_end_date
—OTA service end time (UTC+0) in ISO 8601 format (for example2022-01-25T10:15:30+00:00
)ota_change_guest_t_f
—indicates whether the customer is able to be changed (if yes—1
, if no—0
)ota_start_country
—code of the country where the services start to be provided to the customerota_start_city
—name of the city where the services start to be provided to the customerota_start_zipcode
—full zip code of the place where the services start to be provided to the customer
- Object
- Additionally, any other parameters included in the specification can be used.
Thus, a correct purchase request by using the Paypal method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer IP address, COF purchase identifier, as well as signature.
Format of request for cancellation of COF purchases
Until the expiration date of a COF purchase, you can cancel it. There are several things you must consider when cancelling COF purchases by using the Paypal method:
- To cancel each purchase, send a separate POST request to the
/v2/payment/wallet/paypal/recurring/cancel
endpoint, which belongs to the group /v2/payment/wallet/{payment_method}/recurring/cancel. - 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
recurring
—COF purchase information:id
—registered COF purchase identifier
- Object
- Additionally, any other parameters included in the specification can be used.
Thus, a correct purchase request by using the Paypal method must contain the project, payment and COF purchase identifiers, as well as signature.
Callback format
The standard format for callbacks is used to deliver the results of actions with COF purchases. For more information, see Callbacks.
The following is the example of a callback with an information about a processed COF purchase.
The following is the example of a callback with an information about a cancelled COF purchase.
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.
- 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.
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.
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.
The following is the example of a callback with information about a declined refund.
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.
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.
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.
The following is the example of a callback with information about a declined payout.
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.