How to connect to our solutions?
First of all, your company should submit an application form   and receive confirmation that everything is ready to begin the integration process.
Once the confirmation is received, your client manager connects you with our technical support specialists—to clarify your requirements, build your optimal payment scenarios, and move further on.

Integration can take anywhere from several hours to several weeks, depending on the complexity of the project, qualifications of specialists and the willingness of both parties to expedite proceedings.
Therefore, it is important to initially coordinate with our specialists regarding the order of tasks, timeframes and deadlines.

It’s important for us to carry out the integration process with great precision.
So we create an individual test environment for both parties to test various settings and tie up loose ends. Once approved, we shift the integration solution from the test mode to the live mode, but it continues to be carefully monitored until we are assured of success, at which point our standard support model applies.

We are used to working hard so we have things to be pleased with.
Once your project passes to the standard support model, you can rest assured that ecommpay will provide reliable transaction processing and enjoy it together with us. You can control all payment processes in your project from personal Merchant Dashboard.
And, of course, you can always contact us  with any queries.

Overview

Let's discover how it works.

Merchants
Your customers
Your web service
Your employees
ecommpay
Payment Page
Gate
Dashboard
Payment platform
Partners
Payment environment
Partners

Examples

Let's see how to use it.

How to make a payment by using Payment Page
* Installing SDK

If the JS SDK is not installed yet, download it from GitHub  and install the package with your package manager.

npm install ecommpay
yarn add ecommpay

With SDK installed you can conduct payments and use other SDK functions.

Filling out an application and creating a request

You begin by filling out an application to make a payment: we, such and such (project identifier), are requesting to process a new payment (payment identifier) with the transfer of funds specified as such (payment currency and amount) from this customer (customer identifier) to us due to reasons (payment description).
Based on the completed application SDK automatically generates a request to open a payment form with the specified payment parameters.

/* The Payment SDK module import */
const { Payment } = require('ecommpay');

/* An ECP object with the project identifier and secret key obtained from ECOMMPAY during integration */
const e = new Payment('112', 'secret_key');

/* An application for payment */
e.paymentId = 'test_payment_1539';        
   /* The payment identifier unique within the project*/
   
e.paymentAmount = 3415;                    
   /* Payment amount in the smallest currency unit*/
   
e.paymentCurrency = 'GBP';                  
   /* Payment currency code in the ISO-4217 alpha-3 format*/
   
e.customerId = 'customer_51413';            
   /* Customer identifier unique within the project*/
   
e.paymentDescription = 'Test payment';   
   /* Payment description. A recommended parameter*/

/* The request to call the payment form */
const url = e.getUrl();

/* The generated URL for this example */
https://paymentpage.ecommpay.com/payment?payment_id=test_payment_1542&payment_am... 

All parameters used in this example, with the exception of the payment description, are a minimum required set and are mandatory for any payment. More .

Sending the request and waiting for a customer

By using the generated request, you can call up the configured payment form for the customer.

In this example, we call the payment form in a new browser tab. But you can do otherwise. More .
Receiving the results

To receive the results of the initiated payment, disassemble the corresponding callback from ecommpay.

/* Code for disassembling callbacks */
const { Callback } = require('ecommpay');

app.post('/payment/callback', function(req, res) {
    const callback = new Callback(req.body);
    if (callback.isPaymentSuccess()) {
        const paymentId = callback.getPaymentId(); // Get the payment ID
        // Perform the necessary actions, for example, set the order status to 'Paid'
    }
});

/* A successful payment callback */
{
    "project_id": 112, // The ID of your project
    "payment": { // The payment data
        "id": "test_payment_1542", // The payment ID
        "type": "purchase", // The type of payment
        "status": "success", // The status of payment
        "date": "2018-08-28T09:36:06+0000", // The date and time of the payment execution
        "method": "card", // The payment method
        "sum": { // The payment amount and currency code
            "amount": 31415,
            "currency": "GBP"
        },
        "description": "Test payment" // The payment description
    },
    "account": { // The details of the customer payment instrument
        "number": "431422******0056",
        "token": "9cb38282187b7a5b5b91b5814c6b814162741b29c0c486fbbc500cd451abb8b2",
        "type": "visa",
        "card_holder": "ADA LOVELACE",
        "id": 778804,
        "expiry_month": "11",
        "expiry_year": "2021"
    },
    "customer": {
        "id": "customer_51413"
    },
    "operation": { // The details of the last operation within the payment
        "id": 2831000001158, // The ID of the operation
        "type": "sale", // The type of the operation
        "status": "success", // The status of the operation
        "date": "2018-08-28T09:36:06+0000", // The date and time of the operation
        "created_date": "2018-08-28T09:35:20+0000",
        "request_id": "fa911bca2ac799001549346890bd962ef3...", // The ID of the request
        "sum_initial": {
            // The amount and currency of the operation as specified in the request
            "amount": 31415,
            "currency": "GBP"
        },
        "sum_converted": {
            // The amount and currency of the operation based on the conversion rules
            "amount": 34765,
            "currency": "EUR"
        },
        "provider": { // The information about the payment from the payment system
            "id": 6,
            "payment_id": "15354489664996",
            "date": "2018-02-07T08:34:24+0000",
            "auth_code": "563253",
            "endpoint_id": 6
        },
        "code": "0", // The unified ECOMMPAY response code
        "message": "Success", // The description of the unified response code
        "eci": "05"
    },
    "signature": "dqZjvCaMXWGCW23ugWcx/VoQbdbaVFbH1nAM2H..." // The callback signature
}

