Menu

Using The SDK

To take a test drive of our SDK in our sandbox environment, please go here: https://www.basecommerce.com/developers/ to register for a demo account. In order to use the SDK in the production environment, you will need to have an active Merchant Account with Base Commerce.

Regardless of which programming language you are using, the architecture of the SDK is the same. All code examples throughout this document (and throughout all of the Base Commerce Technical Documentation) are in JAVA. To retrieve your SDK credentials, go to https://my.basecommercesandbox.com (https://my.basecommerce.com for production) under the Development tab.

Each request to the Base Commerce Platform begins by initializing the BaseCommerceClient object with your username, password, and transaction key. 

BaseCommerceClient o_client = new BaseCommerceClient( “username”, ”password”, ”key”); 

Ping Pong

The main focus of this feature is to have a fast check for both your credentials, and general connection to the Base Commerce Servers. 

BaseCommerceClient o_client = new BaseCommerceClient( "username", "password", "key" );
        
// Set to true if you are testing the connection to the sandbox environment, otherwise do not set
o_client.setSandbox(true);
        
try {
            
    System.out.println( o_client.sendPing() );
            
} catch ( BaseCommerceClientException ve_exception ) {
            
    switch ( ve_exception.getMessage() ) {
		case "Invalid Credentials.":
        	// Handle here
            break;
        case "Invalid url or host is offline.":
        	// Handle here
            break;
	}
            
}

What To Expect

  • If success, the method will return true
  • If failed due to wrong credentials
    • Will throw / raise an exception saying "Invalid Credentials."
      • in Obj-C this is handled by the handle403Response BaseCommerceClientDelegate method
  • If failed due to connectivity issues
    • Will throw / raise an exception saying "Invalid url or host is offline."
      • in Obj-C this is handled by the handle404Response BaseCommerceClientDelegate method

Last Session ID

Every request made through the SDK is given a unique Session ID. This Session ID should be stored after every request while testing and passed in with any Development Support Tickets you open when running into issues. The Session ID will enable our Development Support Team to quickly identify your connection and what went wrong. For more information about SDKs for Credit Card Processing, please visit: Credit Card Processing.

BaseCommerceClient o_client = new BaseCommerceClient( XS_USERNAME, XS_PASSWORD, XS_KEY );
 
// Make any request with the client, for this example we will grab the Session ID after calling deleteBankAccount
BankAccount o_bank_account = o_client.deleteBankAccount( "e604b169820e45b79bc87a357be848b7ebb25229a7c741386595d155209acc63" );

// We are ignoring what was returned via the BankAccount as its state does not effect receiving a Session ID

String s_session_id = o_client.getLastSessionID();
 
// Save or print out this Session ID with each request so you have it when you run into issues

System.out.println( "Session ID : " + s_session_id );

Processing Transactions

Bank Card Transactions

Bank Account Transactions