NAV Navbar

For any question, we are one click away

Contact us

Test cards

For testing purposes you can use the following test cards.

Card number (SSL) 4444 5555 1111 3333
Expiry 12/24
CVC 123
Card number (3DS1) 4012 0010 3816 6662
Expiry 12/24
CVC 123
3-D Secure verification code 12345678
Card number (3DS2) 5555 5555 5555 5599
Expiry 12/24
CVC 123

Simple integration

Simple integration

  1. A customer selects a product in the online store, and then clicks Buy.
  2. The online store server receives a purchase request.
  3. The online store server contacts the payment gateway server.
  4. The payment gateway server creates an order, generates a payment link, and send it to the online store server.
  5. The online store redirects the customer to the received URL.
  6. The payment gateway opens the payment URL.
  7. The customer enters his or her card number, expiration date, and CVV/CVC, and clicks Pay.
  8. The payment gateway processes the payment request and displays confirmation of the successful payment to the customer.
  9. The customer returns to the online store page or closes the page.

Notes for simple integration

An example of how to register an order.

curl --request POST \
  --url https://sandbox.paydoc.io/payment/rest/register.do \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data amount=2000 \
  --data currency=978 \
  --data userName=test_user \
  --data password=test_user_password \
  --data returnUrl=finish.html \
  --data description=my_first_order \
  --data language=en
{
  "orderId": "0179018d-8f96-7fbe-bc2b-4b7e00a7d8c0",
  "formUrl": "https://sandbox.paydoc.io/payment/merchants/rbs/payment_en.html?mdOrder=0179018d-8f96-7fbe-bc2b-4b7e00a7d8c0"
}

The merchant operator periodically (manually) checks the order status via the merchant portal to identify the payment result.

Integration with callback

Integration with callback

  1. A customer selects a product in the online store, and then clicks Buy.
  2. The online store server receives a purchase request.
  3. The online store server contacts the payment gateway server.
  4. The payment gateway server creates an order, generates a payment link, and send it to the online store server.
  5. The online store redirects the customer to the received URL.
  6. The payment gateway opens the payment URL.
  7. The customer enters his or her card number, expiration date, and CVV/CVC, and clicks Pay.
  8. The payment gateway processes the payment request and displays confirmation of the successful payment to the customer.
  9. The customer returns to the online store page or closes the page.
  10. The payment gateway sends an asynchronous callback notification to the online store server.
  11. The online store server checks the order status if the callback is not signed.

Notes for integration with callback

