我能够使用屏蔽的信用卡信息成功更新付款资料。这是我使用的 JSON 请求和响应,希望为您指明正确的方向。我会发布我的代码,但我使用了 PHP,这对你没有帮助。
创建客户资料
要求
{
"createCustomerProfileRequest": {
"merchantAuthentication": {
"name": "",
"transactionKey": ""
},
"profile": {
"merchantCustomerId": 70276167,
"email": "user01@example.com",
"paymentProfiles": {
"billTo": {
"firstName": "John",
"lastName": "Smith",
"address": "123 Main Street",
"city": "Townsville",
"state": "NJ",
"zip": "12345",
"phoneNumber": "800-555-1234"
},
"payment": {
"creditCard": {
"cardNumber": "4427802641004797",
"expirationDate": "2020-12"
}
}
},
"shipToList": {
"firstName": "John",
"lastName": "Smith",
"address": "123 Main Street",
"city": "Townsville",
"state": "NJ",
"zip": "12345",
"phoneNumber": "800-555-1234"
}
},
"validationMode": "liveMode"
}
}
回复
{
"customerProfileId": "1512089543",
"customerPaymentProfileIdList": [
"1512108080"
],
"customerShippingAddressIdList": [
"1511600096"
],
"validationDirectResponseList": [
"1,1,1,This transaction has been approved.,AKXC9R,Y,40050101060,none,Test transaction for ValidateCustomerPaymentProfile.,0.00,CC,auth_only,70276167,John,Smith,,123 Main Street,Townsville,NJ,12345,,800-555-1234,,user01@example.com,,,,,,,,,0.00,0.00,0.00,FALSE,none,,P,2,,,,,,,,,,,XXXX4797,Visa,,,,,,,03NAEDPDJAN8S9P2BCPOSM7,,,,,,,,,,"
],
"messages": {
"resultCode": "Ok",
"message": [
{
"code": "I00001",
"text": "Successful."
}
]
}
}
获取客户资料
要求
{
"getCustomerProfileRequest": {
"merchantAuthentication": {
"name": "",
"transactionKey": ""
},
"customerProfileId": "1512089543"
}
}
回复
{
"profile": {
"paymentProfiles": [
{
"customerPaymentProfileId": "1512108080",
"payment": {
"creditCard": {
"cardNumber": "XXXX4797",
"expirationDate": "XXXX",
"cardType": "Visa"
}
},
"billTo": {
"phoneNumber": "800-555-1234",
"firstName": "John",
"lastName": "Smith",
"address": "123 Main Street",
"city": "Townsville",
"state": "NJ",
"zip": "12345"
}
}
],
"shipToList": [
{
"customerAddressId": "1511600096",
"phoneNumber": "800-555-1234",
"firstName": "John",
"lastName": "Smith",
"address": "123 Main Street",
"city": "Townsville",
"state": "NJ",
"zip": "12345"
}
],
"profileType": "regular",
"customerProfileId": "1512089543",
"merchantCustomerId": "70276167",
"email": "user01@example.com"
},
"messages": {
"resultCode": "Ok",
"message": [
{
"code": "I00001",
"text": "Successful."
}
]
}
}
更新客户付款资料
要求
{
"updateCustomerPaymentProfileRequest": {
"merchantAuthentication": {
"name": "",
"transactionKey": ""
},
"customerProfileId": "1512089543",
"paymentProfile": {
"billTo": {
"firstName": "John",
"lastName": "Doe",
"company": "",
"address": "123 Main St.",
"city": "Bellevue",
"state": "WA",
"zip": "98004",
"country": "USA",
"phoneNumber": "800-555-1234",
"faxNumber": "800-555-1234"
},
"payment": {
"creditCard": {
"cardNumber": "XXXX4797",
"expirationDate": "XXXX"
}
},
"customerPaymentProfileId": "1512108080"
}
}
}
回复
{
"messages": {
"resultCode": "Ok",
"message": [
{
"code": "I00001",
"text": "Successful."
}
]
}
}