diff --git a/PaymentTransactions/capture-previously-authorized-amount.py b/PaymentTransactions/capture-previously-authorized-amount.py index 9df0a67..48d7b70 100644 --- a/PaymentTransactions/capture-previously-authorized-amount.py +++ b/PaymentTransactions/capture-previously-authorized-amount.py @@ -6,7 +6,7 @@ constants = imp.load_source('modulename', 'constants.py') from decimal import * -def capture_previously_authorized_amount(): +def capture_previously_authorized_amount(transactionId): merchantAuth = apicontractsv1.merchantAuthenticationType() merchantAuth.name = constants.apiLoginId merchantAuth.transactionKey = constants.transactionKey @@ -15,9 +15,7 @@ def capture_previously_authorized_amount(): transactionrequest = apicontractsv1.transactionRequestType() transactionrequest.transactionType = "priorAuthCaptureTransaction" transactionrequest.amount = Decimal ('2.55') - transactionrequest.refTransId = "2245440574" - - + transactionrequest.refTransId = transactionId createtransactionrequest = apicontractsv1.createTransactionRequest() createtransactionrequest.merchantAuthentication = merchantAuth @@ -55,4 +53,4 @@ def capture_previously_authorized_amount(): return response if(os.path.basename(__file__) == os.path.basename(sys.argv[0])): - capture_previously_authorized_amount() + capture_previously_authorized_amount('12345678') diff --git a/list_of_sample_codes.txt b/list_of_sample_codes.txt index 4fb7b77..f083ab8 100644 --- a/list_of_sample_codes.txt +++ b/list_of_sample_codes.txt @@ -23,7 +23,7 @@ charge_tokenized_credit_card 1 0 credit_bank_account 1 0 debit_bank_account 1 1 refund_transaction 1 0 -update_split_tender_group 1 1 +update_split_tender_group 1 0 void_transaction 1 0 authorization_and_capture_continue 1 1 authorization_and_capture 1 1 diff --git a/test-runner.py b/test-runner.py index 274bd7a..5cd923c 100644 --- a/test-runner.py +++ b/test-runner.py @@ -320,8 +320,12 @@ def capture_funds_authorized_through_another_channel(self): def capture_previously_authorized_amount(self): print("capture_previously_authorized_amount") + + modl = imp.load_source('modulename', 'PaymentTransactions/authorize-credit-card.py') + response = modl.authorize_credit_card() + modl = imp.load_source('modulename', 'PaymentTransactions/capture-previously-authorized-amount.py') - return modl.capture_previously_authorized_amount() + return modl.capture_previously_authorized_amount(response.transactionResponse.transId) def charge_credit_card(self): print("charge_credit_card")