Overview

Bank payment means that merchants can withdraw the specified local currency on EPAY to the user's bank account;

Payment Process

Merchants can refer to the following flow chart to complete payment docking.

image

Flow Description

  1. The user visits the merchant page to initiate a quick payout's (cash withdrawal) transaction application.
  2. The merchant background service calls the getLimit interface to the EPAY gateway background service to obtain the transaction limit.
  3. EPAY Gateway Back Office Service Responses to Obtain Transaction Limits.
  4. The merchant back-office service calls the interface before the transaction to query various transaction information and conditions.
  5. EPAY gateway backend service response query data.
  6. The user visits the merchant page to initiate a transaction request.
  7. The merchant background service calls the createTransaction interface to the EPAY gateway background service to create a transaction.
  8. EPAY Gateway Background Service Creates Temporary Orders: Order Status = 9.
    • If the order time is more than 10 minutes, EPAY Gateway Background Service [Active] closes the order: order status = 5, call back the order status, and end the order process.
  9. If the user cancels the payment, the merchant background service calls the cancelTransaction interface to the EPAY gateway background service to cancel the order.
    • EPAY Gateway Background Service [Active] Closes Orders, Order Status = 5, Callbacks Order Status, and Ends Order Process
  10. The merchant background service calls the confirmTransaction interface to the EPAY gateway background service to confirm the transaction.
  11. EPAY Gateway Background Service creates a formal order and starts processing: Order Status = 1
  12. EPAY Gateway Background Service Calls Third Party Bank to Complete Payment Transaction.
  13. The third-party bank AcquireerBank the callback result to the EPAY gateway background service.
  14. The EPAY gateway backend service processes the order result, including the order success: order status = 7, order failure: order status = 6,[Cash payment] Enter pending withdrawal: order status status=19;
  15. The EPAY gateway background service sends the callback result to the merchant background service to notify the transaction order has been completed.
  16. The merchant background service can choose to call the queryTransaction interface for information confirmation.
  17. EPAY gateway background service response queryTransaction interface data(For cash transactions, query the pinCode through this interface).
  18. The merchant back-office service updates the transaction data and completes the order status.
  19. The merchant back-office service informs the user of the order completion status.

CNY Add bank account

Before initiating a transaction, you need to submit bank information to the bank channel for verification and review. After the review is passed, you can place an order transaction.

  1. The specific bank information is as follows:

Payer information: can be fixed to your authentication information (refers to the actual beneficiary), nationality, actual residence address must be outside China.

Payee information: mobile phone number (China), ID card number (ID card), bank account. The payee must be a citizen of mainland China.

  1. The merchant's docking with bank information is explained as follows:

First, call the queryBankAccount Interface to check whether the payee bank information has been added. If the payee bank information has not been added, call the addBankAccount Interface to add the payee bank information. If the completed payee bank information has been added, the next transaction operation can be performed.

Special Note: If the user does not complete the account opening, initiates the transaction operation, and exceeds the valid time of the order, and does not receive the account opening completion notice, the order will be closed overtime and the funds will be returned in the same way.

It is recommended to make sure that the user account opening has been processed before initiating the transaction.

Create Order

The merchant's background requests the API interface of createTransaction, passing in parameters such as the merchant's order number, order amount, currency, and other required fields (for details, please see the following parameter description), create EPAY temporarily pays for orders.

Note: The order status at this time is frozen (status=9).

Within 10 minutes, the merchant can call the API interface to cancel the order cancelTransaction, close the order status (status=5), or call the confirmation transaction confirmTransaction API interface to create a formal order (status=1).

If the transaction operation is not completed for more than 10 minutes, the system will close the order status (status=5).

Sample Code

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"sign\": \"\",\n    \"param\": {\n        \"epayAccount\": \"test2020@epay.com\",\n        \"category\": \"BANK\",\n        \"notifyUrl\": \"\",\n        \"merchantOrderNo\": \"202201019002\",\n        \"amount\": \"100\",\n        \"receiveAmount\": \"\",\n        \"settlementCurrency\": \"USD\",\n        \"receiveCurrency\": \"CNY\",\n        \"version\": \"V2.0.0\",\n        \"transactionType\": \"C2C\",\n        \"senderInfo\": {\n            \"surName\": \"Joe\",\n            \"givName\": \"Chang\",\n            \"idNumber\": \"A199267867\",\n            \"idType\": \"1\",\n            \"birthday\": \"1986-09-11\",\n            \"country\": \"TW\",\n            \"nationality\": \"TW\",\n            \"address\": \"shenzhen\",\n            \"purposeOfRemittance\":\"20\" \n        },\n        \"receiverInfo\": {\n            \"surName\": \"lu\",\n            \"givName\": \"hui\",\n            \"country\": \"CN\",\n            \"phone\":\"153666100\",\n            \"locationId\": \"3460\",\n            \"bankName\": \"AliPay\",\n            \"email\":\"\",\n            \"area\": \"236\"\n       \n        }\n    }\n}");
Request request = new Request.Builder()
  .url("http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/createTransaction")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();

