Payment link purchases
In addition, use the following materials to gain a fuller understanding of payment link purchases:
- Payment link purchase—an article in the section Payment models and statuses that provides a general description of processing payment link purchases in the ecommpay payment platform and covers information about operations utilised to execute a payment of this type and statuses that are assigned to the payment and the operations performed within it.
- Step-by-step instructions on how to perform payment link purchases via Dashboard.
- articles of the Payment methods section containing a description of processing purchases via Payment Page with the focus on the specific processing scenarios and interaction workflows.
Overview
Payment link purchase is a payment type which uses initial request to generate a web address that allows customers to make purchase that involves a one-time transfer of funds from a customer to a merchant with or without authorization hold. The ecommpay payment platform supports two versions of payment link purchase:
- one-step payment link purchase
- two-step payment link purchase
Both versions can be used for registering a COF purchase and utilise Payment Page. The payment link to this payment form is delivered to the customer by the ecommpay payment platform through email or by the merchant using any available delivery media.
The merchant chooses the payment link validity period and the payment version and specifies them in the request for initiating the payment. The validity period of the link (from the moment when the link is generated in the payment platform to the moment when the request to initiate the payment is received in the payment platform) cannot exceed 30 days, and when the link expires, the payment platform sends a corresponding callback. The merchant can also specify the payment method for making the payment. Alternatively, the merchant can allow the customer to choose one of the payment methods available in the merchant project after the customer opens the payment link.
Because payment link purchases are processed by using Payment Page, payment requests may contain either a card token or no information about payment instrument. In the latter case, the customer is required only to provide evidence of payment instrument validity; there is no need to specify payment instrument details in the payment form.
As in other payment types, payment link purchase may require additional procedures such as 3‑D Secure authentication, provision of additional payment information, or currency conversion. These procedures are performed by Payment Page and require no additional effort on merchant's web service side.
Processing scenarios
Suppose that your customer wants to make a 12.99 GBP
purchase by using payment link and asks you to send the payment link to email baskerville@mail.uk
.
Successful purchase
- The web service sends to the payment platform a request with parameters that require the ecommpay platform to send the payment link to customer.
- The payment platform processes the request, issues the corresponding callback to merchant's web service, and sends the payment link to the email that was specified in the initial request. Standard email content is shown below. The preferable language of email is English.
- Customer clicks the payment link to open Payment Page. If the initial request does not contain instructions to select specific payment method, Payment Page displays payment method selection page. If the initial request specifies the payment method, Payment Page displays the page for the selected payment method.
- The customer enters payment details and proceeds with payment; if necessary the customer performs additional operations required to complete one or more auxiliary procedures.
- After payment is complete the payment platform submits a callback with the payment results to the web service; the web page with the payment result information is displayed to the customer.
Payment cancellation
- Merchant's web service sends a request for payment cancellation to the payment platform.
- The payment platform processes the request, issues the corresponding callback to merchant's web service, and sends an email to the email address that was specified in the initial request. Standard email content is shown below. The preferable language of email is English.
- Customer clicks the payment link and is presented with the payment cancellation page.
Payment link expiration
- The payment platform sends a callback with notification about expired payment link to the web service.
- If customer clicks the payment link, a page with the notification about expired payment link is displayed.
Below you find the information about what the web service is required to do to complete payment.
Customising email and payment form
Email content and design
By default, email that is sent to customer includes the following information from the request for payment link:
- payment ID (from the
payment_id
parameter) - payment amount and currency (from the
currency
andamount
parameters, respectively) - payment link expiry date and time (from the
best_before
parameter) - payment description (from the
description
parameter)
Merchant can customise the template that is used for payment link email . The customisation can include but is not limited to changing the parameters included in emails and customising email design and layout.
To customise the template of payment link email, contact the ecommpay support service at support@ecommpay.com.
Payment form design
By default, the payment form displayed to the customer has the standard design variant provided by ecommpay. If desired, it is possible to customise the design with the application of various changes to separate payment form elements by using the corresponding design builder. With questions that do not cover the design builder capabilities, contact the key account manager.
Workflow
When processing a payment link purchase by using Gate, merchant's web service is required to do the following:
- Send a payment link purchase request to the following endpoint
/v2/payment/invoice[/card/token]/create
. - Receive the callback with the payment link.
- Receive the callback with payment result or the callback with payment link expiry notification.
In a two-step payment link purchase, you need to complete the second step which includes either capturing the authorised amount or cancelling authorisation. For more information about performing the second step in two-step purchase, see Two-step purchase.
The following diagram provides the detailed picture of payment link purchase processing.
To cancel the purchase, do the following before the customer confirms the purchase:
- Send cancel payment request to endpoint
/v2/payment/invoice/cancel
. - Receive the ‘payment cancelled’ callback.
The next sections describes request formats and the parameters for initiating and cancelling payment link purchases; the sections that follow also discuss payment callback formats. Information about possible statuses of this payment type can be found in the corresponding article.
Request formats
Format of payment request
When creating requests, you need to consider the following:
- The request is sent by using POST (HTTP) method to one of the following endpoints: /v2/payment/invoice/create or /v2/payment/invoice/card/token/create.
- The following objects and parameters must be specified in the request:
general
—object with general request identification information:project_id
—the project ID obtained from ecommpay when onboardingpayment_id
—payment ID that must be unique within the projectsignature
—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification.
customer
—object with customer information:id
—customer ID in merchant's web service
payment
—object with payment information:amount
—payment amount in minor currency unitscurrency
—payment currency in the ISO-4217 alpha-3 formatbest_before
—expiry date and time of the payment link in the following format:YYYY-MM-DDThh:mm:ss±hh:mm
. Keep in mind that the validity period of the payment link cannot exceed 30 days.
- If any token is used, you need to add it in the
token
parameter. - To deliver payment link through ecommpay, specify the following parameters:
email
—customer email as specified in thecustomer
object.send_email
—automatic payment link delivery flag that must be set totrue
.language
—language code as specified in thecustomer
object. The parameter is required, if customer language in not English and the corresponding template in available in the payment platform.
- If you need to preselect specific payment method, specify the payment method code in the
force_method
. (For complete list of payment methods codes, see Payment method codes.) - To register a COF purchase, pass the
recurring
object that contains required parameters for the COF purchase being registered:register
—COF purchase registration flag; usetrue
value to have the COF purchase registered.type
—type of the COF purchase to register, possible values:C
—one-click purchaseU
—autopurchaseR
—regular purchase
time
—time of subsequent debiting for regular purchase inhh:mm:ss
formatperiod
—debiting period for regular purchase:D
—dailyW
—weeklyM
—monthlyQ
—quarterlyY
—yearly
You can also use any other additional parameters of the
recurring
object as specified in the API specification. - If required, you can also add any other additional parameters as specified in the API specification.
Thus, a correct payment request for purchase by payment link must include project and payment IDs, signature, customer ID, payment currency and amount, payment link expiry date and time, and, if required, payment card token. If you want ecommpay to deliver payment link to your customer, you need also to specify customer email and set the automatic payment link delivery flag.
{ "general": { "project_id": 1901, "payment_id": "456789", "signature": "v7KNMpfogAxwRIL9tVftZ1ZZ5D/aZAeb0VMdeR+CqGrNxYyilUwSm==" }, "customer": { "id": "stapleton", "email": "baskerville@mail.uk" }, "payment": { "amount": 1500, "currency": "GBP", "best_before": "2023-03-08T09:00:00+03:00" }, "send_email": true, // If card token was previously submitted: "token": "f365bb1729f9b72fd9c097becc679f29c3e35c91d18070d15654" }
Format of request for payment cancellation
When creating requests, you need to consider the following:
- The request is sent by using POST (HTTP) method to the following endpoint: /v2/payment/invoice/cancel.
- The request must contain the
general
object with the key parameters:project_id
—the project ID obtained from ecommpay when onboardingpayment_id
—ID of payment to cancelsignature
—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification.
- If required, you can also add any other additional parameters as specified in the API specification.
Thus, a correct payment request for payment cancellation must include project and payment IDs and signature.
{ "general": { "project_id": 1901, "payment_id": "456789", "signature": "v7KNMpfogAxwRIL9tVftZ1ZZ5D/aZAeb0VMdeR+CqGrNxYyilUwSm==" } }
Callback formats
Format of callback with payment link delivery information
Callbacks with payment link delivery information use the standard format for callbacks described in greater details in Callbacks.
The following is the example of a callback with information about successful generation and delivery of a payment link for a 12.99 GBP
purchase to email baskerville@mail.uk
of the customer stapleton
. The expiration date and time of the payment link is October 11, 2020, 11:50.
Format of callback with payment cancellation information
Callbacks with payment cancellation information use the standard format for callbacks described in greater details in Callbacks.
The following is the example of a callback with information about cancellation of the 456789
payment; payment status is invoice canceled
.
Format of callback with payment link expiry information
Callbacks with payment link expiry information use standard format for callbacks described in greater details in Callbacks.
The following is the example of a callback with information that the payment link which was previously delivered to email baskerville@mail.uk
of the customer stapleton
has expired on February 11, 2020 at 11:50.
Format of callback with payment result
Callbacks with payment result information use the standard format for callbacks described in greater details in Callbacks.
The following is an example of a callback with information about a 12.99 GBP
payment completion for customer stapleton
.