The callback includes a signature and the payment results. With SDK the signature is validated automatically.
More about: calbacks , payment statuses and operation statuses .

* Installing SDK

If SDK is not installed yet, you can download it from GitHub  and install with Composer .

composer require ecommpay/paymentpage-sdk

With SDK installed you can conduct payments and use other SDK functions.

Filling out an application and creating a request

You begin by filling out an application to make a payment: we, such and such (project identifier), are requesting to process a new payment (payment identifier) with the transfer of funds specified as such (payment currency and amount) from this customer (customer identifier) to us due to reasons (payment description).
Based on the completed application SDK automatically generates a request to open a payment form with the specified payment parameters.

/* An initial application for payment */

$payment = new ecommpay\Payment(112);
    // The project identifier obtained from ECOMMPAY during integration

$payment->setPaymentAmount(31415)->setPaymentCurrency('GBP');
    // The payment amount (in the smallest currency unit) and currency code (in the ISO-4217 alpha-3 format)

$payment->setPaymentId('test_payment_1542');
    // The payment identifier unique within the project
                                            
$payment->setCustomerId('customer_51413');
    // The customer identifier unique within the project
											
$payment->setPaymentDescription('Test payment');
    // The payment description. A recommended parameter

$gate = new ecommpay\Gate('secret_key');
    // The secret key of your project obtained from ECOMMPAY

/* The request to call the payment form */
$url = $gate->getPurchasePaymentPageUrl($payment);

/* The generated URL for this example */
https://paymentpage.ecommpay.com/payment?payment_id=test_payment_1542&payment_am... 

All parameters used in this example, with the exception of the payment description, are a minimum required set and are mandatory for any payment. More .

Sending the request and waiting for a customer

By using the generated request, you can call up the configured payment form for the customer.

In this example, we call the payment form in a new browser tab. But you can do otherwise. More .
Receiving the results

To receive the results of the initiated payment, disassemble the corresponding callback from ecommpay.

/* Code for disassembling callbacks */
$gate = new ecommpay\Gate('secret_key');
$callback = $gate->handleCallback($data);

// $data — data in JSON format that are received from ECOMMPAY
// on the URL you specified
// $callback — an object containing the callback data

/*  Methods supported by the Callback object */
// Callback::getPaymentId();            // Get the payment status
// Callback::getPaymentStatus();        // Get all payment data
// Callback::getPayment();              // Get the payment ID in your system


/* A successful payment callback */
{
    "project_id": 112, // The ID of your project
    "payment": { // The payment data
        "id": "test_payment_1542", // The payment ID
        "type": "purchase", // The type of payment
        "status": "success", // The status of payment
        "date": "2018-08-28T09:36:06+0000", // The date and time of the payment execution
        "method": "card", // The payment method
        "sum": { // The payment amount and currency code
            "amount": 31415,
            "currency": "GBP"
        },
        "description": "Test payment" // The payment description
    },
    "account": { // The details of the customer payment instrument
        "number": "431422******0056",
        "token": "9cb38282187b7a5b5b91b5814c6b814162741b29c0c486fbbc500cd451abb8b2",
        "type": "visa",
        "card_holder": "ADA LOVELACE",
        "id": 778804,
        "expiry_month": "11",
        "expiry_year": "2021"
    },
    "customer": {
        "id": "customer_51413"
    },
    "operation": { // The details of the last operation within the payment
        "id": 2831000001158, // The ID of the operation
        "type": "sale", // The type of the operation
        "status": "success", // The status of the operation
        "date": "2018-08-28T09:36:06+0000", // The date and time of the operation
        "created_date": "2018-08-28T09:35:20+0000",
        "request_id": "fa911bca2ac799001549346890bd962ef3...", // The ID of the request
        "sum_initial": {
            // The amount and currency of the operation as specified in the request
            "amount": 31415,
            "currency": "GBP"
        },
        "sum_converted": {
            // The amount and currency of the operation based on the conversion rules
            "amount": 34765,
            "currency": "EUR"
        },
        "provider": { // The information about the payment from the payment system
            "id": 6,
            "payment_id": "15354489664996",
            "date": "2018-02-07T08:34:24+0000",
            "auth_code": "563253",
            "endpoint_id": 6
        },
        "code": "0", // The unified ECOMMPAY response code
        "message": "Success", // The description of the unified response code
        "eci": "05"
    },
    "signature": "dqZjvCaMXWGCW23ugWcx/VoQbdbaVFbH1nAM2H..." // The callback signature
}