java

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"sign\": \"\",\n    \"param\": {\n        \"epayAccount\": \"test2020@epay.com\",\n        \"category\": \"BANK\",\n        \"notifyUrl\": \"\",\n        \"merchantOrderNo\": \"202201019002\",\n        \"amount\": \"100\",\n        \"receiveAmount\": \"\",\n        \"settlementCurrency\": \"USD\",\n        \"receiveCurrency\": \"CNY\",\n        \"version\": \"V2.0.0\",\n        \"transactionType\": \"C2C\",\n        \"senderInfo\": {\n            \"surName\": \"Joe\",\n            \"givName\": \"Chang\",\n            \"idNumber\": \"A199267867\",\n            \"idType\": \"1\",\n            \"birthday\": \"1986-09-11\",\n            \"country\": \"TW\",\n            \"nationality\": \"TW\",\n            \"address\": \"shenzhen\",\n            \"purposeOfRemittance\":\"20\" \n        },\n        \"receiverInfo\": {\n            \"surName\": \"lu\",\n            \"givName\": \"hui\",\n            \"country\": \"CN\",\n            \"phone\":\"153666100\",\n            \"locationId\": \"3460\",\n            \"bankName\": \"AliPay\",\n            \"email\":\"\",\n            \"area\": \"236\"\n       \n        }\n    }\n}");
Request request = new Request.Builder()
  .url("http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/createTransaction")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();

python

import requests
import json

url = "http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/createTransaction"

payload = json.dumps({
  "sign": "",
  "param": {
    "epayAccount": "test2020@epay.com",
    "category": "BANK",
    "notifyUrl": "",
    "merchantOrderNo": "202201019002",
    "amount": "100",
    "receiveAmount": "",
    "settlementCurrency": "USD",
    "receiveCurrency": "CNY",
    "version": "V2.0.0",
    "transactionType": "C2C",
    "senderInfo": {
      "surName": "Joe",
      "givName": "Chang",
      "idNumber": "A199267867",
      "idType": "1",
      "birthday": "1986-09-11",
      "country": "TW",
      "nationality": "TW",
      "address": "shenzhen",
      "purposeOfRemittance": "20"
    },
    "receiverInfo": {
      "surName": "lu",
      "givName": "hui",
      "country": "CN",
      "phone": "153666100",
      "locationId": "3460",
      "bankName": "AliPay",
      "email": "",
      "area": "236"
    }
  }
})
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

go

