Skip to content

Commit

Permalink
- Adding responsecode and messagecode prints.
Browse files Browse the repository at this point in the history
  • Loading branch information
srathod committed Aug 26, 2016
1 parent 28a95d0 commit 4a0010e
Show file tree
Hide file tree
Showing 22 changed files with 43 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MobileInappTransactions/create-an-accept-transaction.js
Expand Up @@ -42,6 +42,8 @@ function createApplePayTransaction(callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions MobileInappTransactions/create-an-android-pay-transaction.js
Expand Up @@ -42,6 +42,8 @@ function createApplePayTransaction(callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions MobileInappTransactions/create-an-apple-pay-transaction.js
Expand Up @@ -42,6 +42,8 @@ function createApplePayTransaction(callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaymentTransactions/authorize-credit-card.js
Expand Up @@ -144,6 +144,8 @@ function authorizeCreditCard(callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
Expand Up @@ -51,6 +51,8 @@ function captureFundsAuthorizedThroughAnotherChannel(callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaymentTransactions/capture-previously-authorized-amount.js
Expand Up @@ -39,6 +39,8 @@ function capturePreviouslyAuthorizedAmount(transactionId, callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaymentTransactions/charge-credit-card.js
Expand Up @@ -147,6 +147,8 @@ function chargeCreditCard(callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaymentTransactions/charge-customer-profile.js
Expand Up @@ -82,6 +82,8 @@ function chargeCustomerProfile(customerProfileId, customerPaymentProfileId, call
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaymentTransactions/charge-tokenized-credit-card.js
Expand Up @@ -144,6 +144,8 @@ function chargeTokenizedCreditCard(callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaymentTransactions/credit-bank-account.js
Expand Up @@ -52,6 +52,8 @@ function creditBankAccount(transactionId, callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaymentTransactions/debit-bank-account.js
Expand Up @@ -114,6 +114,8 @@ function debitBankAccount(callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaymentTransactions/refund-transaction.js
Expand Up @@ -45,6 +45,8 @@ function refundTransaction(transactionId, callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaymentTransactions/void-transaction.js
Expand Up @@ -35,6 +35,8 @@ function voidTransaction(transactionId, callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaypalExpressCheckout/authorization-and-capture-continue.js
Expand Up @@ -45,6 +45,8 @@ function authorizationAndCaptureContinue(transactionId, callback) {
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Payer Id: ' + response.getTransactionResponse().getSecureAcceptance().getPayerID());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaypalExpressCheckout/authorization-and-capture.js
Expand Up @@ -44,6 +44,8 @@ function authorizationAndCapture(callback) {
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Secure Acceptance URL: ' + response.getTransactionResponse().getSecureAcceptance().getSecureAcceptanceUrl());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaypalExpressCheckout/authorization-only-continued.js
Expand Up @@ -45,6 +45,8 @@ function authorizationOnlyContinued(transactionId, callback) {
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Payer Id: ' + response.getTransactionResponse().getSecureAcceptance().getPayerID());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaypalExpressCheckout/authorization-only.js
Expand Up @@ -43,6 +43,8 @@ function authorizationOnly(callback) {
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Secure Acceptance URL: ' + response.getTransactionResponse().getSecureAcceptance().getSecureAcceptanceUrl());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaypalExpressCheckout/credit.js
Expand Up @@ -44,6 +44,8 @@ function credit(transactionId, callback) {
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Secure Acceptance URL: ' + response.getTransactionResponse().getSecureAcceptance().getSecureAcceptanceUrl());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
1 change: 1 addition & 0 deletions PaypalExpressCheckout/get-details.js
Expand Up @@ -42,6 +42,7 @@ function getDetails(transactionId, callback) {
if(response.getTransactionResponse().getMessages() != null){
console.log('Paypal Get Detail Successful.');
console.log('Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
}
else {
console.log('Failed Transaction.');
Expand Down
2 changes: 2 additions & 0 deletions PaypalExpressCheckout/prior-authorization-capture.js
Expand Up @@ -43,6 +43,8 @@ function priorAuthorizationCapture(transactionId, callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions PaypalExpressCheckout/void.js
Expand Up @@ -41,6 +41,8 @@ function paypalVoid(transactionId, callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down
2 changes: 2 additions & 0 deletions VisaCheckout/create-visa-checkout-transaction.js
Expand Up @@ -41,6 +41,8 @@ function createVisaCheckoutTransaction(callback) {
if(response.getMessages().getResultCode() == ApiContracts.MessageTypeEnum.OK){
if(response.getTransactionResponse().getMessages() != null){
console.log('Successfully created transaction with Transaction ID: ' + response.getTransactionResponse().getTransId());
console.log('Response Code: ' + response.getTransactionResponse().getResponseCode());
console.log('Message Code: ' + response.getTransactionResponse().getMessages().getMessage()[0].getCode());
console.log('Description: ' + response.getTransactionResponse().getMessages().getMessage()[0].getDescription());
}
else {
Expand Down

0 comments on commit 4a0010e

Please sign in to comment.