Skip to content

关于 支付

访问范围

需要多个访问范围—请参阅每个端点以了解访问范围要求。

需要访问受保护的客户数据。

Genstore 支付业务域是核心业务模块,通过提供一系列的 RESTful 接口,管理支付信息,支持支付流程的下单、退款动作以及支付单查询等子域。

核心功能

  • 下单:根据订单创建支付单,通知到PSP进行扣款。
  • 退款:根据售后定,退款给客户。
  • 获取单个支付单:根据订单关联的支付单ID 检索支付单的详细信息。

应用场景

  • 支付通过扩展:开发者可以通过支付开发能力将三方支付服务商接入店铺,作为三方支付渠道扩展店铺支付能力。

接口

PUT /api/202412/app/account_authorize: 更新账号授权结果

PUT /api/202412/app/payment/{paymentId}: 更新支付结果

PUT /api/202412/app/capture/{captureId}: 更新捕获结果

PUT /api/202412/app/refund/{refundId}: 更新退款结果

PUT /api/202412/app/void/{voidId}: 更新取消捕获结果

PUT /api/202412/app/pre_authorize/{paymentId}: 更新预授权订单的授权结果

支付 对象

支付业务域对象

属性

purchaseInfoobjectrequired
+ 展开属性
amountstringrequired
clientDetailsobjectrequired
+ 展开属性
teststringrequired
manualCapturestringrequired
paymentIdstringrequired
paymentMethodobjectrequired
+ 展开属性
currencystringrequired
customerobjectrequired
+ 展开属性
bash
{
  "purchaseInfo": {
    "insurance": "",
    "itemTotal": "",
    "shipping": "",
    "taxTotal": "",
    "description": "",
    "discount": "",
    "handling": "",
    "shippingDiscount": "",
    "items": [
      {
        "unitPrice": "",
        "imgUrl": "",
        "quantity": "",
        "name": "",
        "description": "",
        "tax": "",
        "category": "",
        "sku": "",
        "virtualProduct": ""
      }
    ]
  },
  "amount": "",
  "clientDetails": {
    "acceptLanguage": "",
    "ipAddress": "",
    "userAgent": ""
  },
  "test": "",
  "manualCapture": "",
  "paymentId": "",
  "paymentMethod": {
    "data": {
      "cipherText": "",
      "salt": "",
      "ephemeralPublicKey": "",
      "suit": "",
      "returnUrl": "",
      "iv": ""
    }
  },
  "currency": "",
  "customer": {
    "phoneNumber": "",
    "shippingAddress": {
      "phoneNumber": "",
      "province": "",
      "city": "",
      "countryCode": "",
      "givenName": "",
      "familyName": "",
      "postalCode": "",
      "company": "",
      "line2": "",
      "line1": ""
    },
    "billingAddress": {
      "phoneNumber": "",
      "province": "",
      "city": "",
      "countryCode": "",
      "givenName": "",
      "familyName": "",
      "postalCode": "",
      "company": "",
      "line2": "",
      "line1": ""
    },
    "email": ""
  }
}

PUT 更新账号授权结果

返回账号的授权结果。

访问范围

需要以下任意访问权限: write_payment

接口

PUT /api/202412/app/account_authorize 

请求参数

payobjectrequired
账号授权结果。
- 收起属性
readybooleanrequired
账号激活结果:成功或失败。

响应数据

{}
bash
curl -X PUT \ 
https://{shop}.genmystore.com/api/202412/app/account_authorize" \ 
-H "X-Genstore-Access-Token: {access_token}" \ 
-H "Content-Type: application/json" \ 
-d '{
	"pay":{
		"ready":"true"
	}
}'
json
HTTP/1.1 200 OK
{}

PUT 更新支付结果

返回支付结果。

访问范围

需要以下任意访问权限: write_payment

接口

PUT /api/202412/app/payment/{paymentId} 

请求参数

payobjectrequired
支付结果。
- 收起属性
resultbooleanrequired
支付结果:成功或失败。
reasonstring
支付失败原因。
paymentIdstringrequired
Genstore支付单id。
channelPaymentIdstringrequired
支付通道侧支付单id。

响应数据

