繁体   English   中英

我可以使用 Authorize.Net 更新卡配置文件而不包括卡号信息吗?

[英]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 上找到了这篇文章,但他们实际上并没有回答这个问题,而且提问的人似乎已经放弃了。

https://community.developer.authorize.net/t5/Integration-and-Testing/Error-updating-Payment-Profile-information-without-sending/td-p/67540#

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM