Overview
Electronic wallet payment means that merchants can withdraw specified local currencies on EPAY to the user's electronic wallet account
Payment Process
Merchants can refer to the following flow chart to complete payment docking.
Flow Description
- The user visits the merchant page to initiate a quick payout's (cash withdrawal) transaction application.
- The merchant background service calls the getLimit interface to the EPAY gateway background service to obtain the transaction limit.
- EPAY Gateway Back Office Service Responses to Obtain Transaction Limits.
- EPAY Gateway Background Service Calls Third Party Bank to Complete Payment Transaction.
- The third-party bank AcquireerBank the callback result to the EPAY gateway background service.
- 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;
- The EPAY gateway background service sends the callback result to the merchant background service to notify the transaction order has been completed.
- The merchant background service can choose to call the queryTransaction interface for information confirmation.
- EPAY gateway background service response queryTransaction interface data.
- The merchant back-office service updates the transaction data and completes the order status.
- The merchant back-office service informs the user of the order completion status.
Create Order
The merchant's backend requests the API interface of createEwalletTransaction, passes in parameters such as the merchant's order number, order amount, currency and payment account number (for details, please see the following parameter description), and creates an EPAY proxy. Pay the order.
Note: At this time, the order status is processing (status=1), 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\t\"sign\": \"\",\n\t\"param\": {\n\t\t\"epayAccount\": \"test2020@epay.com\",\n\t\t\"category\": \"EWALLET\",\n \"channelCode\":\"11\",\n\t\t\"notifyUrl\": \"http://localhost/paymentApi/channel/send.do\",\n\t\t\"merchantOrderNo\": \"0702001122\",\n\t\t\"amount\": \"0.01\",\n\t\t\"currency\": \"USD\",\n\t\t\"version\": \"V2.0.0\",\n\t\t\"receiverInfo\": {\n\t\t\t\"accountNo\": \"41111810111111111111\",\n\t\t\t\"remark\": \"remark\"\n\t\t}\n\t}\n}");
Request request = new Request.Builder()
.url("http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/createEwalletTransaction")
.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\t\"sign\": \"\",\n\t\"param\": {\n\t\t\"epayAccount\": \"test2020@epay.com\",\n\t\t\"category\": \"EWALLET\",\n \"channelCode\":\"11\",\n\t\t\"notifyUrl\": \"http://localhost/paymentApi/channel/send.do\",\n\t\t\"merchantOrderNo\": \"0702001122\",\n\t\t\"amount\": \"0.01\",\n\t\t\"currency\": \"USD\",\n\t\t\"version\": \"V2.0.0\",\n\t\t\"receiverInfo\": {\n\t\t\t\"accountNo\": \"41111810111111111111\",\n\t\t\t\"remark\": \"remark\"\n\t\t}\n\t}\n}");
Request request = new Request.Builder()
.url("http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/createEwalletTransaction")
.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/createEwalletTransaction"
payload = json.dumps({
"sign": "",
"param": {
"epayAccount": "test2020@epay.com",
"category": "EWALLET",
"channelCode": "11",
"notifyUrl": "http://localhost/paymentApi/channel/send.do",
"merchantOrderNo": "0702001122",
"amount": "0.01",
"currency": "USD",
"version": "V2.0.0",
"receiverInfo": {
"accountNo": "41111810111111111111",
"remark": "remark"
}
}
})
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/createEwalletTransaction"
method := "POST"
payload := strings.NewReader(`{
"sign": "",
"param": {
"epayAccount": "test2020@epay.com",
"category": "EWALLET",
"channelCode":"11",
"notifyUrl": "http://localhost/paymentApi/channel/send.do",
"merchantOrderNo": "0702001122",
"amount": "0.01",
"currency": "USD",
"version": "V2.0.0",
"receiverInfo": {
"accountNo": "41111810111111111111",
"remark": "remark"
}
}
}`)
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": "EWALLET",
"channelCode":"11",
"notifyUrl": "http://localhost/paymentApi/channel/send.do",
"merchantOrderNo": "0702001122",
"amount": "0.01",
"currency": "USD",
"version": "V2.0.0",
"receiverInfo": {
"accountNo": "41111810111111111111",
"remark": "remark"
}
}
}'| http --follow --timeout 3600 POST 'http://29597375fx.epaydev.xyz/capi/openapi/payoutApi/createEwalletTransaction' \
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 |
category | EWALLET |
notifyUrl | Callback address, used to receive order results from epay background notification: success or failure |
amount | Order amount |
currency | Currency, such as: usd |
channelCode | Channel number, such as 11: Perfect Money, 12: Advcash, 16: Payeer, 18: FasaPay |
extendFields | merchant extension field, json format required |
receiverInfo | Payment information requires a fixed JSON format, such: {"accountNo":"41111810111111111111", // bank card number "remark":"Payment Instructions" // Remarks} |
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 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 |
---|---|---|
createEwalletTransaction | Create Order | View documentation |
queryTransaction | Query Transaction | View documentation |