{}
bash
curl -X PUT \ 
https://{shop}.genmystore.com/api/202412/app/payment/{paymentId}" \ 
-H "X-Genstore-Access-Token: {access_token}" \ 
-H "Content-Type: application/json" \ 
-d '{
	"pay":{
		"result":"true",
		"reason":"Insufficient balance of bank card",
		"paymentId":"PI00202510281513381",
		"channelPaymentId":"2025102815"
	}
}'
json
HTTP/1.1 200 OK
{}

PUT 更新捕获结果

返回手动捕获结果,成功或失败。

访问范围

需要以下任意访问权限: write_payment

接口

PUT /api/202412/app/capture/{captureId} 

请求参数

payobjectrequired
手动捕获结果。
- 收起属性
resultbooleanrequired
手动捕获结果:成功或失败。
reasonstring
手动捕获失败原因。
captureIdstringrequired
Genstore手动捕获id。
channelCaptureIdstringrequired
支付通道侧手动捕获id。

响应数据

{}
bash
curl -X PUT \ 
https://{shop}.genmystore.com/api/202412/app/capture/{captureId}" \ 
-H "X-Genstore-Access-Token: {access_token}" \ 
-H "Content-Type: application/json" \ 
-d '{
	"pay":{
		"result":"true",
		"reason":"Payment do not support multiple captures",
		"channelCaptureId":"510281513",
		"captureId":"PI00202510281513381"
	}
}'
json
HTTP/1.1 200 OK
{}

PUT 更新退款结果

返回退款处理结果,成功或失败。

访问范围

需要以下任意访问权限: write_payment

接口

PUT /api/202412/app/refund/{refundId} 

请求参数

payobjectrequired
返回退款处理结果。
- 收起属性
resultbooleanrequired
退款处理结果:成功或失败。
reasonstring
退款失败原因。
refundIdstringrequired
Genstore退款id。
channelRefundIdstringrequired
支付通道侧退款id。

响应数据

{}
bash
curl -X PUT \ 
https://{shop}.genmystore.com/api/202412/app/refund/{refundId}" \ 
-H "X-Genstore-Access-Token: {access_token}" \ 
-H "Content-Type: application/json" \ 
-d '{
	"pay":{
		"result":"true",
		"reason":"The Reason for refund failure",
		"channelRefundId":"100202712119",
		"refundId":"RI00202510281513381"
	}
}'
json
HTTP/1.1 200 OK
{}

PUT 更新取消捕获结果

针对商家主动发起的取消捕获动作,返回处理结果。

访问范围

需要以下任意访问权限: write_payment

接口

PUT /api/202412/app/void/{voidId} 

请求参数

payobjectrequired
取消捕获结果。
- 收起属性
resultbooleanrequired
取消捕获结果:成功或失败。
reasonstring
取消捕获失败原因。
voidIdstringrequired
Genstore取消捕获id
channelVoidIdstringrequired
支付通道侧取消捕获id

响应数据

{}
bash
curl -X PUT \ 
https://{shop}.genmystore.com/api/202412/app/void/{voidId}" \ 
-H "X-Genstore-Access-Token: {access_token}" \ 
-H "Content-Type: application/json" \ 
-d '{
	"pay":{
		"result":"true",
		"reason":"Payment status is abnormal",
		"voidId":"PI00204453245701197",
		"channelVoidId":"I002044532457"
	}
}'
json
HTTP/1.1 200 OK
{}

PUT 更新预授权订单的授权结果

更新预授权订单的创建结果。

访问范围

需要以下任意访问权限: write_payment

接口

PUT /api/202412/app/pre_authorize/{paymentId} 

请求参数

payobjectrequired
更新预授权订单的创建结果。
- 收起属性
resultbooleanrequired
预授权订单创建结果:成功或失败。
reasonstring
预授权订单创建失败原因。
paymentIdstringrequired
Genstore支付单id。
channelPaymentIdstringrequired
支付通道侧支付单id。

响应数据

{}
bash
curl -X PUT \ 
https://{shop}.genmystore.com/api/202412/app/pre_authorize/{paymentId}" \ 
-H "X-Genstore-Access-Token: {access_token}" \ 
-H "Content-Type: application/json" \ 
-d '{
	"pay":{
		"result":"true",
		"reason":"Abnormal bank card number",
		"paymentId":"PI00202510281513381",
		"channelPaymentId":"20251028151338"
	}
}'
json
HTTP/1.1 200 OK
{}