Developer

  • 接入指南(接入前请浏览以下内容)

1、参数中红色为必填参数黄色为条件选填参数

2、token参数在head中,登录控制台在商户管理中查看;

3、merchatCode、APPID登录控制台在应用管理中查看;

3、找管理员设置通知地址,此通知地址主要用于Ethoca退款通知;交易通知通过交易参数中的notify参数进行;

4、目前所有的交易US、CA大部分会走no 3ds,其他国家均为全3D交易,特殊MCC的NO 3D交易会单独通知;

  • 支持的卡种

VisaVisa
MasterCardMasterCard
  • 卡支持的交易币种

美元USD
欧元EUR
英鎊GBP
日元JPY
澳元AUD
加拿大元CAD
新加坡元SGD
  • 请求地址

环境请求方式地址
测试环境POSThttp://212.64.29.191:9001/gateway
生产环境POSThttps://gateway.risingsunpay.com/gateway
  • Test Card

4111111111111111no 3d
52000000000010963d
40000000000010003d 2.1 无摩擦
52000000000022353d 2.2 无摩擦
40000000000025033d 2.2 挑战Visa
52000000000010963d 2.1 挑战MasterCard
  • 错误码

200SUCCESS
201PENDING
100FAIL
101CANCEL
102TIMEOUT
300PARAMTER_ERROR
500HIGH_RTISK(基于风控和验卡的结果为高风险,您可以自行处置后续)
800BANK_ERROR
309SYSTEM_ERROR
  • 交易状态(status)

INIT, PENDING, REDIRECT(中间态)
SUCCESS, FAIL, TIMEOUT(终态)

  • 获取设备信息代码示例

httpAcceptBrowserValue: navigator.userAgent,
httpAcceptContent: document.querySelector(‘meta[http-equiv=”Content-Type”]’)?.getAttribute(‘content’) || “text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7”,
browserJavaEnabled: navigator.javaEnabled() ? “true” : “false”,
browserJavascriptEnabled: “true”, // JavaScript is enabled if this script runs
browserUserAgent: navigator.userAgent,
language: navigator.language || navigator.userLanguage,
screenColorDepth: screen.colorDepth.toString(),
screenHeight: screen.height.toString(),
screenWidth: screen.width.toString(),
timezone: new Date().getTimezoneOffset() / 60

RisingPay WP插件使用教程20240727

 

RisingPay WooCommerce支付插件请找客户经理索取

URL : /checkout
POST
Headers
token => ‘eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI2MDAwMDQiLCJleHAiOjE3MDkzMzU3MjR9.VyHRvs5j4UW2SmBIr7nPzmGouvutAdP7XUoKADUjlVU’
 

Request

{
    “merchatCode“: “600001”,
    “appid“: “futures”,
    “requestId“: {{mer_order_id}},
    “paymentMethod“: “CardPlain”,
    “transactionType“: “Sale”,
    “amount“: “10.00”,
    “currency“: “USD”,
    “descriptor“: “buy iphone”,
    “cancelUrl“: “http://7df22twnmmim.ngrok.xiaomiqiu123.top/notify/mockReturn”,
    “successUrl“: “http://7df22twnmmim.ngrok.xiaomiqiu123.top/notify/mockReturn”,
    “failUrl“: “http://7df22twnmmim.ngrok.xiaomiqiu123.top/notify/mockReturn”,
    “notificationUrl“: “http://7df22twnmmim.ngrok.xiaomiqiu123.top/notify/mockNotify”,
   
    “billingFirstname“: “Timmy”,
    “billingLastname“: “Yang”,
    “billingPhone“: “+86111111111111”,
    “billingEmail“: “[email protected]”,
    “billingCountrycode“: “CA”,(参考ISO标准编码,见附录)
    “billingState“: “ON”,(参考ISO标准编码,见附录)
    “billingCity“: “Toronto”,
    “billingStreet“: “160-500 University”,
    “billingStreet2”: “”,
    “billingPostcode“: “M5G 1V7”,
 
   (shipping不填写默认取billing信息)
    “shippingFirstname“: “Timmy”,
    “shippingLastname“: “Yang”,
    “shippingPhone“: “+8618672361111”,
    “shippingCountrycode“: “CA”,
    “shippingState“: “ON”,
    “shippingCity“: “Toronto”,
    “shippingStreet“: “160-500 University”,
    “shippingStreet2“: “”,
    “shippingPostcode“: “M5G 1V7”,
 
    “ip“: “ip”,
    “referer“: “https://fanyi.youdao.com/”,
 
    “productsCode”: “4098755”,
    “productsName”: “High-Collar Boxy Camel Hair Blend Sweater”,
    “productsDesc”: “MUMUXI LED Fairy Lights Battery Operated String Lights [12 Pack] 7.2ft 20 Battery Powered LED Lights”,
    “productsSku”: “4098755 Mini Lights”,
    “productsQuantity”: “1”,
    “productsUnitprice”: 1088.88,
    “productsTotalamount”: 1088.88
}

Response

{
    “msg”: “SUCCESS”,
    “code”: “200”, (code 200为成功,其他均为失败,具体失败原因看msg)
    “data”: {
        “merchatCode”: “600001”,
        “appId”: “futures”,
        “orderId”: “20240701131452”,(RisingPay的交易ID,后续对交易处理都是使用此ID)
        “requestId”: “20240701131452201”,
        “amount”: 10.00,
        “currency”: “USD”,
        “transactionType”: “Sale”,
        “paymentMethod”: “CardPlain”,
        “status”: “REDIRECT“,  (REDIRECT时条件到actionUrl进行下一步操作
        “actionUrl”: “https://uat.risingsunpay.com/#/payment/checkout?transactionId=1020240701000013&mac=57f328a3574e067ad62b11643f7daab9”,
        “startTime”: “2024-07-01T13:14:52.512+08:00”
    }
}
 
// 使用嵌入式收银台,请监听以下callback处理交易结果
addEventListener('message', e => {
if (e.data === "onError") {
// do error
alert('fail');
}
if (e.data === "onSuccess") {
// do success
alert('success');
}
});
URL : /payment
POST
Headers
token => ‘eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI2MDAwMDQiLCJleHAiOjE3MDkzMzU3MjR9.VyHRvs5j4UW2SmBIr7nPzmGouvutAdP7XUoKADUjlVU’
 

Request

{
    “merchatCode“: “600001”,
    “appid“: “futures”,
    “requestId“: {{mer_order_id}},(商户自定义的订单号
    “paymentMethod“: “CardPlain”,
    “transactionType“: “Sale”,(交易类型)
    “amount“: “399.00”,
    “currency“: “USD”,
    “descriptor“: “buy iphone”,
 
    “cardNumber“: “4041170077620700”,
    “expiryDate“: “1225”,
    “cvv“: “562”,
 
    “successUrl“: “http://7df22twnmmim.ngrok.xiaomiqiu123.top/notify/mockReturn”,
    “failUrl“: “http://7df22twnmmim.ngrok.xiaomiqiu123.top/notify/mockReturn”,
    “notificationUrl“: “http://7df22twnmmim.ngrok.xiaomiqiu123.top/notify/mockNotify”,
   
    “billingFirstname“: “Timmy”,
    “billingLastname“: “Yang”,
    “billingPhone“: “+86111111111111”,
    “billingEmail“: “[email protected]”,
    “billingCountrycode“: “CA”,(参考ISO标准编码,见附录)
    “billingState“: “ON”,(美国/加拿大必填 参考ISO标准编码,见附录)
    “billingCity“: “Toronto”,
    “billingStreet“: “160-500 University”,
    “billingStreet2”: “”,
    “billingPostcode“: “M5G 1V7”,
 
   (shipping不填写默认取billing信息)
    “shippingFirstname“: “Timmy”,
    “shippingLastname“: “Yang”,
    “shippingPhone“: “+8618672361111”,
    “shippingCountrycode“: “CA”,
    “shippingState“: “ON”,
    “shippingCity“: “Toronto”,
    “shippingStreet“: “160-500 University”,
    “shippingStreet2“: “”,
    “shippingPostcode“: “M5G 1V7”,
 
    (以下为设备信息,直连时尽可能量填写,可以增加无摩擦3d的触发概率,增加支付体验和成功率)
     “ip“: “ip”,
    “referer“: “https://fanyi.youdao.com/”,
     “httpAcceptBrowserValue“: “httpAcceptBrowserValue”,
    “httpAcceptContent“: “text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7”,
    “browserJavaEnabled“: “false”,
    “browserJavascriptEnabled“: “true”,
    “browserUserAgent“: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0”,
    “deviceId”: “”,
    “language“: “zh-CN”,
    “screenColorDepth“: “”,
    “screenHeight“: “1440”,
    “screenWidth“: “2560”,
    “timezone“: “+8”,
    “challengeWindow“: “05”,
 
    “productsCode”: “4098755”,
    “productsName”: “High-Collar Boxy Camel Hair Blend Sweater”,
    “productsDesc”: “MUMUXI LED Fairy Lights Battery Operated String Lights [12 Pack] 7.2ft 20 Battery Powered LED Lights”,
    “productsSku”: “4098755 Mini Lights”,
    “productsQuantity”: “1”,
    “productsUnitprice”: 1088.88,
    “productsTotalamount”: 1088.88
}

Response

{
    “msg”: “SUCCESS”,
    “code”: “200”,
    “data”: {
        “merchatCode”: “600001”,
        “appId”: “futures”,
        “orderId”: “20240701131823”,
        “requestId”: “20240701131823156”,
        “amount”: 399.00,
        “currency”: “USD”,
        “transactionType”: “Sale”,
        “paymentMethod”: “CardPlain”,
        “status”: “REDIRECT”,
        “actionUrl”: “https://uat.risingsunpay.com/api/direct?transactionId=1020240701000015&mac=624bddc830abd9d095c77009305db1eb”,
        “startTime”: “2024-07-01T13:18:23.172+08:00”
    }
}
URL : /refund
POST
Headers
token => ‘eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI2MDAwMDQiLCJleHAiOjE3MDkzMzU3MjR9.VyHRvs5j4UW2SmBIr7nPzmGouvutAdP7XUoKADUjlVU’
 

Request

{
    “merchatCode“: “600001”,
    “appid“: “futures”,
    “requestId“: {{mer_order_id}},
    “transactionType“: “Refund”,
    “amount“: “10”,
    “currency“: “USD”,
    “originalOrderId“: “20240626171710”,
    “notificationUrl“: “http://7df22twnmmim.ngrok.xiaomiqiu123.top/notify/mockNotify”(不填写默认为webhook url)
}
 

Response

{
    “msg”: “SUCCESS”,
    “code”: “200”,
    “data”: {
        “merchatCode”: “600001”,
        “appId”: “futures”,
        “orderId”: “20240701132222”,
        “requestId”: “20240701132222655”,
        “amount”: 10,
        “currency”: “USD”,
        “transactionType”: “Refund”,
        “paymentMethod”: “CardPlain”,
        “status”: “SUCCESS”,
        “startTime”: “2024-07-01T13:22:22.954+08:00”
    }
}

POST

Request

{
    “amount”: 399.00,
    “appId”: “baidu”,
    “authCode”: “831000”,
    “cardNumber”: “520000******1096”,
    “cardType”: “MASTERCARD”,
    “currency”: “USD”,
    “eci”: “02”,
    “endTime”: “2024-06-26 17:08:16”,
    “merchatCode”: “600001”,
    “orderId”: “20240626170021”,
    “paymentMethod”: “CardPlain”,
    “requestId”: “20240626170021850”,
    “resultCode”: “200”,
    “resultMsg”: “SUCCESS”,
    “risk”: “CYBS”,
    “startTime”: “2024-06-26 17:00:22”,
    “status”: “SUCCESS”,
    “threeds”: “YES”,
    “transactionType”: “Sale”
}

URL: /query?orderId=20240712111048

POST

Request

orderId(交易Response的orderId字段)

Response

{
    “msg”: “SUCCESS”,
    “code”: “200”,
    “data”: {
        “merchatCode”: “600001”,
        “appId”: “futures”,
        “orderId”: “20240712111048”,
        “requestId”: “20240712111048950”,
        “amount”: 10.00,
        “currency”: “USD”,
        “transactionType”: “Sale”,
        “paymentMethod”: “CardPlain”,
        “status”: “TIMEOUT”,
        “resultCode”: “102”,
        “resultMsg”: “TRANSACTION IS EXPIRED”,
        “startTime”: “2024-07-12T11:10:49.000+08:00”,
        “endTime”: “2024-07-14T15:06:47.000+08:00”
    }
}

URL: /trackNumber?orderId=20240816160001&postCode=SF1454829088889&postCompany=SFSY

POST

Request

orderId(交易Response的orderId字段)

postCode(物流单号)

postCompany(物流公司,请参考附录17Track物流公司代码)

 

Response http 200表示处理成功

  • 物流公司代码

国际包裹追踪服务 | 17TRACK

 

  • US&CA PostCode格式

When the company country is the U.S., the 9-digit postal code must follow this format:
[5 digits][dash][4 digits]
Example
12345-6789
When the company country is Canada, the 6-digit postal code must follow this format:
[alpha][numeric][alpha][space][numeric][alpha][numeric]
Example
A1B 2C3