Comment on page
Payment methods
创建支付方式以及客户信息,并作关联操作
post
https://{paymentApiUrl}
/V2022-03/payment_methods
创建支付方式接口
createPaymentMethod.sh
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": "[email protected]",
"firstName": "Di Mo",
"lastName": "Shi",
"phone": "509-675-8948"
},
"card": {
"cardNo": "5333302221254276",
"cardExpireMonth": "12",
"cardExpireYear": "2025",
"cardSecurityCode": "123"
},
"customerId": "cus_1526760517237616640"
}'
post
https://{paymentApiUrl}
/V2022-03/payment_methods/update
更新PaymentMethod的信息
updatePaymentMethod.sh
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": "[email protected]",
"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' \
get
https://{paymentApiUrl}
/V2022-03/payment_methods/{customerPaymentMethodId}
获取支付方式接口
getPaymentMethod
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' \
get
https://{paymentApiUrl}
/V2022-03/payment_methods/list/{customerId}
根据客户获取所有支付方式接口
getPaymentMethodListByCustomerId.sh
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' \
get
https://{paymentApiUrl}
/V2022-03/payment_methods/{customerPaymentMethodId}/{customerId}/attach
客户附加支付方式接口
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' \
get
https://{paymentApiUrl}
/V2022-03/payment_methods/{customerPaymentMethodId}/detach
解绑支付方式接口
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' \
以上接口,【根据客户获取所有支付方式】【解绑支付方式】返回结构差异外,其他均返回如下结构(由于数据字段并无差别所以不再展示)
property name | type | description |
---|---|---|
code | String | 返回码 |
message | String | 返回信息 |
data | Object | 数据对象 |
customerPaymentMethodId | String | 支付方式id; 如:pm_1671231231232 |
card | Object | 对象 |
last4 | String | 卡后四位 |
brand | String | 卡组织; 如:Visa |
billingDetail | Object | 对象 |
email | 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 modified 1yr ago