Instead of the last step of the Simple Integration a merchant may choose to do one of the following: * Make use of returnUrl:
When the merchant web-site code located at returnUrl (for example, https://www.merchantlogin.com/?back&orderId=61c33664-85a0-7d6b-af26-09ee009c4000&lang=en) identifies a cardholder being redirected back from the gateway after a payment attempt, the merchant can check the order status using the API request getOrderStatusExtended.
This option is the easiest one but it is not completely reliable because the cardholder redirect may fail (for example, as a result of a broken connection or the cardholder closing the browser) and the merchant returnUrl may not get the "trigger" to proceed with getOrderStatusExtended.

curl --request POST \
  --url https://sandbox.paydoc.io/payment/rest/getOrderStatusExtended.do \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data userName=test_user \
  --data password=test_user_password \
  --data orderId=016b6f47-4628-7ea2-80f5-6c6e00a7d8c0 \
  --data language=en
{
  "errorCode": "0",
  "errorMessage": "Success",
  "orderNumber": "11008",
  "orderStatus": 2,
  "actionCode": 0,
  "actionCodeDescription": "",
  "amount": 2000,
  "currency": "978",
  "date": 1618577250840,
  "orderDescription": "my_first_order",
  "merchantOrderParams": [
    {
      "name": "browser_language_param",
      "value": "en"
    },
    {
      "name": "browser_os_param",
      "value": "UNKNOWN"
    },
    {
      "name": "user_agent",
      "value": "curl/7.75.0"
    },
    {
      "name": "browser_name_param",
      "value": "DOWNLOAD"
    }
  ],
  "transactionAttributes": [],
  "attributes": [
    {
      "name": "mdOrder",
      "value": "016b7747-c4ed-70b3-bc36-fdd400a7d8c0"
    }
  ],
  "cardAuthInfo": {
    "maskedPan": "555555**5599",
    "expiration": "202412",
    "cardholderName": "TEST CARDHOLDER",
    "approvalCode": "123456",
    "pan": "555555**5599"
  },
  "authDateTime": 1618577288377,
  "terminalId": "123456",
  "authRefNum": "931793605827",
  "paymentAmountInfo": {
    "paymentState": "DEPOSITED",
    "approvedAmount": 2000,
    "depositedAmount": 2000,
    "refundedAmount": 0
  },
  "bankInfo": {
    "bankCountryCode": "UNKNOWN",
    "bankCountryName": "&ltUnknown&gt"
  }
}
https://myshop.com/callback/?mdOrder=1234567890-098776-234-522&orderNumber=0987&operation=deposited&status=1
https://myshop.ru/callback/?mdOrder=1234567890-098776-234-522&orderNumber=0987&checksum=DBBE9E54D42072D8CAF32C7F660DEB82086A25C14FD813888E231A99E1220AB3&operation=deposited&status=1

Advanced integration

Initiate a funds reservation and subscription for a clientId (recurring payment)

Advanced integration

  1. A customer selects a product in the online store, and then clicks Buy.
  2. The online store server receives a purchase request and opens a payment page.
  3. The customer enters their card details on the online store payment page.
  4. The online store server collects the card data.
  5. The online store server registers an order with clientId and sends card data to a payment gateway.
  6. The payment gateway communicates with the Directory Server to reach the ACS. It returns all the data necessary for the ACS redirect to the online store.
  7. The online store server redirects the customer to the payment gateway.
  8. The payment gateway redirects the customer to the ACS.
  9. The cardholder confirms the order and the ACS redirects him or her to the payment gateway.
  10. The customer returns to the online store page or closes the page.
  11. The payment gateway sends an asynchronous callback notification to the online store server.
  12. The online store server checks the order status to get bindingId for further recurring payments.

Register a recurring order

curl --request POST \
  --url https://sandbox.paydoc.io/payment/rest/registerPreAuth.do \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data amount=2000 \
  --data currency=978 \
  --data userName=test_user \
  --data password=test_user_password \
  --data returnUrl=finish.html \
  --data description=my_second_order \
  --data clientId=659753456 \
  --data 'jsonParams={"recurringFrequency": "5", "recurringExpiry": "20240101"}' \
  --data language=en
{
  "orderId": "017908cc-57c6-739a-ad25-df0d00a7d8c0",
  "formUrl": "https://sandbox.paydoc.io/payment/merchants/rbs/payment_en.html?mdOrder=017908cc-57c6-739a-ad25-df0d00a7d8c0"
}

Request paymentOrder method

curl --request POST \
  --url https://sandbox.paydoc.io/payment/rest/paymentorder.do \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data userName=test_user \
  --data password=test_user_password \
  --data MDORDER=019dbf02-e9f4-7fe2-b1c2-d50500a7d8c0 \
  --data '$PAN=4012001038166662' \
  --data '$CVC=123' \
  --data YYYY=2024 \
  --data MM=12 \
  --data 'TEXT=TEST CARDHOLDER' \
  --data 'ip=185.230.240.201' \
  --data language=en
{
  "info": "Your order is proceeded, redirecting...",
  "errorCode": 0,
  "acsUrl": "https://web.rbsuat.com/acs/auth/start.do",
  "paReq": "eJxVUtFu4jAQ/BWU92DHcSCpFle946ryAEd7FKl9OZl4gbSNA05ypP36s0NSWsmSd8br3fGO4brJ3wb/0JRZoSdeMKTeAHVaqEzvJt7j6taPvWsBq71BnP7BtDYoYI5lKXc4yNTEG48kj5KN8jfxOPH5NqZ+kiTURxYlSEMaxtvUE7C8ecCjgK6RsH2GDEgPbUWT7qWuBMj0+GO2EJyNR5QC6SDkaGZTEfGQhRzIGYGWOYpSarUpmr95VwJIS0Na1Loy72LEQyA9gNq8iX1VHa4IqbCshmmRA3EkkIuGZe2i0hZpMiUWH/en39NZs3j5xearHZ+vnk6LD7tPnyZAXAYoWaFglAWUB8mAjq/simIgLQ8yd93tefugM4CD63Hz9eQrA3bQxvrQy+8RYHMoNLo7QD5jeHDGCNgaPNZtXgTkAgC1OmdYiZwGNLB3ewpIv19e/fPO+ZBWdsYvxamWr6rcnNaqWMuQrbF+zqLlXbQ7OHfaJKcqs9NlPDjLcgCIK0M640n3Z2z07S/9Bypv08k=",
  "termUrl": "https://sandbox.paydoc.io/payment/rest/finish3ds.do?lang=en"
}

Redirect to the ACS

The online store must POST paReq, MD (same value as MDORDER above), and termUrl to acsUrl. Alternatively, the online store can use the gateway acsRedirect method, which will perform the same cardholder redirect to the issuer ACS.

https://sandbox.paydoc.io/payment/acsRedirect.do?orderId=017908cc-57c6-739a-ad25-df0d00a7d8c0

Get status for bindingId

curl --request POST \
  --url https://sandbox.paydoc.io/payment/rest/getOrderStatusExtended.do \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data userName=test_user \
  --data password=test_user_password \
  --data orderId=017908cc-57c6-739a-ad25-df0d00a7d8c0 \
  --data language=en
{
  "errorCode": "0",
  "errorMessage": "Success",
  "orderNumber": "11044",
  "orderStatus": 1,
  "actionCode": 0,
  "actionCodeDescription": "",
  "amount": 2000,
  "currency": "978",
  "date": 1618815949170,
  "orderDescription": "my_second_order",
  "ip": "185.230.240.201",
  "merchantOrderParams": [
    {
      "name": "browser_language_param",
      "value": "en"
    },
    {
      "name": "recurringExpiry",
      "value": "20240101"
    },
    {
      "name": "recurringFrequency",
      "value": "5"
    },
    {
      "name": "browser_os_param",
      "value": "UNKNOWN"
    },
    {
      "name": "user_agent",
      "value": "curl/7.75.0"
    },
    {
      "name": "browser_name_param",
      "value": "DOWNLOAD"
    }
  ],
  "transactionAttributes": [],
  "attributes": [
    {
      "name": "mdOrder",
      "value": "017908cc-57c6-739a-ad25-df0d00a7d8c0"
    }
  ],
  "cardAuthInfo": {
    "maskedPan": "401200**6662",
    "expiration": "202412",
    "cardholderName": "TEST CARDHOLDER",
    "approvalCode": "123456",
    "pan": "401200**6662"
  },
  "bindingInfo": {
    "clientId": "659753456",
    "bindingId": "0162d467-bbfe-77f3-9c21-415c00a7d8c0"
  },
  "authDateTime": 1618816213981,
  "terminalId": "123456",
  "authRefNum": "012851192298",
  "paymentAmountInfo": {
    "paymentState": "APPROVED",
    "approvedAmount": 2000,
    "depositedAmount": 0,
    "refundedAmount": 0
  },
  "bankInfo": {
    "bankCountryCode": "UNKNOWN",
    "bankCountryName": "&ltUnknown&gt"
  }
}

Initiate funds capture when goods are actually shipped

Capture money

  1. An online store employee selects an order in an online store dashboard.
  2. The online store dashboard sends a capture request to its server.
  3. The online store server calls deposit.do.
curl --request POST \
  --url https://sandbox.paydoc.io/payment/rest/deposit.do \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data userName=test_user \
  --data password=test_user_password \
  --data amount=2000 \
  --data orderId=017908cc-57c6-739a-ad25-df0d00a7d8c0 \
  --data language=en
{
  "errorCode": "0",
  "errorMessage": "Success"
}

Merchant initiates a partial refund a few days later for goods that arrived damaged

Refund money

  1. An online store employee selects an order in an online store dashboard.
  2. The online store dashboard sends a refund request to its server.
  3. The online store server calls refund.do.
curl --request POST \
  --url https://sandbox.paydoc.io/payment/rest/refund.do \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data userName=test_user \
  --data password=test_user_password \
  --data orderId=017908cc-57c6-739a-ad25-df0d00a7d8c0 \
  --data amount=2000 \
  --data language=en
{
  "errorCode": "0",
  "errorMessage": "Success"
}

Merchant initiates a monthly recurring payment

Recurrent payment

  1. The online store server registers an order and conducts a payment with bindingId.
  2. The online store can check the payment status or wait for a signed callback.

Register subsequent recurring payment

curl --request POST \
  --url https://sandbox.paydoc.io/payment/rest/register.do \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data amount=2000 \
  --data currency=978 \
  --data userName=test_user \
  --data password=test_user_password \
  --data returnUrl=finish.html \
  --data clientId=259753456 \
  --data description=my_first_order \
  --data language=en \
  --data features=AUTO_PAYMENT
{
  "orderId": "01791274-d9ca-7103-b148-7dc000a7d8c0",
  "formUrl": "https://sandbox.paydoc.io/payment/merchants/rbs/payment_en.html?mdOrder=01791274-d9ca-7103-b148-7dc000a7d8c0"
}

Ignore formUrl in register response. You don't need it for recurrent payment. Next call paymentOrderBinding.do from your server to make a recurrent payment.

Recurring payment with bindingId

curl --request POST \
  --url https://sandbox.paydoc.io/payment/rest/paymentOrderBinding.do \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data userName=test_user \
  --data password=test_user_password \
  --data mdOrder=01791274-d9ca-7103-b148-7dc000a7d8c0 \
  --data bindingId=01491394-63a6-7d45-a88f-7bce00a7d8c0 \
  --data ip=1d0d:db8:6:1::77 \
  --data language=en
{
  "redirect": "https://sandbox.paydoc.io/payment/merchants/rbs/finish.html?orderId=01791274-d9ca-7103-b148-7dc000a7d8c0&lang=en",
  "info": "Your order is proceeded, redirecting...",
  "errorCode": 0
}

Check subsequent recurring order status

curl --request POST \
  --url https://sandbox.paydoc.io/payment/rest/getOrderStatusExtended.do \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data userName=test_user \
  --data password=test_user_password \
  --data orderId=01791274-d9ca-7103-b148-7dc000a7d8c0 \
  --data language=en
{
  "errorCode": "0",
  "errorMessage": "Success",
  "orderNumber": "11045",
  "orderStatus": 2,
  "actionCode": 0,
  "actionCodeDescription": "",
  "amount": 2000,
  "currency": "978",
  "date": 1618816612879,
  "orderDescription": "my_first_order",
  "ip": "1d0d:db8:6:1::77",
  "merchantOrderParams": [
    {
      "name": "browser_language_param",
      "value": "en"
    },
    {
      "name": "browser_os_param",
      "value": "UNKNOWN"
    },
    {
      "name": "user_agent",
      "value": "curl/7.75.0"
    },
    {
      "name": "browser_name_param",
      "value": "DOWNLOAD"
    }
  ],
  "transactionAttributes": [],
  "attributes": [
    {
      "name": "mdOrder",
      "value": "01791274-d9ca-7103-b148-7dc000a7d8c0"
    }
  ],
  "cardAuthInfo": {
    "maskedPan": "555555**5599",
    "expiration": "202412",
    "cardholderName": "TEST CARDHOLDER",
    "approvalCode": "123456",
    "pan": "555555**5599"
  },
  "bindingInfo": {
    "clientId": "259753456",
    "bindingId": "01491394-63a6-7d45-a88f-7bce00a7d8c0"
  },
  "authDateTime": 1618816705914,
  "terminalId": "123456",
  "authRefNum": "947633173729",
  "paymentAmountInfo": {
    "paymentState": "DEPOSITED",
    "approvedAmount": 2000,
    "depositedAmount": 2000,
    "refundedAmount": 0
  },
  "bankInfo": {
    "bankCountryCode": "UNKNOWN",
    "bankCountryName": "&ltUnknown&gt"
  }
}