Cashier Payin Docking
Cashier payin, also called super gateway collection, means that during the transaction process, EPAY provides a standard payment page. You will complete the payment on EPAY's payment page without writing any code for the payment interaction page.
Payment Process
The merchant backend requests the API interface of gateway/sendTransaction, passes in the merchant order number, order amount, currency and other parameters, generates the epayUrl payment address, and the front end jumps to the EPAY cashier page. The user selects the payment method and completes the payment operation.
Flow Description
- The user visits the merchant page to initiate a super gateway payin's (recharge) transaction.
- The merchant backend service encapsulation request parameter sends the call gateway/sendTransaction transaction interface to the EPAY super gateway backend service.
- The EPAY Super Gateway backend service receives the request, creates a transaction order, and starts processing. At this time, the order status is in process (status = 0).
- After the EPAY Super Gateway backend service creates a transaction order, it returns the epayUrl payment address to the merchant backend service.
- After receiving the epayUrl payment address, the merchant back-office service redirects to the epay_webUI_frontend cash register page.
- The user selects the payment method on the EPAY cash register page to complete the payment. Here, users can choose to pay anonymously or by real name (login to EPAY account).
- The EPAY cash register page sends the payment information request parameters to the EPAY super gateway background service.
- EPAY super gateway background service processing result, update order status is successful (status = 7).
- The EPAY Super Gateway backend service sends the callback result to the merchant backend service to notify the transaction order has been completed.
- The merchant background service can choose to call the queryTransaction interface for information confirmation.
- EPAY Super 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 notify the user of the order completion status.
Create Order
The merchant's backend requests the API interface of gateway/sendTransaction, passes in the merchant's order number, order amount, currency and other parameters (for details, please see the following parameter description), and creates an EPAY gateway 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 \"sign\": \"\",\n \"param\": {\n \"epayAccount\": \"test2020@epay.com\",\n \"merchantName\": \"ali BANK\",\n \"amount\": \"10\",\n \"currency\": \"EUR\",\n \"merchantOrderNo\": \"A092201\",\n \"notifyUrl\": \"http://localhost/paymentApi/channel/send.do\",\n \"successUrl\": \"http://localhost/paymentApi/channel/send.do\",\n \"failUrl\": \"http://localhost/paymentApi/channel/send.do\",\n \"remark\": \"remark\",\n \"senderEpayAccount\": \"\",\n \"language\": \"CN\",\n \"version\": \"V2.0.0\",\n \"extendFields\": {\n \"test\": \"test\"\n }\n }\n}");
Request request = new Request.Builder()
.url("http://29597375fx.epaydev.xyz/capi/openapi/gateway/sendTransaction")
.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 \"merchantName\": \"ali BANK\",\n \"amount\": \"10\",\n \"currency\": \"EUR\",\n \"merchantOrderNo\": \"A092201\",\n \"notifyUrl\": \"http://localhost/paymentApi/channel/send.do\",\n \"successUrl\": \"http://localhost/paymentApi/channel/send.do\",\n \"failUrl\": \"http://localhost/paymentApi/channel/send.do\",\n \"remark\": \"remark\",\n \"senderEpayAccount\": \"\",\n \"language\": \"CN\",\n \"version\": \"V2.0.0\",\n \"extendFields\": {\n \"test\": \"test\"\n }\n }\n}");
Request request = new Request.Builder()
.url("http://29597375fx.epaydev.xyz/capi/openapi/gateway/sendTransaction")
.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/gateway/sendTransaction"
payload = json.dumps({
"sign": "",
"param": {
"epayAccount": "test2020@epay.com",
"merchantName": "ali BANK",
"amount": "10",
"currency": "EUR",
"merchantOrderNo": "A092201",
"notifyUrl": "http://localhost/paymentApi/channel/send.do",
"successUrl": "http://localhost/paymentApi/channel/send.do",
"failUrl": "http://localhost/paymentApi/channel/send.do",
"remark": "remark",
"senderEpayAccount": "",
"language": "CN",
"version": "V2.0.0",
"extendFields": {
"test": "test"
}
}
})
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/gateway/sendTransaction"
method := "POST"
payload := strings.NewReader(`{
"sign": "",
"param": {
"epayAccount": "test2020@epay.com",
"merchantName": "ali BANK",
"amount": "10",
"currency": "EUR",
"merchantOrderNo": "A092201",
"notifyUrl": "http://localhost/paymentApi/channel/send.do",
"successUrl": "http://localhost/paymentApi/channel/send.do",
"failUrl": "http://localhost/paymentApi/channel/send.do",
"remark": "remark",
"senderEpayAccount": "",
"language": "CN",
"version": "V2.0.0",
"extendFields": {
"test": "test"
}
}
}`)
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",
"merchantName": "ali BANK",
"amount": "10",
"currency": "EUR",
"merchantOrderNo": "A092201",
"notifyUrl": "http://localhost/paymentApi/channel/send.do",
"successUrl": "http://localhost/paymentApi/channel/send.do",
"failUrl": "http://localhost/paymentApi/channel/send.do",
"remark": "remark",
"senderEpayAccount": "",
"language": "CN",
"version": "V2.0.0",
"extendFields": {
"test": "test"
}
}
}'| http --follow --timeout 3600 POST 'http://29597375fx.epaydev.xyz/capi/openapi/gateway/sendTransaction' \
Content-Type:'application/json'
Request Parameter
Parameter Name | Desc |
---|---|
epayAccount | Merchant EPAY account |
merchantName | Merchant name |
merchantOrderNo | The merchant order number must be unique in the merchant system and the maximum length cannot exceed 50 characters. |
amount | Order amount, required decimal places:2 |
currency | Order currency |
notifyUrl | Callback address, used to receive order results from epay background notification: success or failure |
successUrl | Successful jump page, used to return to the merchant's successful order page |
failUrl | Failure jump page, used to return to the merchant's failed order page |
remark | order remarks, the maximum length cannot exceed 200 characters |
senderEpayAccount | mandatory payment account number |
language | language is en or cn |
version | Version number, the current version number is V2.0.0, compatible with version V1.0.0 |
extendFields | merchant extension field, json format required |
paymentCurrency | payment currency |
paymentCountry | payment country/region |
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 .
In addition: payment currency and payment country are entered into the parameter fields, and the merchant directly displays the available payment channels when the internal system jumps to the EPAY checkout.
It is recommended that merchants pass in this parameter to optimize the interactive experience. For more detailed instructions, please view API interface description.
Confirm Order
he merchant generates the EPAY url payment address, and the front end jumps to the EPAY cashier page. The user selects the payment method and completes the payment operation.
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\": \"b48916e1-91fb-4ff9-9002-17e8431a5a15\"\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\": \"b48916e1-91fb-4ff9-9002-17e8431a5a15\"\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": "b48916e1-91fb-4ff9-9002-17e8431a5a15"
},
"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": "b48916e1-91fb-4ff9-9002-17e8431a5a15"
},
"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": "b48916e1-91fb-4ff9-9002-17e8431a5a15"
},
"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 |
---|---|---|
gateway/sendTransaction | Create transaction | View documentation |
queryTransaction | Query transaction | View documentation |