Menu

Application Example

BaseCommerceClient o_client = new BaseCommerceClient( "SDK_USERNAME", "SDK_PASSWORD", "SDK_KEY" );
o_client.setSandbox(true);
  MerchantApplication o_merchant_application = new MerchantApplication();
    o_merchant_application.setShareToEmail( "testemail@email.com" );
    o_merchant_application.setAutoShareToMerchant( false );
    o_merchant_application.setAutoSubmitToUnderwriting( false );
    o_merchant_application.setProgramId( "7" );
    o_merchant_application.setApiVersion( "1.2" );
      Account o_account = new Account();
        o_account.setAccountName( "TEST Account" );
          Address o_legal_address = new Address( Address.XS_LEGAL );
            o_legal_address.setLine1( "123 Oak Street" );
            o_legal_address.setCity( "Toontown" );
            o_legal_address.setState( "AZ" );
            o_legal_address.setZipcode( "85284" );
          o_account.setLegalAddress( o_legal_address );
        o_account.setAccountPhoneNumber( "(800)555-4567" );
        o_account.setCustomerServicePhoneNumner( "(800)555-6543" );
        o_account.setDBA( "ACME Inc" );
        o_account.setEntityType( Account.XS_ENTITY_TYPE_CORP );
        o_account.setEIN( "123456789" )
        o_account.setIpAddressOfAppSubmission( "192.168.0.1" );
        o_account.setWebsite( "www.google.com" );
        o_account.setAcceptACH( true );
        o_account.setAcceptBC( true );
        o_account.setSettlementAccountBankName( "US Bank" );
        o_account.setSettlementAccountName( "TEST Account DBA ACME Inc" );
        o_account.setSettlementAccountNumber( "1234567891011" );
        o_account.setSettlementAccountRoutingNumber( "021000021" );
        o_account.setSettlementSameAsFeeAccount( false );
        o_account.setFeeAccountBankName( "US Bank" );
        o_account.setFeeAccountName( "TEST Account DBA ACME Inc Fees" );
        o_account.setFeeAccountNumber( "1234567891012" );
        o_account.setFeeAccountRoutingNumber( "021000021" );
      o_merchant_application.setAccount( o_account );
      Location o_location = new Location ();
        Address o_dba_address = new Address( address.XS_DBA );
          o_dba_address.setLine1( "123 Fake St." );
          o_dba_address.setCity( "Toontown" );
          o_dba_address.setState( "AZ" );
          o_dba_address.setZipcode( "85284" );
        o_location.setDBAAddress( o_dba_address );
        o_location.setContactName( "John Doe" );
        o_location.setContactEmail( "John.Doe@email.com" );
        o_location.setFax( "(480)555-1234" );
        o_location.setEntityStartDate( new Date() );
        o_location.setEntityState( "AZ" );
        o_location.setLengthOfCurrentOwnership( "10/15/2012" );
      ACHDetails o_ach_details = new ACHDetails();
          o_ach_details.setAuthMethodOnlinePercentage( 50 );
          o_ach_details.setAuthMethodVerbalPercentage( 25 );
          o_ach_details.setAuthMethodWrittenInPersonPercentage( 25 );
          o_ach_details.setAverageMonthlyAmount( 100000 );
          o_ach_details.setAverageTicketAmount( 1000 );
          o_ach_details.setMaxMonthlyAmount( 200000 );
          o_ach_details.setMaxSingleTransactionAmount( 5000 );
          o_ach_details.setDiscountRate( 1.25 );
          o_ach_details.setMonthlyFee( 25 );
          o_ach_details.setReturnFee( 0.5 );
          o_ach_details.setCompanyNameDescriptor( "ACME Inc" );
          o_ach_details.setDecriptor( "ACME Inc Explosive Sale" );
          o_ach_details.setIssueCredits( true );
          o_ach_details.setIssueDebits( true );
          o_ach_details.setRecurring( true );
          o_ach_details.addSubmissionMethod( ACHDetails.XS_SUBMISSION_METHOD_MANUALLY_VIA_VIRTUAL_TERMINAL );
          o_ach_details.addSubmissionMethod( ACHDetails.XS_SUBMISSION_METHOD_VIA_A_GATEWAY );
          o_ach_details.addPaymentToFrom( ACHDetails.XS_PAYMENT_TO_FROM_CONSUMER_INDIVIDUALS );
          o_ach_details.setMerchantReports( true );
          o_ach_details.setMerchantRepEmail( "John.Doe@email.com" );
        o_location.setAchDetails( o_ach_details );
        BankCardDetails o_bc_details = new BankCardDetails();
          o_bc_details.addCreditRequested( BankCardDetails.XS_CREDIT_REQUESTED_VISA_CREDIT );
          o_bc_details.addCreditRequested( BankCardDetails.XS_CREDIT_REQUESTED_MASTERCARD_CREDIT );
          o_bc_details.addCreditRequested( BankCardDetails.XS_CREDIT_REQUESTED_DISCOVER_CREDIT );
          o_bc_details.addDebitBrandsRequested( BankCardDetails.XS_DEBIT_BRANDS_REQUESTED_VISA);
          o_bc_details.addDebitBrandsRequested( BankCardDetails.XS_DEBIT_BRANDS_REQUESTED_MASTERCARD );
          o_bc_details.addDebitBrandsRequested( BankCardDetails.XS_DEBIT_BRANDS_REQUESTED_DISCOVER );
          o_bc_details.addDebitSignatureCardsRequested( BankCardDetails.XS_DEBIT_SIGNATURE_CARDS_REQUESTED_VISA );
          o_bc_details.addDebitSignatureCardsRequested( BankCardDetails.XS_DEBIT_SIGNATURE_CARDS_REQUESTED_MASTERCARD );
          o_bc_details.addDebitSignatureCardsRequested( BankCardDetails.XS_DEBIT_SIGNATURE_CARDS_REQUESTED_DISCOVER );
          o_bc_details.addOtherBrandsRequested( BankCardDetails.XS_OTHER_BRANDS_REQUESTED_AMERICAN_EXPRESS );
          o_bc_details.setCardPresentPercentage( 50 );
          o_bc_details.setInternetPercentage( 50 );
          o_bc_details.setAverageTicketAmount( 500 );
          o_bc_details.setAverageMonthlyVolume( 125000 );
          o_bc_details.setMaxTicket( 2000 );
          o_bc_details.setMaxMonthlyVolume( 200000 );
          o_bc_details.setAmexAverageTicketAmount( 500 );
          o_bc_details.setAmexAverageMonthlyVolume( 125000 );
          o_bc_details.setAmexMaxTicket( 2000 );
          o_bc_details.setAmexMaxMonthlyVolume( 200000 );
          o_bc_details.setAvs( 0.02 );
          o_bc_details.setBatchSettlement( 0.1 );
          o_bc_details.setChargebackFee( 35 );
          o_bc_details.setPciComplianceMonthly( 3.95 );
          o_bc_details.setRetrievalFee( 7.5 );
          o_bc_details.setPassThroughPlus( 0.45 );
          o_bc_details.setAuthorizationFee( 0.1 );
          o_bc_details.setTransactionFee( 0 );
          o_bc_details.setAmexPassThroughPlus( 0.45 );
          o_bc_details.setAmexAuthorizationFee( 0.1);
          o_bc_details.setAmexTransactionFee( 0 );
          o_bc_details.setRecurring( true );
          o_bc_details.setCardHolderDataStoredLocally( false );
          o_bc_details.setPrevTermAsAVisaMcMerchant( false );
          o_bc_details.setVisaMcSignage( true );
          o_bc_details.set3rdPartyAccessToCardholderData( false );
        o_location.SetBankCardDetails( o_bc_details );
        PrincipalContact o_contact = new PrincipalContact();
          o_contact.setFirstName( "John" );
          o_contact.setLastName( "Doe" );
          Address o_mailing = new Address( Address.XS_MAILING );
            o_mailing.setLine1( "9876 West 1st St East" );
            o_mailing.setCity( "Toontown" );
            o_mailing.setState( "AZ" );
            o_mailing.setZipcode( "85264" );
          o_contact.setMailingAddress( o_mailing );
          o_contact.setWorkPhoneNumber( "(480)555-1234" );
          o_contact.setMobilePhoneNumber( "(480)555-4789" );
          o_contact.setEmail( "John.Doe@email.com" );
          o_contact.setTitle( "Owner" );
          o_contact.setBirthdate( new Date() );
          o_contact.setOwnershipPercentage( 100 );
          o_contact.setContactType( PrincipalContact.X_CONTACT_TYPE_OWNER );
          o_contact.setSSN( "111-11-1111" );
        o_location.addPrincipalContact( o_contact );
        Internet o_internet = new Interent();
          o_internet.setDaysBetweenOrderAndShipping( 3 );
          o_internet.addShippedGoods( Internet.XS_SHIPPED_GOODS_FEDEX );
          o_internet.addShippedGoods( Internet.XS_SHIPPED_GOODS_UPS );
          o_internet.addReturnPolicy( Internet.XS_RETURN_POLICY_FULL_REFUND );
          o_internet.setFulfillmentVendorUtilizied( false );
          o_internet.setPercentOfSalesToNonUsCardholders( 2 );
          o_internet.setWebsiteIp( "192.168.1.0" );
          o_internet.addPoliciesAccessibleOnWebsite( Internet.XS_POLICIES_AVAILABLE_ON_WEBSITE_PRIVACY_POLICY );
          o_internet.addPoliciesAccessibleOnWebsite( Internet.XS_POLICIES_AVAILABLE_ON_WEBSITE_RETURN_AND_REFUND_POLICY );
          o_internet.addPoliciesAccessibleOnWebsite( Internet.XS_POLICIES_AVAILABLE_ON_WEBSITE_TERMS_OF_CONDITION_OF_SALE );
          o_internet.setGatewaySoftwareVendor( "Base Commerce" );
          o_internet.setGatewaySoftwareVersion( "1.25" );
          o_internet.setGatewaySoftwareName( "BaseLink" );
        o_location.setInternet( o_internet );
  o_merchant_application.addLocation( o_location );
     
System.out.println(" o_merchant_application json = " + o_merchant_application.getJSON() );
        try {
            List<MerchantApplication> o_merchant_application = o_client.submitApplication( o_merchant_application );
            for ( MerchantApplication o_merchant_application : o_merchant_application ) {
                System.out.println("\n\n o_merchant_application response code = " + o_app.getResponseCode() );
                System.out.println("\n\n o_merchant_application  response messages = " + o_app.getResponseMessages() );
            }
        } catch ( BaseCommerceClientException e ) {
            System.out.println( "error message = " + e.getMessage() );
            e.printStackTrace();
        }