cancel
Showing results for 
Search instead for 
Did you mean: 

Update Billing Address using CIM Java SDK

I have a business requirement to allow users to update their billing address only, not having to reenter the credit card details.

 

I have similar functionality that updates the credit card only, leaving the old billing address, and it works.

 

When I execute the code below I get an error: E00027 - (TESTMODE) The credit card has expired.

 

Here's my code:

    // fetch current payment profile
    Transaction transaction = merchant.createCIMTransaction(TransactionType.GET_CUSTOMER_PAYMENT_PROFILE);

    transaction.setCustomerProfileId(customerProfileId);
    transaction.setCustomerPaymentProfileId(paymentProfileId);

    Result<Transaction> result = (Result<Transaction>) merchant.postTransaction(transaction);
    final net.authorize.data.cim.PaymentProfile currPaymentProfile = result.getCustomerPaymentProfile();

    currPaymentProfile.setBillTo(newBillingAddress);

    // save billing address updates
    transaction = merchant.createCIMTransaction(TransactionType.UPDATE_CUSTOMER_PAYMENT_PROFILE);
    transaction.setCustomerProfileId(customerProfileId);
    transaction.addPaymentProfile(currPaymentProfile);
    transaction.setValidationMode(ValidationModeType.TEST_MODE);

    result = (Result<Transaction>) merchant.postTransaction(transaction);
    result.printMessages();

 Is this a bug, or am I doing something wrong here?

 

I couldn't find a real documentation for the SDK, but according to the XML and SOAP docs, fetching the existing payment profile, and filling in the updates should be OK, even though the CC details are masked.

 

If it helps, I use the following SDK version:

    <dependency>
      <groupId>net.authorize</groupId>
      <artifactId>anet-java-sdk</artifactId>
      <version>1.4.5</version>
    </dependency>

 

eran
Contributor
22 REPLIES 22

It's been over 2 years since this issue was reported. Is the Java SDK still being maintained by AuthorizeNet? Any issues with forking it to GitHub so it can be maintained by the community?

Hello,

 

This issue is now resolved and an updated SDK is available from GitHub: https://github.com/AuthorizeNet/sdk-java/

 

Richard

Very nice.

We abandoned your service by now, but at least others will this fixed, assuming that it is fixed now.

 

I find it very sad that I provided a patch for this issue 3 years ago, and it was only addressed now. Very very very sad.

 

Meh, may this be a lesson for those who stayed with you :P