From fc6fb061438bd9a75e48dd77dc0a3102f727ab39 Mon Sep 17 00:00:00 2001 From: adavidw Date: Tue, 10 Oct 2017 22:03:46 -0600 Subject: [PATCH] cleanup for consistent formatting --- .../create-customer-payment-profile.rb | 6 +++--- CustomerProfiles/create-customer-profile.rb | 7 +++---- .../create-customer-shipping-address.rb | 6 +++--- .../delete-customer-payment-profile.rb | 6 +++--- CustomerProfiles/delete-customer-profile.rb | 6 +++--- .../delete-customer-shipping-address.rb | 6 +++--- .../get-accept-customer-profile-page.rb | 7 +++---- .../get-customer-payment-profile-list.rb | 6 +++--- .../get-customer-payment-profile.rb | 7 +++---- CustomerProfiles/get-customer-profile-ids.rb | 6 +++--- CustomerProfiles/get-customer-profile.rb | 7 +++---- .../get-customer-shipping-address.rb | 9 ++++----- .../update-customer-payment-profile.rb | 6 +++--- CustomerProfiles/update-customer-profile.rb | 6 +++--- .../update-customer-shipping-address.rb | 6 +++--- .../validate-customer-payment-profile.rb | 4 ++-- .../approve-or-decline-held-transaction.rb | 9 ++++----- FraudManagement/get-held-transaction-list.rb | 7 +++---- .../create-an-accept-transaction.rb | 9 ++++----- .../create-an-android-pay-transaction.rb | 9 ++++----- .../create-an-apple-pay-transaction.rb | 9 ++++----- .../authorization-and-capture-continue.rb | 9 ++++----- .../authorization-and-capture.rb | 10 ++++------ .../authorization-only-continued.rb | 12 +++++------- PayPalExpressCheckout/authorization-only.rb | 9 ++++----- PayPalExpressCheckout/credit.rb | 11 +++++------ PayPalExpressCheckout/get-details.rb | 9 ++++----- .../prior-authorization-capture.rb | 9 ++++----- PayPalExpressCheckout/void.rb | 9 ++++----- PaymentTransactions/authorize-credit-card.rb | 17 ++++++++--------- ...-funds-authorized-through-another-channel.rb | 7 +++---- .../capture-previously-authorized-amount.rb | 13 ++++++------- PaymentTransactions/charge-credit-card.rb | 17 ++++++++--------- PaymentTransactions/charge-customer-profile.rb | 9 ++++----- .../charge-tokenized-credit-card.rb | 9 ++++----- .../create-an-accept-payment-transaction.rb | 7 +++---- PaymentTransactions/credit-bank-account.rb | 7 +++---- PaymentTransactions/debit-bank-account.rb | 7 +++---- .../get-an-accept-payment-page.rb | 7 +++---- PaymentTransactions/refund-transaction.rb | 9 ++++----- .../update-split-tender-group.rb | 8 ++++---- PaymentTransactions/void-transaction.rb | 9 ++++----- RecurringBilling/cancel-subscription.rb | 8 ++++---- ...create-subscription-from-customer-profile.rb | 7 +++---- RecurringBilling/create-subscription.rb | 6 ++---- RecurringBilling/get-list-of-subscriptions.rb | 9 ++++----- RecurringBilling/get-subscription-status.rb | 8 ++++---- RecurringBilling/get-subscription.rb | 6 +++--- RecurringBilling/update-subscription.rb | 7 +++---- 49 files changed, 181 insertions(+), 218 deletions(-) diff --git a/CustomerProfiles/create-customer-payment-profile.rb b/CustomerProfiles/create-customer-payment-profile.rb index c03c7a2..f95ace1 100644 --- a/CustomerProfiles/create-customer-payment-profile.rb +++ b/CustomerProfiles/create-customer-payment-profile.rb @@ -1,7 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/create-customer-profile.rb b/CustomerProfiles/create-customer-profile.rb index 1c74f16..9e457c5 100644 --- a/CustomerProfiles/create-customer-profile.rb +++ b/CustomerProfiles/create-customer-profile.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/create-customer-shipping-address.rb b/CustomerProfiles/create-customer-shipping-address.rb index f6714fe..d012a40 100644 --- a/CustomerProfiles/create-customer-shipping-address.rb +++ b/CustomerProfiles/create-customer-shipping-address.rb @@ -1,7 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/delete-customer-payment-profile.rb b/CustomerProfiles/delete-customer-payment-profile.rb index e4d1b37..3b66605 100644 --- a/CustomerProfiles/delete-customer-payment-profile.rb +++ b/CustomerProfiles/delete-customer-payment-profile.rb @@ -1,7 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/delete-customer-profile.rb b/CustomerProfiles/delete-customer-profile.rb index c1c3666..6e27364 100644 --- a/CustomerProfiles/delete-customer-profile.rb +++ b/CustomerProfiles/delete-customer-profile.rb @@ -1,7 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/delete-customer-shipping-address.rb b/CustomerProfiles/delete-customer-shipping-address.rb index a3bb0be..6515982 100644 --- a/CustomerProfiles/delete-customer-shipping-address.rb +++ b/CustomerProfiles/delete-customer-shipping-address.rb @@ -1,7 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/get-accept-customer-profile-page.rb b/CustomerProfiles/get-accept-customer-profile-page.rb index 5e66c4f..19c1338 100644 --- a/CustomerProfiles/get-accept-customer-profile-page.rb +++ b/CustomerProfiles/get-accept-customer-profile-page.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/get-customer-payment-profile-list.rb b/CustomerProfiles/get-customer-payment-profile-list.rb index f7b9693..bfb1bc6 100644 --- a/CustomerProfiles/get-customer-payment-profile-list.rb +++ b/CustomerProfiles/get-customer-payment-profile-list.rb @@ -1,7 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/get-customer-payment-profile.rb b/CustomerProfiles/get-customer-payment-profile.rb index 6a82dbe..f1bd3cf 100644 --- a/CustomerProfiles/get-customer-payment-profile.rb +++ b/CustomerProfiles/get-customer-payment-profile.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/get-customer-profile-ids.rb b/CustomerProfiles/get-customer-profile-ids.rb index e1873b0..7ba8b75 100644 --- a/CustomerProfiles/get-customer-profile-ids.rb +++ b/CustomerProfiles/get-customer-profile-ids.rb @@ -1,7 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/get-customer-profile.rb b/CustomerProfiles/get-customer-profile.rb index 7032913..835c13b 100644 --- a/CustomerProfiles/get-customer-profile.rb +++ b/CustomerProfiles/get-customer-profile.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/get-customer-shipping-address.rb b/CustomerProfiles/get-customer-shipping-address.rb index 00c35f3..81450c6 100644 --- a/CustomerProfiles/get-customer-shipping-address.rb +++ b/CustomerProfiles/get-customer-shipping-address.rb @@ -1,8 +1,7 @@ - require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'rubygems' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/update-customer-payment-profile.rb b/CustomerProfiles/update-customer-payment-profile.rb index c177b47..00e7383 100644 --- a/CustomerProfiles/update-customer-payment-profile.rb +++ b/CustomerProfiles/update-customer-payment-profile.rb @@ -1,7 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/update-customer-profile.rb b/CustomerProfiles/update-customer-profile.rb index 8d6c120..55e3e90 100644 --- a/CustomerProfiles/update-customer-profile.rb +++ b/CustomerProfiles/update-customer-profile.rb @@ -1,7 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/update-customer-shipping-address.rb b/CustomerProfiles/update-customer-shipping-address.rb index a425fb4..556ddf0 100644 --- a/CustomerProfiles/update-customer-shipping-address.rb +++ b/CustomerProfiles/update-customer-shipping-address.rb @@ -1,7 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/CustomerProfiles/validate-customer-payment-profile.rb b/CustomerProfiles/validate-customer-payment-profile.rb index 52dd4f6..1c5c646 100644 --- a/CustomerProfiles/validate-customer-payment-profile.rb +++ b/CustomerProfiles/validate-customer-payment-profile.rb @@ -1,7 +1,7 @@ require 'rubygems' require 'yaml' -require 'authorizenet' - require 'securerandom' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/FraudManagement/approve-or-decline-held-transaction.rb b/FraudManagement/approve-or-decline-held-transaction.rb index 7bb8b42..b8eb416 100644 --- a/FraudManagement/approve-or-decline-held-transaction.rb +++ b/FraudManagement/approve-or-decline-held-transaction.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -51,7 +50,7 @@ def approve_or_decline_held_transaction(refTransId) end return response -end + end if __FILE__ == $0 update_held_transaction("12345") diff --git a/FraudManagement/get-held-transaction-list.rb b/FraudManagement/get-held-transaction-list.rb index 0e25895..d7d058c 100644 --- a/FraudManagement/get-held-transaction-list.rb +++ b/FraudManagement/get-held-transaction-list.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/MobileInAppTransactions/create-an-accept-transaction.rb b/MobileInAppTransactions/create-an-accept-transaction.rb index 6321900..ee6c029 100644 --- a/MobileInAppTransactions/create-an-accept-transaction.rb +++ b/MobileInAppTransactions/create-an-accept-transaction.rb @@ -1,8 +1,7 @@ - require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'rubygems' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/MobileInAppTransactions/create-an-android-pay-transaction.rb b/MobileInAppTransactions/create-an-android-pay-transaction.rb index 53999bf..a5c3d34 100644 --- a/MobileInAppTransactions/create-an-android-pay-transaction.rb +++ b/MobileInAppTransactions/create-an-android-pay-transaction.rb @@ -1,8 +1,7 @@ - require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'rubygems' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/MobileInAppTransactions/create-an-apple-pay-transaction.rb b/MobileInAppTransactions/create-an-apple-pay-transaction.rb index 653d6ba..a5fa258 100644 --- a/MobileInAppTransactions/create-an-apple-pay-transaction.rb +++ b/MobileInAppTransactions/create-an-apple-pay-transaction.rb @@ -1,8 +1,7 @@ - require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'rubygems' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/PayPalExpressCheckout/authorization-and-capture-continue.rb b/PayPalExpressCheckout/authorization-and-capture-continue.rb index c5d0e1c..0247582 100644 --- a/PayPalExpressCheckout/authorization-and-capture-continue.rb +++ b/PayPalExpressCheckout/authorization-and-capture-continue.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -63,7 +62,7 @@ def authorization_and_capture_continue() return response -end + end if __FILE__ == $0 authorization_and_capture_continue() diff --git a/PayPalExpressCheckout/authorization-and-capture.rb b/PayPalExpressCheckout/authorization-and-capture.rb index b92e963..e945ef1 100644 --- a/PayPalExpressCheckout/authorization-and-capture.rb +++ b/PayPalExpressCheckout/authorization-and-capture.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -65,9 +64,8 @@ def authorization_and_capture() return response -end + end - if __FILE__ == $0 authorization_and_capture() end diff --git a/PayPalExpressCheckout/authorization-only-continued.rb b/PayPalExpressCheckout/authorization-only-continued.rb index 603b322..fd69c92 100644 --- a/PayPalExpressCheckout/authorization-only-continued.rb +++ b/PayPalExpressCheckout/authorization-only-continued.rb @@ -1,8 +1,7 @@ - require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'rubygems' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -64,9 +63,8 @@ def authorization_only_continued() return response -end + end - if __FILE__ == $0 authorization_only_continued() end diff --git a/PayPalExpressCheckout/authorization-only.rb b/PayPalExpressCheckout/authorization-only.rb index 4180258..5d05133 100644 --- a/PayPalExpressCheckout/authorization-only.rb +++ b/PayPalExpressCheckout/authorization-only.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -54,7 +53,7 @@ def authorization_only() return response -end + end if __FILE__ == $0 authorization_only() diff --git a/PayPalExpressCheckout/credit.rb b/PayPalExpressCheckout/credit.rb index ca59402..93f3727 100644 --- a/PayPalExpressCheckout/credit.rb +++ b/PayPalExpressCheckout/credit.rb @@ -1,8 +1,7 @@ - require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'rubygems' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -61,7 +60,7 @@ def credit() end return response -end + end if __FILE__ == $0 credit() diff --git a/PayPalExpressCheckout/get-details.rb b/PayPalExpressCheckout/get-details.rb index 7a2de60..fe20487 100644 --- a/PayPalExpressCheckout/get-details.rb +++ b/PayPalExpressCheckout/get-details.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -63,7 +62,7 @@ def get_details() return response -end + end if __FILE__ == $0 get_details() diff --git a/PayPalExpressCheckout/prior-authorization-capture.rb b/PayPalExpressCheckout/prior-authorization-capture.rb index d3026e8..8899cc0 100644 --- a/PayPalExpressCheckout/prior-authorization-capture.rb +++ b/PayPalExpressCheckout/prior-authorization-capture.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -106,7 +105,7 @@ def prior_authorization_capture() end return response -end + end if __FILE__ == $0 prior_authorization_capture() diff --git a/PayPalExpressCheckout/void.rb b/PayPalExpressCheckout/void.rb index be1475c..28ff7ce 100644 --- a/PayPalExpressCheckout/void.rb +++ b/PayPalExpressCheckout/void.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -97,7 +96,7 @@ def void() end return response -end + end if __FILE__ == $0 void() diff --git a/PaymentTransactions/authorize-credit-card.rb b/PaymentTransactions/authorize-credit-card.rb index 9aae708..a77f7e4 100644 --- a/PaymentTransactions/authorize-credit-card.rb +++ b/PaymentTransactions/authorize-credit-card.rb @@ -1,8 +1,7 @@ -require "rubygems" - require "yaml" - require "authorizenet" - - require "securerandom" +require 'rubygems' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -25,10 +24,10 @@ def authorize_credit_card() request.transactionRequest.transactionType = TransactionTypeEnum::AuthOnlyTransaction userFieldArr = Array.new - userField = UserField.new("userFieldName","userFieldvalue") - userFieldArr.push(userField) - userField = UserField.new("userFieldName1","userFieldvalue1") - userFieldArr.push(userField) + requestUserField = UserField.new("userFieldName","userFieldvalue") + userFieldArr.push(requestUserField) + requestUserField = UserField.new("userFieldName1","userFieldvalue1") + userFieldArr.push(requestUserField) request.transactionRequest.userFields = UserFields.new(userFieldArr) diff --git a/PaymentTransactions/capture-funds-authorized-through-another-channel.rb b/PaymentTransactions/capture-funds-authorized-through-another-channel.rb index 411333f..bf8cf42 100644 --- a/PaymentTransactions/capture-funds-authorized-through-another-channel.rb +++ b/PaymentTransactions/capture-funds-authorized-through-another-channel.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/PaymentTransactions/capture-previously-authorized-amount.rb b/PaymentTransactions/capture-previously-authorized-amount.rb index 0350fdf..bceff6f 100644 --- a/PaymentTransactions/capture-previously-authorized-amount.rb +++ b/PaymentTransactions/capture-previously-authorized-amount.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -23,7 +22,7 @@ def capture_previously_authorized_amount() response = transaction.create_transaction(request) - authTransId = 0 + authTransId = response.transactionResponse.transId if response != nil if response.messages.resultCode == MessageTypeEnum::Ok @@ -61,7 +60,7 @@ def capture_previously_authorized_amount() request.transactionRequest = TransactionRequestType.new() request.transactionRequest.amount = random_amount - request.transactionRequest.refTransId = response.transactionResponse.transId + request.transactionRequest.refTransId = authTransId request.transactionRequest.transactionType = TransactionTypeEnum::PriorAuthCaptureTransaction response = transaction.create_transaction(request) @@ -98,7 +97,7 @@ def capture_previously_authorized_amount() end return response -end + end if __FILE__ == $0 capture_previously_authorized_amount() diff --git a/PaymentTransactions/charge-credit-card.rb b/PaymentTransactions/charge-credit-card.rb index d4b9b42..fca5207 100644 --- a/PaymentTransactions/charge-credit-card.rb +++ b/PaymentTransactions/charge-credit-card.rb @@ -1,8 +1,7 @@ -require "rubygems" - require "yaml" - require "authorizenet" - - require "securerandom" +require 'rubygems' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -25,10 +24,10 @@ def charge_credit_card() request.transactionRequest.transactionType = TransactionTypeEnum::AuthCaptureTransaction userFieldArr = Array.new - userField = UserField.new("userFieldName","userFieldvalue") - userFieldArr.push(userField) - userField = UserField.new("userFieldName1","userFieldvalue1") - userFieldArr.push(userField) + requestUserField = UserField.new("userFieldName","userFieldvalue") + userFieldArr.push(requestUserField) + requestUserField = UserField.new("userFieldName1","userFieldvalue1") + userFieldArr.push(requestUserField) request.transactionRequest.userFields = UserFields.new(userFieldArr) diff --git a/PaymentTransactions/charge-customer-profile.rb b/PaymentTransactions/charge-customer-profile.rb index e4293b9..a9e14cd 100644 --- a/PaymentTransactions/charge-customer-profile.rb +++ b/PaymentTransactions/charge-customer-profile.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -54,7 +53,7 @@ def charge_customer_profile(customerProfileId = '36731856', customerPaymentProfi end return response -end + end if __FILE__ == $0 charge_customer_profile() diff --git a/PaymentTransactions/charge-tokenized-credit-card.rb b/PaymentTransactions/charge-tokenized-credit-card.rb index 2523e59..e035b77 100644 --- a/PaymentTransactions/charge-tokenized-credit-card.rb +++ b/PaymentTransactions/charge-tokenized-credit-card.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -53,7 +52,7 @@ def charge_tokenized_credit_card() end return response -end + end if __FILE__ == $0 charge_tokenized_credit_card() diff --git a/PaymentTransactions/create-an-accept-payment-transaction.rb b/PaymentTransactions/create-an-accept-payment-transaction.rb index f78b276..634e8d6 100644 --- a/PaymentTransactions/create-an-accept-payment-transaction.rb +++ b/PaymentTransactions/create-an-accept-payment-transaction.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/PaymentTransactions/credit-bank-account.rb b/PaymentTransactions/credit-bank-account.rb index bb31600..71d00c2 100644 --- a/PaymentTransactions/credit-bank-account.rb +++ b/PaymentTransactions/credit-bank-account.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/PaymentTransactions/debit-bank-account.rb b/PaymentTransactions/debit-bank-account.rb index a71c7d5..6e34550 100644 --- a/PaymentTransactions/debit-bank-account.rb +++ b/PaymentTransactions/debit-bank-account.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/PaymentTransactions/get-an-accept-payment-page.rb b/PaymentTransactions/get-an-accept-payment-page.rb index 4592070..b0969dd 100644 --- a/PaymentTransactions/get-an-accept-payment-page.rb +++ b/PaymentTransactions/get-an-accept-payment-page.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/PaymentTransactions/refund-transaction.rb b/PaymentTransactions/refund-transaction.rb index e64d386..471512e 100644 --- a/PaymentTransactions/refund-transaction.rb +++ b/PaymentTransactions/refund-transaction.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -54,7 +53,7 @@ def refund_transaction() end return response -end + end if __FILE__ == $0 refund_transaction() diff --git a/PaymentTransactions/update-split-tender-group.rb b/PaymentTransactions/update-split-tender-group.rb index a83a96d..8f6868a 100644 --- a/PaymentTransactions/update-split-tender-group.rb +++ b/PaymentTransactions/update-split-tender-group.rb @@ -1,7 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -37,7 +37,7 @@ def update_split_tender_group() end return response -end + end if __FILE__ == $0 update_split_tender_group() diff --git a/PaymentTransactions/void-transaction.rb b/PaymentTransactions/void-transaction.rb index 3164595..2283e10 100644 --- a/PaymentTransactions/void-transaction.rb +++ b/PaymentTransactions/void-transaction.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -97,7 +96,7 @@ def void_transaction() end return response -end + end if __FILE__ == $0 void_transaction() diff --git a/RecurringBilling/cancel-subscription.rb b/RecurringBilling/cancel-subscription.rb index f08bb07..148ed5d 100644 --- a/RecurringBilling/cancel-subscription.rb +++ b/RecurringBilling/cancel-subscription.rb @@ -1,7 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -29,7 +29,7 @@ def cancel_subscription(subscriptionId = '2790501',refId = '2238251168') raise "Failed to cancel a subscription" end return response - end + end if __FILE__ == $0 cancel_subscription() diff --git a/RecurringBilling/create-subscription-from-customer-profile.rb b/RecurringBilling/create-subscription-from-customer-profile.rb index 315ee89..a71c4af 100644 --- a/RecurringBilling/create-subscription-from-customer-profile.rb +++ b/RecurringBilling/create-subscription-from-customer-profile.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/RecurringBilling/create-subscription.rb b/RecurringBilling/create-subscription.rb index 5eb7d92..407ff8f 100644 --- a/RecurringBilling/create-subscription.rb +++ b/RecurringBilling/create-subscription.rb @@ -1,9 +1,7 @@ require 'rubygems' require 'yaml' -require 'authorizenet' - - - require 'securerandom' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/RecurringBilling/get-list-of-subscriptions.rb b/RecurringBilling/get-list-of-subscriptions.rb index c997d75..b24ab0f 100644 --- a/RecurringBilling/get-list-of-subscriptions.rb +++ b/RecurringBilling/get-list-of-subscriptions.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -44,7 +43,7 @@ def get_list_of_subscriptions() end end return response - end + end if __FILE__ == $0 get_list_of_subscriptions() diff --git a/RecurringBilling/get-subscription-status.rb b/RecurringBilling/get-subscription-status.rb index b62d09a..36e1a5f 100644 --- a/RecurringBilling/get-subscription-status.rb +++ b/RecurringBilling/get-subscription-status.rb @@ -1,7 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API @@ -28,7 +28,7 @@ def get_subscription_status(subscriptionId = '2790501') end return response -end + end if __FILE__ == $0 get_subscription_status() diff --git a/RecurringBilling/get-subscription.rb b/RecurringBilling/get-subscription.rb index 5161933..5160503 100644 --- a/RecurringBilling/get-subscription.rb +++ b/RecurringBilling/get-subscription.rb @@ -1,7 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API diff --git a/RecurringBilling/update-subscription.rb b/RecurringBilling/update-subscription.rb index ffb0e39..7ed61f6 100644 --- a/RecurringBilling/update-subscription.rb +++ b/RecurringBilling/update-subscription.rb @@ -1,8 +1,7 @@ require 'rubygems' - require 'yaml' - require 'authorizenet' - - require 'securerandom' +require 'yaml' +require 'authorizenet' +require 'securerandom' include AuthorizeNet::API