Skip to main content
POST
/
api
/
mapi
/
v1
/
payments
/
open
/
api
/
pay
消费
curl --request POST \
  --url https://mpgwpre.payallglobal.com/mp-gateway/api/mapi/v1/payments/open/api/pay \
  --header 'Content-Type: application/json' \
  --header 'signature: <api-key>' \
  --data '
{
  "charset": "UTF-8",
  "version": "2.0.0",
  "transType": "PAY",
  "accessType": "s2s",
  "signType": "RSA",
  "merchantId": "2023010558663764",
  "transChannel": "ALIPAY_CN",
  "transAmt": "5.67",
  "currency": "USD",
  "merchantOrderId": "20230424141154",
  "merchantOrderTime": "2025-10-24T15:00:00.500+08:00",
  "goodsName": "商品名称,多个商品 用\";\"隔开",
  "carrierId": "测试",
  "deviceChannel": "PC/IOS/Android",
  "payMode": "H5",
  "merchantRegion": "HK",
  "transTimeout": 20,
  "redirectUrl": "https://dash.proxy302.com/charge",
  "notifyUrl": "https://dash-api.proxy302.com/api/webhook/chinagpay_alipay",
  "dcc": "dcc",
  "customerIp": "18.277.26.154",
  "goods": [
    {
      "referenceGoodsId": "M1006",
      "goodsName": "单品惠-6",
      "goodsCategory": "1001",
      "goodsQuantity": "100",
      "goodsUnitAmount": {
        "currency": "php",
        "value": "100.01"
      }
    }
  ],
  "goodsInfo": "商品信息描述",
  "subMerchantId": "2258484869050",
  "reqReserved": "reqReserved",
  "reserved": "reserved",
  "payMethodInfo": {
    "cardNo": "444433******1111",
    "expirationMonth": "01",
    "expirationYear": "2026",
    "cvv": "123",
    "firstName": "Bren",
    "lastName": "Qiu",
    "phone": "18817536699"
  },
  "shippingInfo": {
    "firstName": "James",
    "lastName": "Smith",
    "phoneNo": "903124360628",
    "email": "James@example.com",
    "address1": "GOLGELI SOKAK NO.34, 06700",
    "city": "GAZIOSMANPASA/ANKAR",
    "country": "TR",
    "state": "CA",
    "zipCode": "06700"
  },
  "billingInfo": {
    "firstName": "James",
    "lastName": "Smith",
    "phoneNo": "903124360628",
    "email": "James@example.com",
    "address1": "GOLGELI SOKAK NO.34, 06700",
    "city": "GAZIOSMANPASA/ANKAR",
    "country": "TR",
    "state": "CA",
    "zipCode": "06700"
  }
}
'
{
  "isSuccess": true,
  "errCode": "string",
  "errMessage": "string",
  "status": "string",
  "traceId": "string",
  "data": {
    "orderId": "string",
    "merchantNo": "string",
    "merchantOrderId": "string",
    "currency": "string",
    "payMethodResponse": {
      "isRedirect": "string",
      "redirectMethod": "string",
      "termUrl": "string",
      "redirectParam": {},
      "codeUrl": "string"
    },
    "transAmt": "string"
  }
}

Authorizations

signature
string
header
required

Example: MIIEpQIBAAKCAQEA...(Base64编码的签名字符串)

加签

加签是开放平台和商户对于交互消息完整性的校验。加签行为主要发生两个部分:

  1. 商户服务器端针对向PayAllGlobal开放平台发送的请求报文进行加签;
  2. PayAllGlobal开放平台针对通知商户的异步消息进行加签。 PayAllGlobal平台要求使用 RSA 私钥进行加签, 使用 RSA 公钥进行验签。 因此,在以上两部分描述的交互中, 存在商户公私钥、PayAllGlobal 公私钥,开发者需要使用商户私钥,对第一部分报文进行加签,使用 PayAllGlobal 公钥对第二部分消息进行验签。

加签规则如下:

使用商户私钥对请求体进行 SHA256withRSA 签名后,再进行 Base64 编码的结果。

  1. 使用 商户私钥对待 request.body 进行签名(SHA256WithRSA 计算原始数据的SHA-256哈希值。 使用私钥对哈希值进行签名,即使用私钥对哈希值进行RSA加密。此时得到的加密结果就是数字签名。);
Signature signature = Signature.getInstance("SHA256withRSA");
signature.initSign(privateKey);
// 计算 SHA256withRSA 签名时,需要以 utf-8 的编码转换 byte 流,否则可能导致含中文参数的签名计算不正确
signature.update(request.body);
byte[] signedHash = signature.sign();
  1. 将加签内容进行 Base64 编码;
String signature = Base64.getEncoder().encodeToString(signedHash);
  1. 将编码后的内容放在请求头部 signature 参数中。 注意,加签是对 request.body 进行签名,当查询等 request.body 为空时,则无需加签。

Body

application/json
charset
string
default:UTF-8
required

交互数据的编码【utf-8】

Example:

"UTF-8"

version
string
required

接口版本,当前版本为【2.0.0】,目前只能传2.0.0,不能不传

Example:

"2.0.0"

transType
enum<string>
default:PAY
required

交易类型

Available options:
PAY,
CREDIT_CARD,
3D_PREAUTH_VOIDS,
3D_PREAUTH_COMPLETION,
REFUND,
VOIDS,
QUERY,
TRANSFER,
DOWNLOAD,
REGISTRATION,
FILEUPLOAD,
INQUIRYREGISTRATIONSTATUS,
AUTHORIZE,
CASHIER_PAY,
CARD: 国际卡支付
accessType
string
default:s2s
required

接口访问类型

Example:

"s2s"

signType
string
required

报文签名类型

Example:

"RSA"

merchantId
string
required

商户号

Example:

"2023010558663764"

transChannel
enum<string>
required

支付渠道,详见支付渠道列表

Available options:
WEIXIN,
UNIONPAY,
ALIPAY_CN,
ALIPAY_HK,
GCASH,
BPI,
TNG,
BOOST,
DANA,
KAKAOPAY,
TRUEMONEY,
BRAZIL_PIX,
Ewallet_PicPay,
Khipu,
RABBIT_LINE_PAY,
ALIPAY_INSTORE,
NAVERPAY,
TOSSPAY,
MAYA,
BILLEASE,
GoPay,
OVO,
DOKU,
Dragonpay,
Konbini,
PayEasy,
GrabPay,
PAYCO,
MPAY,
PROMPT_PAY,
HIPAY,
TINABA,
KREDIVO_ID,
AKULAKU_PAYLATER,
KPLUS,
QRPH,
BANK_TRANSFER,
KOREAN_CARDS,
CARD: 国际卡支付
transTimeout
number
required

订单有效时长(整数格式 单位:分钟)

Example:

20

carrierId
string
required

发生交易的网站域名或者APP名称

Example:

"跨境"

currency
string
required

订单币种ISO4217币种的字母码 eg. USD, CNY, EUR

Example:

"USD"

transAmt
string
required

订单金额 请按照4217币种的最小单位传递 eg.(CNY) 110.86 (JPY) 1110

Example:

"20.01"

goodsName
string
required

商品名称,多个商品 用";"隔开

Example:

"Iphone15"

merchantOrderId
string
required

商户订单号

Example:

"20230424141154"

payMode
enum<string>
default:QRCODE
required

交易类型

Available options:
QRCODE,
MICROPAY,
JSAPI,
MINIPROGRAM,
APP,
H5,
3D,
FIXEDCODE,
API(国际卡API支付)
Example:

"QRCODE"

merchantOrderTime
string<date-time>
required

请求时间(ISO 8601 格式,带时区)

Example:

"2025-10-24T15:00:00.500+08:00"

merchantRegion
string
required

商户所在地区

Example:

"US"

deviceChannel
string

设备渠道

notifyUrl
string<uri>

异步通知地址

Required string length: 10 - 200
redirectUrl
string

前台回调地址

Example:

"http://www.gogole.com"

dcc
string

交易是否走DCC 传送:dcc

Example:

"dcc"

customerIp
string

用户ip。国际卡支付必传

Example:

"18.277.26.154,"

goods
object[]
goodsInfo
string

商品信息

Example:

"商品信息描述"

subMerchantId
string

商户子商户号

Example:

"20230424141154"

reqReserved
string

商户备注扩展字段

Example:

"备注扩展"

reserved
string

备注字段

Example:

"测试"

payMethodInfo
object

卡信息。国际卡支付必传

shippingInfo
object

邮寄信息。国际卡支付必传

billingInfo
object

信用卡账单信息。国际卡支付必传

Response

200 - application/json

OK

isSuccess
boolean
required

是否成功,true表示成功,false表示失败

Example:

true

errCode
string
required

响应状态码,errCode为00000000表示响应成功,其他状态码表示响应失败。具体系统错误码可以参考系统错误码。

Example:

"00000003"

errMessage
string
required

错误消息

Example:

"处理中"

status
string
required

订单状态(见补充说明)

Examples:

"PENDING:处理中"

"SUCCESS:成功"

"FAIL:失败"

traceId
string
required

请求消息唯一标识。traceId为本次调用产生的流水号,接口调用异常,可以提供此流水号用于排查问题。

Example:

"33fae7b7aed1233f"

data
object