package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/createTransaction"
  method := "POST"

  payload := strings.NewReader(`{
    "sign": "",
    "param": {
        "epayAccount": "test2020@epay.com",
        "category": "BANK",
        "notifyUrl": "",
        "merchantOrderNo": "202201019002",
        "amount": "100",
        "receiveAmount": "",
        "settlementCurrency": "USD",
        "receiveCurrency": "CNY",
        "version": "V2.0.0",
        "transactionType": "C2C",
        "senderInfo": {
            "surName": "Joe",
            "givName": "Chang",
            "idNumber": "A199267867",
            "idType": "1",
            "birthday": "1986-09-11",
            "country": "TW",
            "nationality": "TW",
            "address": "shenzhen",
            "purposeOfRemittance":"20" 
        },
        "receiverInfo": {
            "surName": "lu",
            "givName": "hui",
            "country": "CN",
            "phone":"153666100",
            "locationId": "3460",
            "bankName": "AliPay",
            "email":"",
            "area": "236"

        }
    }
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

shell

printf '{
    "sign": "",
    "param": {
        "epayAccount": "test2020@epay.com",
        "category": "BANK",
        "notifyUrl": "",
        "merchantOrderNo": "202201019002",
        "amount": "100",
        "receiveAmount": "",
        "settlementCurrency": "USD",
        "receiveCurrency": "CNY",
        "version": "V2.0.0",
        "transactionType": "C2C",
        "senderInfo": {
            "surName": "Joe",
            "givName": "Chang",
            "idNumber": "A199267867",
            "idType": "1",
            "birthday": "1986-09-11",
            "country": "TW",
            "nationality": "TW",
            "address": "shenzhen",
            "purposeOfRemittance":"20" 
        },
        "receiverInfo": {
            "surName": "lu",
            "givName": "hui",
            "country": "CN",
            "phone":"153666100",
            "locationId": "3460",
            "bankName": "AliPay",
            "email":"",
            "area": "236"

        }
    }
}'| http  --follow --timeout 3600 POST 'http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/createTransaction' \
 Content-Type:'application/json'

Request Parameter

Name Desc
epayAccount Merchant EPAY account
merchantOrderNo Merchant order number
version Version number, the current version number is v2.0.0, compatible with version v1.0.0
category Remittance method: bank, cash
notifyUrl Callback address, used to receive order results from EPAY background notification: success or failure
amount Order amount
settlementCurrency Settlement currency, in most cases USD is passed in
receiveAmount Receive amount
receiveCurrency Receive currency
transactionType Transaction model (C2C, B2C, B2B, C2B)
extendFields extra fields
senderInfo Payer information, JSON format, specific input fields, fill in after obtaining according to Query Interface
Note: Required when transactionType is C2C, C2B
receiverInfo Payee information, JSON format, specific input fields, fill in after obtaining according to Query Interface
Note: Required when transactionType is C2C, B2C
senderBusiness Payment company information, JSON format, specific input fields, fill in after obtaining according to Query Interface
Note: Required when transactionType is B2C, B2B
receiverBusiness Recipient company information, JSON format, specific input fields, obtain and fill in according to Query Interface
Note: Required when transactionType is C2B, B2B

The above is the description of business parameters. For parameter encapsulation structure and sign signature, please see Development Guidelines>Guide>API Rules>API Specification and Development Guidelines>API SIGN.

Query Transaction

Merchants can call queryTransaction (transaction query interface) to query the payment status of the corresponding order through the merchant's order number.

Sample Code

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"param\": {\n    \"epayAccount\": \"test2020@epay.com\",\n    \"version\": \"V2.0.0\",\n    \"merchantOrderNo\": \"20210708220\"\n  },\n  \"sign\": \"\"\n}");
Request request = new Request.Builder()
  .url("http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/queryTransaction")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();

java

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"param\": {\n    \"epayAccount\": \"test2020@epay.com\",\n    \"version\": \"V2.0.0\",\n    \"merchantOrderNo\": \"20210708220\"\n  },\n  \"sign\": \"\"\n}");
Request request = new Request.Builder()
  .url("http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/queryTransaction")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();

python

import requests
import json

url = "http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/queryTransaction"

payload = json.dumps({
  "param": {
    "epayAccount": "test2020@epay.com",
    "version": "V2.0.0",
    "merchantOrderNo": "20210708220"
  },
  "sign": ""
})
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

go

package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/queryTransaction"
  method := "POST"

  payload := strings.NewReader(`{
  "param": {
    "epayAccount": "test2020@epay.com",
    "version": "V2.0.0",
    "merchantOrderNo": "20210708220"
  },
  "sign": ""
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

shell

printf '{
  "param": {
    "epayAccount": "test2020@epay.com",
    "version": "V2.0.0",
    "merchantOrderNo": "20210708220"
  },
  "sign": ""
}'| http  --follow --timeout 3600 POST 'http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/queryTransaction' \
 Content-Type:'application/json'

Request Parameter

Parameter Name Parameter Desc
epayAccount Merchant EPAY account
merchantOrderNo Merchant order no
version Version number, the current version number is v2.0.0, compatible version v1.0.0

The above is a description of business parameters. For parameter encapsulation structure and sign signature, please see Development Guidelines>Guide>API Rules>API Specification and Development Guidelines>API SIGN.

Asynchronous Notification

EPAY notifies the payment result as a parameter to notifyUrl (the address set when creating the order) through POST request(You can also set the request method of the callback through the successUrlMethod or failUrlMethod field passed in when creating the order). After receiving the asynchronous notification, the merchant can perform security verification on the sign signature value and determine that the source of the message is EPAY before checking its own business. Do logical processing. For specific sign signing methods, please see Development Guidelines>API SIGN.

For asynchronous notification examples, please view Development Guidelines>Callback>Callback Examples

Order Status Chart

image

API List

Name Desc Operation
queryBankAccount Check bank account View documentation
addBankAccount Add bank account View documentation
getRequiredField Get required fields View documentation
getBankList Get bank list View documentation
getCatalogue Get additional information View documentation
createTransaction Create order View documentation
confirmTransaction Confirm order View documentation
cancelTransaction Cancel order View documentation
queryTransaction Query transaction View documentation

results matching ""

    No results matching ""