Can I update a card profile without including the cardnumber information with Authorize.Net?

610 views Asked by At

I've got a c# application that accepts credit cards and saves the profiles to authorize.net. It successfully charges the cards and successfully saves the profiles.

If the user wants to update all the information and re-enters their credit card number, expiration, and cvc, they can update their profile.

However, we want to be able to update the billTo information without updating the credit card information. Unfortunately, whenever I try calling the updateCustomerPaymentProfileRequest, I get the error that the payment information is required.

I can read the current profile, but the cardnumber and expiration dates are masked. I can unmask the expiration date but not the card number.

Unfortunately the call to updateCustomerPaymentProfileRequest requires paymentType and the getProfile call returns a masked payment type, and they don't seem to be interchangeable.

In fact if I even try to request the unmasked expiration date, it doesn't return it.

var request = new getCustomerPaymentProfileRequest();
request.customerProfileId = customerProfileId;
request.customerPaymentProfileId = paymentProfileId;
request.unmaskExpirationDate = true;

the payment info is a masked type, and the expiration date is masked.

Even if this gave me the unmasked expiration date though, I still don't have the credit card number, which I really don't even want as I just want to update the billTo.

Is this even possible? I found this article on authorize.net but they didn't actually answer the question, and the person who asked seems to have given up.

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

2

There are 2 answers

1
John Conde On BEST ANSWER

I was able to successfully update a payment profile using the masked credit card information. Here is the JSON requests and responses I used which hopefully points you in the right direction. I would post my code but I used PHP which won't be helpful for you.

CREATE CUSTOMER PROFILE

Request

{
    "createCustomerProfileRequest": {
        "merchantAuthentication": {
            "name": "",
            "transactionKey": ""
        },
        "profile": {
            "merchantCustomerId": 70276167,
            "email": "[email protected]",
            "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"
    }
}

Response

{
    "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,,[email protected],,,,,,,,,0.00,0.00,0.00,FALSE,none,,P,2,,,,,,,,,,,XXXX4797,Visa,,,,,,,03NAEDPDJAN8S9P2BCPOSM7,,,,,,,,,,"
    ],
    "messages": {
        "resultCode": "Ok",
        "message": [
            {
                "code": "I00001",
                "text": "Successful."
            }
        ]
    }
}

GET CUSTOMER PROFILE

Request

{
    "getCustomerProfileRequest": {
        "merchantAuthentication": {
            "name": "",
            "transactionKey": ""
        },
        "customerProfileId": "1512089543"
    }
}

Response

{
    "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": "[email protected]"
    },
    "messages": {
        "resultCode": "Ok",
        "message": [
            {
                "code": "I00001",
                "text": "Successful."
            }
        ]
    }
}

UPDATE CUSTOMER PAYMENT PROFILE

Request

{
    "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"
        }
    }
}

Response

{
    "messages": {
        "resultCode": "Ok",
        "message": [
            {
                "code": "I00001",
                "text": "Successful."
            }
        ]
    }
}
0
Mansour Hamcherif On

Jim, payment details can be submitted in a masked format (e.g. XXXX1111) if not being updated, you can check the Authorize.Net API documentation for more details.

https://developer.authorize.net/api/reference/index.html#customer-profiles-update-customer-payment-profile (paymentProfile: Sensitive information that is not being updated can be masked).