⚙️
API Explorer
  • Overview
  • API Reference
    • 交易
      • Sessiontoken
      • customer
      • Payment methods
      • Confirm charge
      • Checkout payment
      • Local payment
    • 授权交易完成/撤销
      • Authorization
    • 拒付
    • 退款
    • 物流
    • 交易查询
    • 网关绑定支付通道查询
    • 结算明细查询
    • 风控-来源网址查询
  • Webhook
    • 概述
    • 交易事件
    • 预授权事件
    • 退款事件
    • 拒付事件
    • 支付结果跳转
  • 附录
    • 数据签名过程
    • 测试账号信息
    • 常见错误码
    • 常见问题
    • 旧版API文档
Powered by GitBook
On this page
  1. API Reference
  2. 交易

Confirm charge

支付扣款接口

PreviousPayment methodsNextCheckout payment

Last updated 15 days ago

请求报文示例

confirmCharge.sh
curl --request POST \
  --url https://{paymentApiUrl}/V2022-03/confirmCharge \
  --header 'Content-Type: application/json' \
  --header 'request-id: 58675' \
  --header 'request-time: 1651888520935' \
  --header 'gateway-no: 12345001' \
  --header 'sign-info: 787966BF2479A1BE8E1886CD18E6919447FAF4F357E7056188D4F035661B822B' \
  --data '{
    "callbackUrl": "https://sandbox-pay.asiabill.com/services/v3/CallResult",
    "customerId": "cus_1526760517237616640",
    "customerIp": "192.168.3.27",
    "customerPaymentMethodId": "pm_1526760521989763072",
    "goodsDetails": [
        {
            "goodsCount": "1000",
            "goodsPrice": "154.23",
            "goodsTitle": "apple"
        }
    ],
    "isMobile": "0",
    "orderAmount": "194.13",
    "orderCurrency": "USD",
    "orderNo": "NEW_API1916436298025",
    "platform": "",
    "remark": "TEST",
    "returnUrl": "https://sandbox-pay.asiabill.com/services/v3/RedirectResultTest?bankCode=TestBankCode",
    "shipping": {
        "address": {
            "city": "NEWARK VALLEY",
            "country": "US",
            "line1": "4348  Calico Drive",
            "postalCode": "13811",
            "state": "NY"
        },
        "firstName": "Di Mo",
        "lastName": "Shi",
        "phone": "509-675-8948"
    },
    "webSite": "www.AsiaBill.com"
}'

结果对象属性描述

property name
type
description

code

String

返回码

message

String

返回信息

data

redirectUrl

String

跳转URL(3D验证URL、本地支付跳转URL),如果此值不为空,则商户需要跳转客户到此地址

orderStatus

String

【交易状态】

待处理:pending

成功:success

失败:fail

orderInfo

String

交易状态描述信息

remark

String

备注

tradeNo

String

流水订单号

orderNo

String

商户订单号

orderAmount

String

商户订单金额

orderCurrency

String

商户订单币种

riskInfos

String

风控信息

maskCardNo

String

卡号前六后四

  • POST确认扣款接口
  • 请求报文示例

确认扣款接口

post

确认扣款接口

Header parameters
gateway-nostring(16)Required

网关号

request-idstring(64)Required

请求id,30分钟之内唯一

request-timestring(16)Required

时间戳,以毫秒(ms)为单位,请求误差不能超过10分钟

sign-infostring(255)Required

验签字段,具体加签方式请参阅数据签名过程章节

Body
callbackUrlstring(1000)Optional

服务端异步通知地址;最小长度为1,最大长度为1000,如:https://www.my.shopify.com/callbackUrl

Example: https://www.my.shopify.com/callbackUrl
customerIdstring(100)Optional

客户ID; 商户可以通过接口/customers发起post创建; 注:tokenType=InitRecurring/Recurring时,为必填项; 最大长度为100; 如:cus_1420997690607206400

Example: cus_1420997690607206400
customerPaymentMethodIdstring(100)Optional

