Page tree

Versions Compared

Key

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

...

Code Block
languagejava
        BaseCommerceClient o_client = new BaseCommerceClient( XS_USERNAME, XS_PASSWORD, XS_KEY );
        o_client.setSandbox(true);
       
       PushNotification o_push_notification = o_client.handlePushNotification(s_push_notification_bank_card_transaction);
        if( o_push_notification != null ) {
            if( o_push_notification.isNotificationType(PushNotification.XS_PN_TYPE_BANK_CARD_UPDATE) ) {
                BankCardUpdate o_bank_card_update = o_push_notification.getBankCardUpdate();
                if( o_bank_card_update != null ) {
                    System.out.println("Status :" + o_bank_card_update.getStatus());
                    System.out.println("original Card Number :" + o_bank_card_update.getOriginalNumber());
                    System.out.println("original Token Number :" + o_bank_card_update.getOriginalToken());
                    System.out.println("Updated Card Number :" + o_bank_card_update.getUpdatedNumber());
                    System.out.println("Updated Card Number Expiry Month :" + o_bank_card_update.getUpdatedExpirationMonth());
                    System.out.println("Updated Card Number Expiry Year :" + o_bank_card_update.getUpdatedExpirationYear());
                }
        
            }
            
            if ( o_push_notification.isNotificationType(PushNotification.XS_PN_TYPE_SETTLEMENT_BATCH_CHANGE) ) {
                SettlementBatch o_settlement_batch = o_push_notification.getSettlementBatch();
                if(o_settlement_batch != null) {
                    System.out.println("BankAccountTransactionCreditAmount the dollar amount of credits in that merchant's settlement batch (ACH batch specific): " + o_settlement_batch.getBankAccountTransactionCreditAmount());
                    System.out.println("BankAccountTransactionCreditCount the count of credit transactions in that merchant's settlement batch(ACH batch specific): " + o_settlement_batch.getBankAccountTransactionCreditCount());
                    System.out.println("BankAccountTransactionDebitAmount the dollar amount of debits in that merchant's settlement batch(ACH batch specific): " + o_settlement_batch.getBankAccountTransactionDebitAmount());
                    System.out.println("BankAccountTransactionDebitCount the count of debit transactions in that merchant's settlement batch(ACH batch specific): " + o_settlement_batch.getBankAccountTransactionDebitCount());
                    System.out.println("BankCardTransactionCreditAmount the dollar amount of credits in that merchant's settlement batch(bank card batch specific): " + o_settlement_batch.getBankCardTransactionCreditAmount());
                    System.out.println("BankCardTransactionCreditCount the count of credit transactions in that merchant's settlement batch(bank card batch specific): " + o_settlement_batch.getBankCardTransactionCreditCount());
                    System.out.println("BankCardTransactionSaleAmount the dollar amount of sales in that merchant's settlement batch(bank card batch specific): " + o_settlement_batch.getBankCardTransactionSaleAmount());
                    System.out.println("BankCardTransactionSaleCount the count of sales transactions in that merchant's settlement batch(bank card batch specific): " + o_settlement_batch.getBankCardTransactionSaleCount());
                    System.out.println("BankAccountTransactionIDs a list of BankAccountTransactionIDs that were included in the batch(ACH batch specific): " + o_settlement_batch.getBankAccountTransactionIDs());
                    System.out.println("BankCardTransactionIDs a list of BankCardTransactionIDs that were included in the batch(bank card batch specific)" + o_settlement_batch.getBankCardTransactionIDs());
                    System.out.println("The date the batch is going to fund to the merchants account(bank account batch specific)" + o_settlement_batch.getBankAccountTransactionSettlementBatchFundingDate() );
                    System.out.println("The date the batch is going to settle to the merchants account(bank account batch specific)" + o_settlement_batch.getBankAccountTransactionSettlementBatchSettlementDate() );
					System.out.println("The date the batch is going to fund to the merchants account(bank card batch specific)" + o_settlement_batch.getBankCardTransactionSettlementBatchFundingDate() );
                    System.out.println("The date the batch is going to settle to the merchants account(bank card batch specific)" + o_settlement_batch.getBankCardTransactionSettlementBatchSettlementDate() ); 
					System.out.println("The unique ID of the settlement batch(bank account batch specific)" + o_settlement_batch.getBankAccountTransactionSettlementBatchID() );
                    System.out.println("The unique ID of the settlement batch(bank card batch specific)" + o_settlement_batch.getBankCardTransactionSettlementBatchID() );
                    
                }
            }
            
            if( o_push_notification.isNotificationType(PushNotification.XS_PN_TYPE_BANK_CARD_TRANSACTION) ) {
                BankCardTransaction o_bct = o_push_notification.getBankCardTransaction();
                if( o_bct != null ) {
                    System.out.println("AVSResponseCode : " + o_bct.getAVSResponseCode());
                    System.out.println("Amount : " + o_bct.getAmount());
                    System.out.println("Billing Address : " + o_bct.getBillingAddress());
                    System.out.println("Card Number: " + o_bct.getCardNumber());
                    System.out.println("Card CVV2:" + o_bct.getCardCVV2());
                }
            }
            
            if( o_push_notification.isNotificationType(PushNotification.XS_PN_TYPE_ACH_CHANGE) ) {
                BankAccountTransaction o_bat = o_push_notification.getBankAccountTransaction();
                if( o_bat != null ) {
                    System.out.println("Account Name on the bank account transaction: " + o_bat.getAccountName() );
                    System.out.println("Account Number on the bank account transaction: " + o_bat.getAccountNumber() );
                    System.out.println("Account Type on the bank account transaction: " + o_bat.getAccountType() );
                    System.out.println("Amount on the bank account transaction: " + o_bat.getAmount() );
                    System.out.println("Check Number on the bank account transaction: " + o_bat.getCheckNumber() );
                    System.out.println("Creation Date on the bank account transaction:" + o_bat.getCreationDate() );
                    System.out.println("Effective Date on the bank account transaction:" + o_bat.getEffectiveDate() );
                    System.out.println("Settlement Date on the bank account transaction:" + o_bat.getSettlementDate() );
                }
            }


			if ( o_push_notification.isNotificationType( PushNotification.XS_PN_TYPE_INCOMIMG_MERLIN_CHARGEBACK ) ) {
                
                MerlinChargeback o_merlin_chargeback = o_push_notification.getIncomingMerlinChargeback();
                if ( o_merlin_chargeback != null ) {
                    
                    System.out.println( "Merlin Chargeback Fields\n~~~~~~~~~~~~~~~~~~~~~~~~" );
                    System.out.println( "Acquirer Reference Number: " + o_merlin_chargeback.getAcquirerRefNum() );
                    System.out.println( "Chargeback Amount: " + o_merlin_chargeback.getAmount() );
                    System.out.println( "Authorization Code: " + o_merlin_chargeback.getAuthorizationCode() );
                    System.out.println( "Amount resolved to Bank: " + o_merlin_chargeback.getBankAmount() );
                    System.out.println( "BaseCommerce Transaction ID: " + o_merlin_chargeback.getBankCardTransactionID() );
                    System.out.println( "Comment sent to the Bank: " + o_merlin_chargeback.getBankComment() );
                    System.out.println( "Card Brand: " + o_merlin_chargeback.getCardBrand() );
                    System.out.println( "Card Number: " + o_merlin_chargeback.getCardholderAccount() );
                    System.out.println( "Merlin Case Number: " + o_merlin_chargeback.getCaseNumber() );
                    System.out.println( "Type of the Case: " + o_merlin_chargeback.getCaseType() );
                    System.out.println( "Bank sending document (1) or not (2): " + o_merlin_chargeback.getDocumentIndicator() );
                    System.out.println( "Family ID of linked cases: " + o_merlin_chargeback.getFamilyId() );
                    System.out.println( "Amount resolved to GL Account:" + o_merlin_chargeback.getGlAmountOne() );
                    System.out.println( "Comment sent to the GL account: " + o_merlin_chargeback.getGlCommentOne() );
                    System.out.println( "Issuer Reference Number: " + o_merlin_chargeback.getIssuerReferenceNumber() );
                    System.out.println( "Load Date: " + o_merlin_chargeback.getLoadDate() );
                    System.out.println( "Message from the issuer: " + o_merlin_chargeback.getMemberMessageBlock() );
                    System.out.println( "Amount resolved to Merchant: " + o_merlin_chargeback.getMerchantAmount() );
                    System.out.println( "Merchant Category Code: " + o_merlin_chargeback.getMerchantCategoryCode() );
                    System.out.println( "Comment sent to the Merchant: " + o_merlin_chargeback.getMerchantComment() );
                    System.out.println( "Merchant's Identifying Number: " + o_merlin_chargeback.getMerchantNumber() );
                    System.out.println( "Post Date: " + o_merlin_chargeback.getPostDate() );
                    System.out.println( "Processor: " + o_merlin_chargeback.getProcessor() );
                    System.out.println( "Reason Code: " + o_merlin_chargeback.getReasonCode() );
                    System.out.println( "Received Date: " + o_merlin_chargeback.getReceivedDate() );
                    System.out.println( "Record Type ('R' for reversal, 'space' for regular): " + o_merlin_chargeback.getRecordType() );
                    System.out.println( "Request ID: " + o_merlin_chargeback.getRequestId() );
                    System.out.println( "Resolved Date: " + o_merlin_chargeback.getResolvedDate() );
                    System.out.println( "Institution this case was Resolved To: " + o_merlin_chargeback.getResolvedTo() );
                    System.out.println( "Transaction Code: " + o_merlin_chargeback.getTransactionCode() );
                    System.out.println( "Transaction Date: " + o_merlin_chargeback.getTransactionDate() );
                    
                }
            }

        }

...