Overview
EPAY mutual transfer means that merchants transfer funds from the balance of an EPAY account to the balance of another EPAY account through the interface;
Payment Process
Merchants can refer to the following flow chart to complete payment docking.
Flow Description
- EPAY user A initiates a transfer request to EAPY user B.
- Your backend service calls the transfer transaction createEpayTransaction interface to the EPAY gateway backend service to create a transaction.
- The EPAY gateway background service processes the order and the order is successful (status=7).
- The EPAY gateway backend service sends the callback result to your backend service to notify that the transaction order has been completed.
- Your background service can choose to call queryTransaction interface for information confirmation.
- The EPAY gateway background service responds to the query transaction interface data.
- Your backend service updates transaction data and completes order status.
- Your backend service notifies users of order completion status.
Create Order
The merchant's backend requests the API interface of createEpayTransaction, and passes in parameters such as the merchant's order number, order amount, currency, and the other party's EPAY account (for details, please see the following parameter description), and creates an EPAY representative. Pay the order.
Note: At this time, the order status is successful (status=7), and the order details can be viewed through the query transaction interface queryTransaction.
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 \"merchantName\": \"merchantName\",\n \"notifyUrl\": \"http://localhost/paymentApi/channel/send.do\",\n \"merchantOrderNo\": \"2021041409022211\",\n \"receiveEpayAccount\": \"11@qq.com\",\n \"amount\": \"10\",\n \"currency\": \"USD\",\n \"extendFields\": {\n \"test\": \"test\"\n }\n },\n \"sign\": \"\"\n}");
Request request = new Request.Builder()
.url("http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/createEpayTransaction")
.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 \"merchantName\": \"merchantName\",\n \"notifyUrl\": \"http://localhost/paymentApi/channel/send.do\",\n \"merchantOrderNo\": \"2021041409022211\",\n \"receiveEpayAccount\": \"11@qq.com\",\n \"amount\": \"10\",\n \"currency\": \"USD\",\n \"extendFields\": {\n \"test\": \"test\"\n }\n },\n \"sign\": \"\"\n}");
Request request = new Request.Builder()
.url("http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/createEpayTransaction")
.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/createEpayTransaction"
payload = json.dumps({
"param": {
"epayAccount": "test2020@epay.com",
"version": "V2.0.0",
"merchantName": "merchantName",
"notifyUrl": "http://localhost/paymentApi/channel/send.do",
"merchantOrderNo": "2021041409022211",
"receiveEpayAccount": "11@qq.com",
"amount": "10",
"currency": "USD",
"extendFields": {
"test": "test"
}
},
"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/createEpayTransaction"
method := "POST"
payload := strings.NewReader(`{
"param": {
"epayAccount": "test2020@epay.com",
"version": "V2.0.0",
"merchantName": "merchantName",
"notifyUrl": "http://localhost/paymentApi/channel/send.do",
"merchantOrderNo": "2021041409022211",
"receiveEpayAccount": "11@qq.com",
"amount": "10",
"currency": "USD",
"extendFields": {
"test": "test"
}
},
"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",
"merchantName": "merchantName",
"notifyUrl": "http://localhost/paymentApi/channel/send.do",
"merchantOrderNo": "2021041409022211",
"receiveEpayAccount": "11@qq.com",
"amount": "10",
"currency": "USD",
"extendFields": {
"test": "test"
}
},
"sign": ""
}'| http --follow --timeout 3600 POST 'http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/createEpayTransaction' \
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 |
merchantName | Merchant name |
amount | Order amount |
currency | Currency, one of USD, EUR, HKD, GBP, JPY is required |
notifyUrl | Callback address, used to receive order results from EPAY background notification: success or failure |
receiveEpayAccount | The receiving EPAY account of the transfer party |
remark | remarks |
extendFields | merchant extension field, json format required |
The above is the description of business parameters. For parameter encapsulation structure and sign signature, please see Development Guidelines>Callback>Callback Examples>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 number |
version | Version number, the current version number is v2.0.0, compatible version v1.0.0 |
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.
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
API List
Name | Desc | Operation |
---|---|---|
createEpayTransaction | Create order | View documentation |
queryTransaction | Query transaction | View documentation |