卡支付ID; 商户可以通过接口/payment_methods发起post创建; 注:tokenType=Recurring时或者非PCI商户,为必填项;customerPaymentMethodId和customerPaymentMethod对象二选一; 如:pm_1420997693836820480

Example: pm_1420997693836820480
customerIpstring(50)Required

客户ip地址;最小长度为1,最大长度为50,如:192.168.0.1

Example: 192.168.0.1
isMobilestring(1)Optional

客户端类型; 0:web,1:h5,2:app_SDK,3:mini_app(小程序),默认:0;固定长度为1,如:0

orderAmountstring(16)Required

商户订单金额; 最多两位小数,注:如果币种最小单位为元,则只能为整数;最小长度为1,最大长度为16,如:100.99

Example: 100.99
orderCurrencystring(3)Required

3位字母的ISO币种代码;固定长度为3,如:USD

Example: USD
orderNostring(50)Required

商户订单号;最小长度为1,最大长度为50,如:12167001000000000001

Example: 12167001000000000000
platformstring(10)Optional

平台标识名称; 如果商户是SaaS平台,为必填项;最小长度为1,最大长度为10,如:Shopify

Example: Shopify
remarkstring(500)Optional

订单备注;最大长度为500,如:remark

Example: remark
returnUrlstring(1000)Required

交易完成页面跳转地址;最小长度为1,最大长度为1000,如:https://www.my.shopify.com/redirectUrl

Example: https://www.my.shopify.com/redirectUrl
tokenTypestring(100)Optional

循环扣款类型; InitRecurring/Recurring,首笔交易:InitRecurring,非首笔交易:Recurring;最大长度为100

webSitestring(200)Required

商户店铺网址;最小长度为1,最大长度为200,如:https//www.my.shopify.com

Example: https//www.my.shopify.com
priorityThreeDSecurestring(20)Optional

优先3D通道,any:任何场景,automatic:自动3D验证

Example: automatic
Responses
200
OK
*/*
post
POST /V2022-03/confirmCharge HTTP/1.1
Host: {paymentapiurl}
gateway-no: null
request-id: null
request-time: null
sign-info: null
Content-Type: application/json
Accept: */*
Content-Length: 954

{
  "callbackUrl": "https://www.my.shopify.com/callbackUrl",
  "customerId": "cus_1420997690607206400",
  "customerPaymentMethodId": "pm_1420997693836820480",
  "customerIp": "192.168.0.1",
  "customerPaymentMethod": {
    "billingDetail": {
      "Address": {
        "city": "Maryland",
        "country": "US",
        "line1": "west street",
        "postalCode": "21133",
        "state": "MD"
      },
      "email": "abc@mail.com",
      "firstName": "asia",
      "lastName": "bill",
      "phone": 13212344321
    },
    "card": {
      "brand": "Visa",
      "cardExpireMonth": null,
      "cardExpireYear": null,
      "cardNo": null,
      "cardSecurityCode": null,
      "last4": null
    }
  },
  "goodsDetails": [
    {
      "goodsCount": 2,
      "goodsPrice": 100,
      "goodsTitle": "iphone"
    }
  ],
  "isMobile": 0,
  "orderAmount": 100.99,
  "orderCurrency": "USD",
  "orderNo": "12167001000000000000",
  "platform": "Shopify",
  "remark": "remark",
  "returnUrl": "https://www.my.shopify.com/redirectUrl",
  "shipping": {
    "address": 13212344321,
    "firstName": "asia",
    "lastName": "bill",
    "phone": 13212344321
  },
  "tokenType": null,
  "webSite": "https//www.my.shopify.com",
  "priorityThreeDSecure": "automatic"
}
200

OK

{
  "code": "success",
  "message": "message response",
  "data": {
    "maskCardNo": "422222********1111",
    "orderAmount": "100",
    "orderCurrency": "USD",
    "orderInfo": "is order info",
    "orderNo": "12167001000000000000",
    "orderStatus": "success",
    "redirectUrl": "https://3desurl.com",
    "remark": "remark",
    "riskInfos": "is risk info",
    "tradeNo": "2022022416544064513805"
  }
}