Page tree
Skip to end of metadata
Go to start of metadata

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 BankCardTransaction'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 Card 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

BankCardTransaction o_bc_transaction = new BankCardTransaction();
o_bc_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 declines or fails 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 BankCardTransaction's that match a Merchant Transaction ID that are processed on the Base Commerce Platform using the BankCardTransaction 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 getBankCardTransactionByMerchantTransactionID().

Process a getBankCardTransactionByMerchantTransactionID

Returned
Method on BankCardTransaction
Parameters

Description

List<BankCardTransaction>getBankCardTransactionByMerchantTransactionID

Merchant Transaction ID

  • Type : String
Only One Merchant Transaction ID is Sent

Example getBankCardTransactionByMerchantTransactionID:

BaseCommerceClient o_client = new BaseCommerceClient(XS_USERNAME, XS_PASSWORD, XS_KEY);
o_client.setSandbox(true);
String s_merchant_transaction_id = "6";
 
List<BankCardTransaction> o_bct_list = o_client.getBankCardTransactionByMerchantTransactionID(s_merchant_transaction_id);
System.out.println("BCT List Size: " + o_bct_list.size());
for(BankCardTransaction o_bct : o_bct_list) {
    if( o_bct.getMessages() != null && !o_bct.getMessages().isEmpty() ) {
        System.out.println( "error messages: " + o_bct.getMessages() );
    } else {
        System.out.println("bct_id: " + o_bct.getTransactionId());
    }
}
  • No labels