![](/img/trans.png)
[英]Can I make card present transactions to Authorize.Net via my web service?
[英]Can I update a card profile without including the cardnumber information with Authorize.Net?
我有一個 c# 應用程序,它接受信用卡並將配置文件保存到 authorize.net。 它成功地對卡收費並成功地保存了配置文件。
如果用戶想要更新所有信息並重新輸入他們的信用卡號、有效期和 cvc,他們可以更新他們的個人資料。
但是,我們希望能夠在不更新信用卡信息的情況下更新 billTo 信息。 不幸的是,每當我嘗試調用 updateCustomerPaymentProfileRequest 時,我都會收到需要付款信息的錯誤。
我可以閱讀當前的個人資料,但卡號和到期日期被掩蓋了。 我可以取消屏蔽到期日期,但不能取消卡號。
不幸的是,對 updateCustomerPaymentProfileRequest 的調用需要 paymentType ,而 getProfile 調用返回一個掩碼的支付類型,它們似乎不能互換。
事實上,即使我嘗試請求未屏蔽的到期日期,它也不會返回它。
var request = new getCustomerPaymentProfileRequest();
request.customerProfileId = customerProfileId;
request.customerPaymentProfileId = paymentProfileId;
request.unmaskExpirationDate = true;
付款信息是屏蔽類型,到期日期是屏蔽的。
即使這給了我未屏蔽的到期日期,我仍然沒有信用卡號,我什至不想要,因為我只想更新 billTo。
這甚至可能嗎? 我在 authorize.net 上找到了這篇文章,但他們實際上並沒有回答這個問題,而且提問的人似乎已經放棄了。
Jim,如果未更新付款詳細信息,可以以屏蔽格式(例如 XXXX1111)提交,您可以查看 Authorize.Net API 文檔了解更多詳細信息。
https://developer.authorize.net/api/reference/index.html#customer-profiles-update-customer-payment-profile (paymentProfile:可以屏蔽未更新的敏感信息)。
我能夠使用屏蔽的信用卡信息成功更新付款資料。 這是我使用的 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."
}
]
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.