Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Merchant Transaction ID is an alpha numeric field that can be set in the SDK on all transactions. If you do not set one, then the Base platform will set it for you. Base will set the merchant transaction ID to be the same value as the BankAccountTransaction's ID, which is the unique ID set on every transaction. You can pull data based off this field which will return a list of all Bank Account Transactions under your merchant with the merchant transaction ID matching the passed in string. An example below will show how that works.

Setting the Merchant Transaction ID


Code Block
BankAccountTransaction o_ba_transaction = new BankAccountTransaction();

o_ba_transaction.setMerchantTransactionID("123ABC");





Requiring Unique Merchant Transaction ID

Another use for the merchant transaction ID is to require unique transactions. In the merchant portal under the settings page under the Payment Method Verification header is the checkbox to enable this. If enabled, when a transaction successfully processes (not failing validation) with a merchant transaction ID set, if a second transaction is tried to be processed with the same merchant transaction ID it will fail validation and not process the transaction.

...

Getting BankAccountTransaction's that match a Merchant Transaction ID that are processed on the Base Commerce Platform using the BankAccountTransaction object to encapsulate all of the data needed. The list of that merchants transactions with that merchant transaction ID set can be called by using the BaseCommercePayClient's method getBankAccountTransactionByMerchantTransactionID().

Process a getBankAccountTransactionByMerchantTransactionID: 

Returned
Method on BankAccountTransaction
Parameters

Description

List<BankAccountTransaction>getBankAccountTransactionByMerchantTransactionID

Merchant Transaction ID

  • Type : String
Only one Merchant Transaction ID is sent

Example getBankAccountTransactionByMerchantTransactionID:


Code Block
BaseCommerceClient o_client = new BaseCommerceClient(XS_USERNAME, XS_PASSWORD, XS_KEY);
o_client.setSandbox(true)
String s_merchant_transaction_id = "4";
       
List<BankAccountTransaction> o_bat_list = o_client.getBankAccountTransactionByMerchantTransactionID(s_merchant_transaction_id);
System.out.println("BAT List Size: " + o_bat_list.size());
for( BankAccountTransaction o_bat : o_bat_list ) {
    if( o_bat.getMessages() != null && !o_bat.getMessages().isEmpty() ) {
        System.out.println( "error messages: " + o_bat.getMessages() );
    } else {
        System.out.println("o_bat id: " + o_bat.getBankAccountTransactionId());
    }
}

 

...