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

First of all, you fill in an application for payment—we, such and such (project ID), require a new payment (payment ID) to transfer funds in our favor (payment details).
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 ID and secret key, you received from ECommPay */
const e = new Payment('112', 'secret_key');

/* An application for payment */
e.paymentId = 'test_payment_1542'; // The payment ID which is unique for your project
e.paymentAmount = 3415;            // The amount in minor units of currency
e.paymentCurrency = 'GBP';         // The currency in the ISO-4217 alpha-3 format

/* 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 the parameters in this example, except for PaymentDescription, are necessary and mandatory for any payment. Also you can use other parameters. 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
        "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"
  },
  "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. Whith SDK the signature is validated automatically.
More about: calbacks , payment statuses   and operation statuses .

* Installing SDK

If SDK is not installed yet, you can downdload 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

First of all, you fill in an application for payment—we, such and such (project ID), require a new payment (payment ID) to transfer funds in our favor (payment details).
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 ID which you received from ECommPay when starting integration
 
$payment->setPaymentAmount(31415)->setPaymentCurrency('GBP');  
    // The payment amount (in minor units of currency) 
    // and currency (in the ISO-4217 alpha-3 format)
 
$payment->setPaymentId('test_payment_1542');
    // The payment ID which is unique for your project
                     
$payment->setPaymentDescription('Test payment');  
    // The description of the payment. An optional but useful parameter
 
$gate = new ecommpay\Gate('secret_key');
    // The secret key of your project which you received 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 the parameters in this example, except for PaymentDescription, are necessary and mandatory for any payment. Also you can use other parameters. 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
        "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"
  },
  "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. Whith SDK the signature is validated automatically.
More about: calbacks , payment statuses   and operation statuses .

Filling out an application

First of all, you fill in an application for payment—we, such and such (project ID), require a new payment (payment ID) to transfer funds in our favor (payment details).

/* An initial application for payment */
{
   "project_id": "112" 
       // The project ID which you received from ECommPay
   "payment_id": "test_payment_1542" 
       // The payment ID which is unique for your project
   "payment_currency": "GBP" 
       // The currency in the ISO-4217 alpha-3 format
   "payment_amount": "31415"  
       // The amount in minor units of the currency
   "payment_description": "Test payment" 
       // The payment description. An optional but useful parameter
}

The first four parameters in this example make up the necessary and mandatory minimum for any payment. Also you can use other parameters. 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",
   "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": "92p5OB4uk9Hd4stlknT/hkdL75RUjPphspdaViwglr4FOGY03..."

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"
   "payment_description": "Test payment"
   "signature": "92p5OB4uk9Hd4stlknT/hkdL75RUjPphspdaViwglr4FOGY03cj9lK68Coe7hg..."
}

/* 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
        "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"
  },
  "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. Whith SDK the signature is validated automatically.
More about: calbacks , payment statuses  and operation statuses .