Update Vault Records

Over the course of their existence, Vault Records may have certain aspects of their data changed. For example, if the customer moves and has their billing address linked to their card charged, you would just want to update that Vault Record within the system rather then adding a new one entirely. 

Updating a BankAccount

FieldMethod on BankAccount ObjectDescription
Billing AddresssetBillingAddress( Address vo_address )

The billing address for the account holder.

When this object is set on the BankAccount, the entire current Billing Address set on the BankAccount object will be overwritten with the new Billing Address.

Routing NumbersetRoutingNumber( String vs_routing_number ) The account holder's routing number.


What You Cannot Send

FieldMethod on BankAccount Object
Account NumbersetAccountNumber( String vs_account_number )



Address o_address = new Address( Address.XS_ADDRESS_NAME_BILLING );
o_address.setLine1( "1239 test lane" );
o_address.setZipcode( "12345" );
o_address.setCity( "Hometown" );
o_address.setState( "HI" );
o_address.setCountry( "US" );
 
BankAccount o_bank_account = new BankAccount();
o_bank_account.setRoutingNumber( "011001962" );
o_bank_account.setBillingAddress( o_address );
o_bank_account.setToken( "e604b169820e45b79bc87a357be848b7ebb25229a7c741386595d155209acc63" );
 
BaseCommerceClient o_client = new BaseCommerceClient( XS_USERNAME, XS_PASSWORD, XS_KEY );
o_bank_account = o_client.updateBankAccount( o_bank_account );
if ( o_bank_account.isStatus(BankAccount.XS_BA_STATUS_FAILED ) ) {
	// Bank Account add failed, look at messages for reasons why
	System.out.println( o_bank_account.getMessages() );
} else if ( o_bank_account.isStatus(BankAccount.XS_BA_STATUS_ACTIVE ) ) {
	// BankAccount update Successful
}

Updating a BankCard

FieldMethod on BankCard ObjectDescription
Billing AddresssetBillingAddress( Address vo_address )

The cardholder's billing address.

When this object is set on the BankCard, the entire current Billing Address set on the BankCard object will be overwritten with the new Billing Address.

Expiration MonthsetExpirationMonth( String vs_expiration_month )The expiration month on the payment card of the consumer.
Expiration YearsetExpirationYear( String vs_expiration_year )The expiration year on the payment card of the consumer. 

What You Cannot Send

FieldMethod on BankCard Object
Card NumbersetNumber( String vs_card_number )


Address o_address = new Address( Address.XS_ADDRESS_NAME_BILLING );
o_address.setLine1( "1239 test lane" );
o_address.setZipcode( "12345" );
o_address.setCity( "Hometown" );
o_address.setState( "HI" );
o_address.setCountry( "US" );
 
BankCard o_bank_card = new BankCard();
o_bank_card.setExpirationMonth( "09" );
o_bank_card.setExpirationYear( "2020" );
o_bank_card.setToken( "b920975a4bbb5712e0cf2f78b6f443c558aa68fc0a111814a8b4500d1f95c4a1" );
o_bank_card.setBillingAddress( o_address );
 
BaseCommerceClient o_client = new BaseCommerceClient( XS_USERNAME, XS_PASSWORD, XS_KEY );
o_bank_card = o_client.updateBankCard( o_bank_card );
if ( o_bank_card.isStatus( BankCard.XS_BC_STATUS_FAILED ) )
	// Bank Card update failed, look at messages for reasons why
	System.out.println("failed: " + o_bank_card.getMessages());
} else if (BankCard.XS_BC_STATUS_ACTIVE.equals(o_bank_card.getStatus())) {
	// Bank Card Updated Successful
}