The callback includes a signature and the payment results. With SDK the signature is validated automatically.
More about: calbacks , payment statuses and operation statuses .

Filling out an application

You begin by filling out an application to make a payment: we, such and such (project identifier), are requesting to process a new payment (payment identifier) with the transfer of funds specified as such (payment currency and amount) from this customer (customer identifier) to us due to reasons (payment description).

/* An initial application for payment */
{
"project_id": 112
// The project identifier obtained from ECOMMPAY during integration

"payment_id": "test_payment_1542"
// The payment identifier unique within the project

"payment_currency": "GBP"
// The payment currency code in the ISO-4217 alpha-3 format

"payment_amount": 31415
// The payment amount in the smallest currency unit

"customer_id": "customer_51413",
// The customer identifier unique within the project

"payment_description": "Test payment"
// The payment description. A recommended parameter
}

All parameters used in this example, with the exception of the payment description, are a minimum required set and are mandatory for any payment. More .

Certifying the application

To authenticate the application, you should sign it. To generate a signature, use the secret key of your project.

/* The application with the secret key */
{
"project_id": 112,
"payment_id": "test_payment_1542",
"payment_currency": "GBP",
"payment_amount": 31415,
"customer_id": "customer_51413",
"payment_description": "Test payment"
}

"secret key": "secret_key"
// The secret key of your project which you received from ECOMMPAY

/* Generated signature for the application */
"signature": "fLu7Jcf2xSqomO1TKVILmDNC0+8ZlQQchy+POQwTI7Pz5HJsl..."

The signature is generated in the specified way on the basis of the application and the secret key (and is not included in the application before signing to avoid recursion). More .

Creating a request

The signed application can be packed into a request to the address https://paymentpage.ecommpay.com. This is the URL for opening a payment form with the specified payment parameters.

/* The application with the signature */
{
"project_id": 112,
"payment_id": "test_payment_1542",
"payment_currency": "GBP",
"payment_amount": 31415,
"customer_id": "customer_51413",
"payment_description": "Test payment",
"signature": "fLu7Jcf2xSqomO1TKVILmDNC0+8ZlQQchy+POQwTI7Pz5HJsl..."
}

/* The request to call the payment form */
https://paymentpage.ecommpay.com/payment?payment_id=test_payment_1542&payment_amo...
Sending the request and waiting for a customer

By using the generated request, you can call up the configured payment form for the customer.

In this example, we call the payment form in a new browser tab. But you can do otherwise. More .

Receiving the results

To receive the results of the initiated payment, disassemble the corresponding callback from ecommpay.

/* A successful payment callback */
{
    "project_id": 112, // The ID of your project
    "payment": { // The payment data
        "id": "test_payment_1542", // The payment ID
        "type": "purchase", // The type of payment
        "status": "success", // The status of payment
        "date": "2018-08-28T09:36:06+0000", // The date and time of the payment execution
        "method": "card", // The payment method
        "sum": { // The payment amount and currency code
            "amount": 31415,
            "currency": "GBP"
        },
        "description": "Test payment" // The payment description
    },
    "account": { // The details of the customer payment instrument
        "number": "431422******0056",
        "token": "9cb38282187b7a5b5b91b5814c6b814162741b29c0c486fbbc500cd451abb8b2",
        "type": "visa",
        "card_holder": "ADA LOVELACE",
        "id": 778804,
        "expiry_month": "11",
        "expiry_year": "2021"
    },
    "customer": {
        "id": "customer_51413"
    },
    "operation": { // The details of the last operation within the payment
        "id": 2831000001158, // The ID of the operation
        "type": "sale", // The type of the operation
        "status": "success", // The status of the operation
        "date": "2018-08-28T09:36:06+0000", // The date and time of the operation
        "created_date": "2018-08-28T09:35:20+0000",
        "request_id": "fa911bca2ac799001549346890bd962ef3...", // The ID of the request
        "sum_initial": {
            // The amount and currency of the operation as specified in the request
            "amount": 31415,
            "currency": "GBP"
        },
        "sum_converted": {
            // The amount and currency of the operation based on the conversion rules
            "amount": 34765,
            "currency": "EUR"
        },
        "provider": { // The information about the payment from the payment system
            "id": 6,
            "payment_id": "15354489664996",
            "date": "2018-02-07T08:34:24+0000",
            "auth_code": "563253",
            "endpoint_id": 6
        },
        "code": "0", // The unified ECOMMPAY response code
        "message": "Success", // The description of the unified response code
        "eci": "05"
    },
    "signature": "dqZjvCaMXWGCW23ugWcx/VoQbdbaVFbH1nAM2H..." // The callback signature
}

The callback includes a signature and the payment results. With SDK the signature is validated automatically.
More about: calbacks , payment statuses and operation statuses .