Skip to content

Commit ed0b02e

Browse files
author
srathod
committed
- Adding responsecode and message code prints.
1 parent ed5bd0a commit ed0b02e

22 files changed

Lines changed: 47 additions & 4 deletions

MobileInappTransactions/create-an-accept-transaction.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def create_an_accept_transaction():
3838
if response.messages.resultCode == "Ok":
3939
if hasattr(response.transactionResponse, 'messages') == True:
4040
print ('Successfully created transaction with Transaction ID: %s' % response.transactionResponse.transId);
41+
print ('Transaction Response Code: %s' % response.transactionResponse.responseCode);
42+
print ('Message Code: %s' % response.transactionResponse.messages.message[0].code);
4143
print ('Description: %s' % response.transactionResponse.messages.message[0].description);
4244
print ('AUTH Code : %s' % response.authCode)
4345
else:

MobileInappTransactions/create-an-android-pay-transaction.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def create_an_android_pay_transaction():
3838
if response.messages.resultCode == "Ok":
3939
if hasattr(response.transactionResponse, 'messages') == True:
4040
print ('Successfully created transaction with Transaction ID: %s' % response.transactionResponse.transId);
41+
print ('Transaction Response Code: %s' % response.transactionResponse.responseCode);
42+
print ('Message Code: %s' % response.transactionResponse.messages.message[0].code);
4143
print ('Description: %s' % response.transactionResponse.messages.message[0].description);
4244
print ('AUTH Code : %s' % response.authCode)
4345
else:

MobileInappTransactions/create-an-apple-pay-transaction.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def create_an_apple_pay_transaction():
3838
if response.messages.resultCode == "Ok":
3939
if hasattr(response.transactionResponse, 'messages') == True:
4040
print ('Successfully created transaction with Transaction ID: %s' % response.transactionResponse.transId);
41+
print ('Transaction Response Code: %s' % response.transactionResponse.responseCode);
42+
print ('Message Code: %s' % response.transactionResponse.messages.message[0].code);
4143
print ('Description: %s' % response.transactionResponse.messages.message[0].description);
4244
print ('AUTH Code : %s' % response.authCode)
4345
else:

PaymentTransactions/authorize-credit-card.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from decimal import *
99

1010
def authorize_credit_card():
11-
1211
amount = str(round(random.random()*100, 2))
1312

1413
merchantAuth = apicontractsv1.merchantAuthenticationType()
@@ -42,6 +41,8 @@ def authorize_credit_card():
4241
if response.messages.resultCode == "Ok":
4342
if hasattr(response.transactionResponse, 'messages') == True:
4443
print ('Successfully created transaction with Transaction ID: %s' % response.transactionResponse.transId);
44+
print ('Transaction Response Code: %s' % response.transactionResponse.responseCode);
45+
print ('Message Code: %s' % response.transactionResponse.messages.message[0].code);
4546
print ('Description: %s' % response.transactionResponse.messages.message[0].description);
4647
else:
4748
print ('Failed Transaction.');

PaymentTransactions/capture-funds-authorized-through-another-channel.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def capture_funds_authorized_through_another_channel():
4242
if response.messages.resultCode == "Ok":
4343
if hasattr(response.transactionResponse, 'messages') == True:
4444
print ('Successfully created transaction with Transaction ID: %s' % response.transactionResponse.transId);
45+
print ('Transaction Response Code: %s' % response.transactionResponse.responseCode);
46+
print ('Message Code: %s' % response.transactionResponse.messages.message[0].code);
4547
print ('Description: %s' % response.transactionResponse.messages.message[0].description);
4648
else:
4749
print ('Failed Transaction.');

PaymentTransactions/capture-previously-authorized-amount.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ def capture_previously_authorized_amount():
3333
if response.messages.resultCode == "Ok":
3434
if hasattr(response.transactionResponse, 'messages') == True:
3535
print ('Successfully created transaction with Transaction ID: %s' % response.transactionResponse.transId);
36+
print ('Transaction Response Code: %s' % response.transactionResponse.responseCode);
37+
print ('Message Code: %s' % response.transactionResponse.messages.message[0].code);
3638
print ('Description: %s' % response.transactionResponse.messages.message[0].description);
3739
else:
3840
print ('Failed Transaction.');

PaymentTransactions/charge-credit-card.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def charge_credit_card(amount):
3838
if response.messages.resultCode == "Ok":
3939
if hasattr(response.transactionResponse, 'messages') == True:
4040
print ('Successfully created transaction with Transaction ID: %s' % response.transactionResponse.transId);
41+
print ('Transaction Response Code: %s' % response.transactionResponse.responseCode);
42+
print ('Message Code: %s' % response.transactionResponse.messages.message[0].code);
4143
print ('Description: %s' % response.transactionResponse.messages.message[0].description);
4244
else:
4345
print ('Failed Transaction.');

PaymentTransactions/charge-customer-profile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def charge_customer_profile(customerProfileId, paymentProfileId, amount):
3737
if response.messages.resultCode == "Ok":
3838
if hasattr(response.transactionResponse, 'messages') == True:
3939
print ('Successfully created transaction with Transaction ID: %s' % response.transactionResponse.transId);
40+
print ('Transaction Response Code: %s' % response.transactionResponse.responseCode);
41+
print ('Message Code: %s' % response.transactionResponse.messages.message[0].code);
4042
print ('Description: %s' % response.transactionResponse.messages.message[0].description);
4143
else:
4244
print ('Failed Transaction.');

PaymentTransactions/charge-tokenized-credit-card.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def charge_tokenized_credit_card():
3838
if response.messages.resultCode == "Ok":
3939
if hasattr(response.transactionResponse, 'messages') == True:
4040
print ('Successfully created transaction with Transaction ID: %s' % response.transactionResponse.transId);
41+
print ('Transaction Response Code: %s' % response.transactionResponse.responseCode);
42+
print ('Message Code: %s' % response.transactionResponse.messages.message[0].code);
4143
print ('Description: %s' % response.transactionResponse.messages.message[0].description);
4244
else:
4345
print ('Failed Transaction.');

PaymentTransactions/credit-bank-account.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def credit_bank_account():
4343
if response.messages.resultCode == "Ok":
4444
if hasattr(response.transactionResponse, 'messages') == True:
4545
print ('Successfully created transaction with Transaction ID: %s' % response.transactionResponse.transId);
46+
print ('Transaction Response Code: %s' % response.transactionResponse.responseCode);
47+
print ('Message Code: %s' % response.transactionResponse.messages.message[0].code);
4648
print ('Description: %s' % response.transactionResponse.messages.message[0].description);
4749
else:
4850
print ('Failed Transaction.');

0 commit comments

Comments
 (0)