Payment methods
创建支付方式以及客户信息,并作关联操作
创建支付方式接口
网关号
请求id,30分钟之内唯一
时间戳,以毫秒(ms)为单位,请求误差不能超过10分钟
验签字段,具体加签方式请参阅数据签名过程章节
客户ID; 将客户与创建的支付方式进行绑定; 商户可以通过接口/customers发起post创建; 最大长度为100; 如:cus_1420997690607206400
cus_1420997690607206400
POST /V2022-03/payment_methods HTTP/1.1
Host: {paymentapiurl}
gateway-no: null
request-id: null
request-time: null
sign-info: null
Content-Type: application/json
Accept: */*
Content-Length: 331
{
"billingDetail": {
"Address": {
"city": "Maryland",
"country": "US",
"line1": "west street",
"postalCode": "21133",
"state": "MD"
},
"email": "abc@mail.com",
"firstName": "asia",
"lastName": "bill",
"phone": 13212344321
},
"card": {
"cardExpireMonth": null,
"cardExpireYear": null,
"cardNo": null,
"cardSecurityCode": null
},
"customerId": "cus_1420997690607206400"
}
OK
{
"code": "success",
"message": "message response",
"data": {
"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": 2222,
"last4": 1111
},
"customerPaymentMethodId": "pm_1420997693836820480"
}
}
创建支付方式接口请求报文示例
curl --request POST \
--url https://{paymentApiUrl}/V2022-03/payment_methods \
--header 'Content-Type: application/json' \
--header 'request-id: 58675' \
--header 'request-time: 1651888520935' \
--header 'gateway-no: 12345001' \
--header 'sign-info: 787966BF2479A1BE8E1886CD18E6919447FAF4F357E7056188D4F035661B822B' \
--data '{
"billingDetail": {
"address": {
"city": "NEWARK VALLEY",
"country": "US",
"line1": "4348 Calico Drive",
"postalCode": "13811",
"state": "NY"
},
"email": "indubio@gmail.com",
"firstName": "Di Mo",
"lastName": "Shi",
"phone": "509-675-8948"
},
"card": {
"cardNo": "5333302221254276",
"cardExpireMonth": "12",
"cardExpireYear": "2025",
"cardSecurityCode": "123"
},
"customerId": "cus_1526760517237616640"
}'
更新PaymentMethod的信息
网关号
请求id,30分钟之内唯一
时间戳,以毫秒(ms)为单位,请求误差不能超过10分钟
验签字段,具体加签方式请参阅数据签名过程章节
卡支付ID, 商户可以通过接口/payment_methods发起post创建,必填项; 如:pm_1420997693836820480
pm_1420997693836820480
POST /V2022-03/payment_methods/update HTTP/1.1
Host: {paymentapiurl}
gateway-no: null
request-id: null
request-time: null
sign-info: null
Content-Type: application/json
Accept: */*
Content-Length: 343
{
"billingDetail": {
"Address": {
"city": "Maryland",
"country": "US",
"line1": "west street",
"postalCode": "21133",
"state": "MD"
},
"email": "abc@mail.com",
"firstName": "asia",
"lastName": "bill",
"phone": 13212344321
},
"card": {
"cardExpireMonth": null,
"cardExpireYear": null,
"cardNo": null,
"cardSecurityCode": null
},
"customerPaymentMethodId": "pm_1420997693836820480"
}
OK
{
"code": "success",
"message": "message response",
"data": {
"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": 2222,
"last4": 1111
},
"customerPaymentMethodId": "pm_1420997693836820480"
}
}
更新支付方式接口请求报文示例
curl --request POST \
--url https://{paymentApiUrl}/V2022-03/payment_methods/update \
--header 'Content-Type: application/json' \
--header 'request-id: 58675' \
--header 'request-time: 1651888520935' \
--header 'gateway-no: 12345001' \
--header 'sign-info: 787966BF2479A1BE8E1886CD18E6919447FAF4F357E7056188D4F035661B822B' \
--data '{
"billingDetail": {
"address": {
"city": "NEWARK VALLEY",
"country": "US",
"line1": "4349 Calico Drive",
"postalCode": "13811",
"state": "NY"
},
"email": "indubio@gmail.com",
"firstName": "Di Ma",
"lastName": "Shi",
"phone": "509-675-8948"
},
"customerPaymentMethodId": "pm_1526760521989763072"
}'
获取支付方式接口请求报文示例
curl --request GET \
--url https://{paymentApiUrl}/V2022-03/payment_methods/pm_1526760521989763072 \
--header 'Content-Type: application/json' \
--header 'request-id: 58675' \
--header 'request-time: 1651888520935' \
--header 'gateway-no: 12345001' \
--header 'sign-info: 787966BF2479A1BE8E1886CD18E6919447FAF4F357E7056188D4F035661B822B' \
获取支付方式接口
卡支付ID,最大长度100,如:pm_1420997693836820480
网关号
请求id,30分钟之内唯一
时间戳,以毫秒(ms)为单位,请求误差不能超过10分钟
验签字段,具体加签方式请参阅数据签名过程章节
GET /V2022-03/payment_methods/{customerPaymentMethodId} HTTP/1.1
Host: {paymentapiurl}
gateway-no: null
request-id: null
request-time: null
sign-info: null
Accept: */*
OK
{
"code": "success",
"message": "message response",
"data": {
"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": 2222,
"last4": 1111
},
"customerPaymentMethodId": "pm_1420997693836820480"
}
}
获取支付方式接口请求报文示例
curl --request GET \
--url https://{paymentApiUrl}/V2022-03/payment_methods/pm_1526760521989763072 \
--header 'Content-Type: application/json' \
--header 'request-id: 58675' \
--header 'request-time: 1651888520935' \
--header 'gateway-no: 12345001' \
--header 'sign-info: 787966BF2479A1BE8E1886CD18E6919447FAF4F357E7056188D4F035661B822B' \
根据客户获取所有支付方式接口
客户id,最大长度100,如:cus_1420997690607206400
网关号
请求id,30分钟之内唯一
时间戳,以毫秒(ms)为单位,请求误差不能超过10分钟
验签字段,具体加签方式请参阅数据签名过程章节
GET /V2022-03/payment_methods/list/{customerId} HTTP/1.1
Host: {paymentapiurl}
gateway-no: null
request-id: null
request-time: null
sign-info: null
Accept: */*
OK
{
"code": "success",
"message": "message response",
"data": [
{
"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": 2222,
"last4": 1111
},
"customerPaymentMethodId": "pm_1420997693836820480"
}
]
}
根据客户获取所有支付方式接口请求报文示例
curl --request GET \
--url https://{paymentApiUrl}/V2022-03/payment_methods/list/cus_1526760517237616640 \
--header 'Content-Type: application/json' \
--header 'request-id: 58675' \
--header 'request-time: 1651888520935' \
--header 'gateway-no: 12345001' \
--header 'sign-info: 787966BF2479A1BE8E1886CD18E6919447FAF4F357E7056188D4F035661B822B' \
客户附加支付方式接口
客户id,最大长度100,如:cus_1420997690607206400
卡支付ID,最大长度100,如:pm_1420997693836820480
网关号
请求id,30分钟之内唯一
时间戳,以毫秒(ms)为单位,请求误差不能超过10分钟
验签字段,具体加签方式请参阅数据签名过程章节
GET /V2022-03/payment_methods/{customerPaymentMethodId}/{customerId}/attach HTTP/1.1
Host: {paymentapiurl}
gateway-no: null
request-id: null
request-time: null
sign-info: null
Accept: */*
OK
{
"code": "success",
"message": "message response",
"data": {
"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": 2222,
"last4": 1111
},
"customerPaymentMethodId": "pm_1420997693836820480"
}
}
客户附加支付方式接口请求报文示例
curl --request GET \
--url https://{paymentApiUrl}/V2022-03/payment_methods/pm_1526760521989763072/cus_1526760517237616640/attach \
--header 'Content-Type: application/json' \
--header 'request-id: 58675' \
--header 'request-time: 1651888520935' \
--header 'gateway-no: 12345001' \
--header 'sign-info: 787966BF2479A1BE8E1886CD18E6919447FAF4F357E7056188D4F035661B822B' \
解绑支付方式接口
卡支付ID,最大长度100,如:pm_1420997693836820480
网关号
请求id,30分钟之内唯一
时间戳,以毫秒(ms)为单位,请求误差不能超过10分钟
验签字段,具体加签方式请参阅数据签名过程章节
GET /V2022-03/payment_methods/{customerPaymentMethodId}/detach HTTP/1.1
Host: {paymentapiurl}
gateway-no: null
request-id: null
request-time: null
sign-info: null
Accept: */*
OK
{
"code": "success",
"message": "message response",
"data": {
"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": 2222,
"last4": 1111
},
"customerPaymentMethodId": "pm_1420997693836820480"
}
}
解绑支付方式接口请求报文示例
curl --request GET \
--url https://{paymentApiUrl}/V2022-03/payment_methods/pm_1526760521989763072/detach \
--header 'Content-Type: application/json' \
--header 'request-id: 58675' \
--header 'request-time: 1651888520935' \
--header 'gateway-no: 12345001' \
--header 'sign-info: 787966BF2479A1BE8E1886CD18E6919447FAF4F357E7056188D4F035661B822B' \
结果对象属性描述
code
String
返回码
message
String
返回信息
data
Object
数据对象
customerPaymentMethodId
String
支付方式id;
如:pm_1671231231232
card
Object
对象
last4
String
卡后四位
brand
String
卡组织;
如:Visa
billingDetail
Object
对象
String
邮箱
firstName
String
firstName
lastName
String
lastName
phone
String
电话
address
Object
对象
city
String
城市
country
String
国家代码,两位字母的ISO国家代码
line1
String
地址1,该地址优先使用
line2
String
地址2
postalCode
String
邮编
state
String
州;两位字母的ISO州代码
Last updated