authorizenetsample 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/CustomerProfiles/get-accept-customer-profile-page.rb +5 -23
- data/lib/CustomerProfiles/get-customer-profile.rb +3 -39
- data/lib/PaymentTransactions/create-an-accept-payment-transaction.rb +5 -45
- data/lib/PaymentTransactions/get-an-accept-payment-page.rb +49 -70
- data/lib/authorizenetsample.rb +12 -4
- metadata +6 -69
- data/lib/CustomerProfiles/create-customer-payment-profile.rb +0 -62
- data/lib/CustomerProfiles/create-customer-profile-from-transaction.rb +0 -51
- data/lib/CustomerProfiles/create-customer-profile.rb +0 -92
- data/lib/CustomerProfiles/create-customer-shipping-address.rb +0 -31
- data/lib/CustomerProfiles/delete-customer-payment-profile.rb +0 -32
- data/lib/CustomerProfiles/delete-customer-profile.rb +0 -31
- data/lib/CustomerProfiles/delete-customer-shipping-address.rb +0 -33
- data/lib/CustomerProfiles/get-customer-payment-profile-list.rb +0 -54
- data/lib/CustomerProfiles/get-customer-payment-profile.rb +0 -40
- data/lib/CustomerProfiles/get-customer-profile-ids.rb +0 -45
- data/lib/CustomerProfiles/get-customer-shipping-address.rb +0 -41
- data/lib/CustomerProfiles/update-customer-payment-profile.rb +0 -37
- data/lib/CustomerProfiles/update-customer-profile.rb +0 -37
- data/lib/CustomerProfiles/update-customer-shipping-address.rb +0 -37
- data/lib/CustomerProfiles/validate-customer-payment-profile.rb +0 -37
- data/lib/FraudManagement/approve-or-decline-held-transaction.rb +0 -57
- data/lib/FraudManagement/get-held-transaction-list.rb +0 -47
- data/lib/MobileInAppTransactions/create-an-accept-transaction.rb +0 -59
- data/lib/MobileInAppTransactions/create-an-android-pay-transaction.rb +0 -59
- data/lib/MobileInAppTransactions/create-an-apple-pay-transaction.rb +0 -58
- data/lib/PayPalExpressCheckout/authorization-and-capture-continued.rb +0 -69
- data/lib/PayPalExpressCheckout/authorization-and-capture.rb +0 -70
- data/lib/PayPalExpressCheckout/authorization-only-continued.rb +0 -70
- data/lib/PayPalExpressCheckout/authorization-only.rb +0 -71
- data/lib/PayPalExpressCheckout/credit.rb +0 -67
- data/lib/PayPalExpressCheckout/get-details.rb +0 -69
- data/lib/PayPalExpressCheckout/prior-authorization-capture.rb +0 -112
- data/lib/PayPalExpressCheckout/void.rb +0 -113
- data/lib/PaymentTransactions/authorize-credit-card.rb +0 -103
- data/lib/PaymentTransactions/capture-funds-authorized-through-another-channel.rb +0 -60
- data/lib/PaymentTransactions/capture-previously-authorized-amount.rb +0 -104
- data/lib/PaymentTransactions/charge-credit-card.rb +0 -104
- data/lib/PaymentTransactions/charge-customer-profile.rb +0 -61
- data/lib/PaymentTransactions/charge-tokenized-credit-card.rb +0 -60
- data/lib/PaymentTransactions/credit-bank-account.rb +0 -62
- data/lib/PaymentTransactions/debit-bank-account.rb +0 -64
- data/lib/PaymentTransactions/refund-transaction.rb +0 -60
- data/lib/PaymentTransactions/update-split-tender-group.rb +0 -44
- data/lib/PaymentTransactions/void-transaction.rb +0 -103
- data/lib/RecurringBilling/cancel-subscription.rb +0 -36
- data/lib/RecurringBilling/create-subscription-from-customer-profile.rb +0 -52
- data/lib/RecurringBilling/create-subscription.rb +0 -54
- data/lib/RecurringBilling/get-list-of-subscriptions.rb +0 -51
- data/lib/RecurringBilling/get-subscription-status.rb +0 -36
- data/lib/RecurringBilling/get-subscription.rb +0 -42
- data/lib/RecurringBilling/update-subscription.rb +0 -54
- data/lib/TransactionReporting/get-batch-statistics.rb +0 -57
- data/lib/TransactionReporting/get-customer-profile-transaction-list.rb +0 -49
- data/lib/TransactionReporting/get-merchant-details.rb +0 -50
- data/lib/TransactionReporting/get-settled-batch-list.rb +0 -49
- data/lib/TransactionReporting/get-transaction-details.rb +0 -40
- data/lib/TransactionReporting/get-transaction-list.rb +0 -58
- data/lib/TransactionReporting/get-unsettled-transaction-list.rb +0 -48
- data/lib/VisaCheckout/create-visa-checkout-transaction.rb +0 -62
- data/lib/VisaCheckout/decrypt-visa-checkout-data.rb +0 -37
- data/lib/authorize_netsample.rb +0 -21
- data/lib/credentials.yml +0 -9
- data/lib/spec/sample_code_spec.rb +0 -320
- data/lib/spec/spec.opts +0 -2
- data/lib/spec/spec_helper.rb +0 -10
- data/lib/spec/support/shared_helper.rb +0 -7
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'yaml'
|
3
|
-
require 'authorizenet'
|
4
|
-
require 'securerandom'
|
5
|
-
|
6
|
-
include AuthorizeNet::API
|
7
|
-
|
8
|
-
def get_Transaction_List_For_Customer(customerProfileId = '40036377')
|
9
|
-
config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml")
|
10
|
-
|
11
|
-
transaction1 = AuthorizeNet::API::Transaction.new(config['api_login_id'], config['api_transaction_key'], :gateway => :sandbox)
|
12
|
-
|
13
|
-
request = AuthorizeNet::API::GetTransactionListForCustomerRequest.new
|
14
|
-
request.customerProfileId = customerProfileId
|
15
|
-
request.paging = Paging.new;
|
16
|
-
request.paging.limit = 10;
|
17
|
-
request.paging.offset = 1;
|
18
|
-
|
19
|
-
request.sorting = TransactionListSorting.new;
|
20
|
-
request.sorting.orderBy = "id";
|
21
|
-
request.sorting.orderDescending = true;
|
22
|
-
|
23
|
-
response = transaction1.get_transaction_list_for_customer(request)
|
24
|
-
|
25
|
-
if response.messages.resultCode == MessageTypeEnum::Ok
|
26
|
-
transactions = response.transactions
|
27
|
-
if transactions == nil
|
28
|
-
puts "#{response.messages.messages[0].text}"
|
29
|
-
else
|
30
|
-
response.transactions.transaction.each do |trans|
|
31
|
-
puts "\nTransaction ID : #{trans.transId} "
|
32
|
-
puts "Submitted on (Local) : %s " % [trans.submitTimeUTC]
|
33
|
-
puts "Status : #{trans.transactionStatus} "
|
34
|
-
puts "Settle Amount : %.2f " % [trans.settleAmount]
|
35
|
-
end
|
36
|
-
end
|
37
|
-
else
|
38
|
-
puts "Error: Failed to get Transaction List for customer\n"
|
39
|
-
puts "Error Text : #{response.messages.messages[0].text} \n"
|
40
|
-
puts "Error Code : #{response.messages.messages[0].code} "
|
41
|
-
end
|
42
|
-
return response
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
|
47
|
-
if __FILE__ == $0
|
48
|
-
get_Transaction_List_For_Customer()
|
49
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'yaml'
|
3
|
-
require 'authorizenet'
|
4
|
-
require 'securerandom'
|
5
|
-
|
6
|
-
include AuthorizeNet::API
|
7
|
-
|
8
|
-
def get_merchant_details()
|
9
|
-
config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml")
|
10
|
-
|
11
|
-
transaction = AuthorizeNet::API::Transaction.new(config['api_login_id'], config['api_transaction_key'], :gateway => :sandbox)
|
12
|
-
|
13
|
-
request = GetMerchantDetailsRequest.new
|
14
|
-
|
15
|
-
#standard api call to retrieve response
|
16
|
-
response = transaction.get_merchant_details(request)
|
17
|
-
|
18
|
-
if response.messages.resultCode == MessageTypeEnum::Ok
|
19
|
-
puts "Get Merchant Details Successful "
|
20
|
-
puts "Gateway Id: #{response.gatewayId}"
|
21
|
-
puts "Merchant Name: #{response.merchantName}"
|
22
|
-
response.processors.processor.each do |processor|
|
23
|
-
puts "Processor Name: #{processor.name}"
|
24
|
-
end
|
25
|
-
response.marketTypes.each do |marketType|
|
26
|
-
puts "MarketType: #{marketType}"
|
27
|
-
end
|
28
|
-
response.productCodes.each do |productCode|
|
29
|
-
puts "Product Code: #{productCode}"
|
30
|
-
end
|
31
|
-
response.paymentMethods.each do |paymentMethod|
|
32
|
-
puts "Payment Method: #{paymentMethod}"
|
33
|
-
end
|
34
|
-
response.currencies.each do |currency|
|
35
|
-
puts "Currency: #{currency}"
|
36
|
-
end
|
37
|
-
|
38
|
-
else
|
39
|
-
puts response.messages.messages[0].code
|
40
|
-
puts response.messages.messages[0].text
|
41
|
-
raise "Failed to get transaction Details."
|
42
|
-
end
|
43
|
-
|
44
|
-
return response
|
45
|
-
end
|
46
|
-
|
47
|
-
|
48
|
-
if __FILE__ == $0
|
49
|
-
get_merchant_details()
|
50
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'yaml'
|
3
|
-
require 'authorizenet'
|
4
|
-
require 'securerandom'
|
5
|
-
require "date"
|
6
|
-
|
7
|
-
include AuthorizeNet::API
|
8
|
-
|
9
|
-
def get_settled_batch_List()
|
10
|
-
config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml")
|
11
|
-
|
12
|
-
transaction = AuthorizeNet::API::Transaction.new(config['api_login_id'], config['api_transaction_key'], :gateway => :sandbox)
|
13
|
-
|
14
|
-
firstSettlementDate = DateTime.now()-(1 * 7)
|
15
|
-
lastSettlementDate = DateTime.now()
|
16
|
-
|
17
|
-
puts "First settlement date: #{firstSettlementDate} Last settlement date: #{lastSettlementDate}"
|
18
|
-
|
19
|
-
request = GetSettledBatchListRequest.new
|
20
|
-
request.firstSettlementDate = firstSettlementDate
|
21
|
-
request.lastSettlementDate = lastSettlementDate
|
22
|
-
request.includeStatistics = true
|
23
|
-
|
24
|
-
response = transaction.get_settled_batch_list(request)
|
25
|
-
|
26
|
-
if response.messages.resultCode == MessageTypeEnum::Ok
|
27
|
-
|
28
|
-
response.batchList.batch.each do |batch|
|
29
|
-
puts "Transaction Id: #{batch.batchId}"
|
30
|
-
puts "Settlement Date: #{batch.settlementTimeUTC}"
|
31
|
-
puts "State: #{batch.settlementState}"
|
32
|
-
puts "Account Type: #{batch.statistics[0].accountType}"
|
33
|
-
puts ""
|
34
|
-
end
|
35
|
-
else
|
36
|
-
puts response.messages.messages[0].code
|
37
|
-
puts response.messages.messages[0].text
|
38
|
-
raise "Failed to fetch settled batch list"
|
39
|
-
end
|
40
|
-
|
41
|
-
return response
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
if __FILE__ == $0
|
48
|
-
get_settled_batch_List()
|
49
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'yaml'
|
3
|
-
require 'authorizenet'
|
4
|
-
require 'securerandom'
|
5
|
-
|
6
|
-
include AuthorizeNet::API
|
7
|
-
|
8
|
-
def get_transaction_Details()
|
9
|
-
config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml")
|
10
|
-
|
11
|
-
transaction = AuthorizeNet::API::Transaction.new(config['api_login_id'], config['api_transaction_key'], :gateway => :sandbox)
|
12
|
-
|
13
|
-
transId = "60032208160"
|
14
|
-
request = GetTransactionDetailsRequest.new
|
15
|
-
request.transId = transId
|
16
|
-
|
17
|
-
#standard api call to retrieve response
|
18
|
-
response = transaction.get_transaction_details(request)
|
19
|
-
|
20
|
-
if response.messages.resultCode == MessageTypeEnum::Ok
|
21
|
-
puts "Get Transaction Details Successful "
|
22
|
-
puts "Transaction Id: #{response.transaction.transId}"
|
23
|
-
puts "Transaction Type: #{response.transaction.transactionType}"
|
24
|
-
puts "Transaction Status: #{response.transaction.transactionStatus}"
|
25
|
-
puts "Description: #{response.transaction.order.description}"
|
26
|
-
printf("Auth Amount: %.2f\n", response.transaction.authAmount)
|
27
|
-
printf("Settle Amount: %.2f\n", response.transaction.settleAmount)
|
28
|
-
else
|
29
|
-
puts response.messages.messages[0].code
|
30
|
-
puts response.messages.messages[0].text
|
31
|
-
raise "Failed to get transaction Details."
|
32
|
-
end
|
33
|
-
|
34
|
-
return response
|
35
|
-
end
|
36
|
-
|
37
|
-
|
38
|
-
if __FILE__ == $0
|
39
|
-
get_transaction_Details()
|
40
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'yaml'
|
3
|
-
require 'authorizenet'
|
4
|
-
require 'securerandom'
|
5
|
-
|
6
|
-
include AuthorizeNet::API
|
7
|
-
|
8
|
-
def get_transaction_List()
|
9
|
-
config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml")
|
10
|
-
|
11
|
-
transaction1 = AuthorizeNet::API::Transaction.new(config['api_login_id'], config['api_transaction_key'], :gateway => :sandbox)
|
12
|
-
|
13
|
-
batchId = "7590305"
|
14
|
-
request = AuthorizeNet::API::GetTransactionListRequest.new
|
15
|
-
request.batchId = batchId
|
16
|
-
request.paging = Paging.new;
|
17
|
-
# Paging limit can be up to 1000 for this request
|
18
|
-
request.paging.limit = '20'
|
19
|
-
request.paging.offset = 1;
|
20
|
-
|
21
|
-
request.sorting = TransactionListSorting.new;
|
22
|
-
request.sorting.orderBy = TransactionListOrderFieldEnum::Id;
|
23
|
-
request.sorting.orderDescending = true;
|
24
|
-
|
25
|
-
response = transaction1.get_transaction_list(request)
|
26
|
-
|
27
|
-
if response != nil
|
28
|
-
if response.messages.resultCode == MessageTypeEnum::Ok
|
29
|
-
if response.transactions == nil
|
30
|
-
puts "#{response.messages.messages[0].text}"
|
31
|
-
else
|
32
|
-
puts "Successfully got the list of transactions for batch " + batchId + "."
|
33
|
-
response.transactions.transaction.each do |trans|
|
34
|
-
puts "Transaction ID: #{trans.transId} "
|
35
|
-
puts " Submitted on (Local): %s " % [trans.submitTimeUTC]
|
36
|
-
puts " Status: #{trans.transactionStatus} "
|
37
|
-
puts " Settle Amount: %.2f " % [trans.settleAmount]
|
38
|
-
end
|
39
|
-
end
|
40
|
-
else
|
41
|
-
puts "Error: Failed to get Transaction List."
|
42
|
-
puts "Error Text: #{response.messages.messages[0].text}"
|
43
|
-
puts "Error Code: #{response.messages.messages[0].code}"
|
44
|
-
end
|
45
|
-
else
|
46
|
-
puts "Error: Failed to get Transaction List."
|
47
|
-
puts "Error Text: #{response.messages.messages[0].text}"
|
48
|
-
puts "Error Code: #{response.messages.messages[0].code}"
|
49
|
-
end
|
50
|
-
|
51
|
-
return response
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
|
56
|
-
if __FILE__ == $0
|
57
|
-
get_transaction_List()
|
58
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'yaml'
|
3
|
-
require 'authorizenet'
|
4
|
-
require 'securerandom'
|
5
|
-
|
6
|
-
include AuthorizeNet::API
|
7
|
-
|
8
|
-
def get_unsettled_transaction_List()
|
9
|
-
|
10
|
-
config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml")
|
11
|
-
#merchant information
|
12
|
-
transaction = AuthorizeNet::API::Transaction.new(config['api_login_id'], config['api_transaction_key'], :gateway => :sandbox)
|
13
|
-
|
14
|
-
request = GetUnsettledTransactionListRequest.new
|
15
|
-
|
16
|
-
request.status = TransactionGroupStatusEnum::ANY;
|
17
|
-
request.paging = Paging.new;
|
18
|
-
# Paging limit can be up to 1000
|
19
|
-
request.paging.limit = '20'
|
20
|
-
request.paging.offset = 1;
|
21
|
-
|
22
|
-
request.sorting = TransactionListSorting.new;
|
23
|
-
request.sorting.orderBy = TransactionListOrderFieldEnum::Id;
|
24
|
-
request.sorting.orderDescending = true;
|
25
|
-
|
26
|
-
response = transaction.get_unsettled_transaction_list(request)
|
27
|
-
|
28
|
-
if response.messages.resultCode == MessageTypeEnum::Ok
|
29
|
-
unsettled_transactions = response.transactions
|
30
|
-
|
31
|
-
response.transactions.transaction.each do |unsettled_transaction|
|
32
|
-
puts "Transaction #{unsettled_transaction.transId} was submitted at #{unsettled_transaction.submitTimeUTC}"
|
33
|
-
|
34
|
-
end
|
35
|
-
puts "Total transaction received #{unsettled_transactions.transaction.length}"
|
36
|
-
else
|
37
|
-
puts "ERROR message: #{response.messages.messages[0].text}"
|
38
|
-
puts "ERROR code: #{response.messages.messages[0].code}"
|
39
|
-
raise "Failed to get unsettled transaction list."
|
40
|
-
end
|
41
|
-
|
42
|
-
return response
|
43
|
-
end
|
44
|
-
|
45
|
-
|
46
|
-
if __FILE__ == $0
|
47
|
-
get_unsettled_transaction_List()
|
48
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'yaml'
|
3
|
-
require 'authorizenet'
|
4
|
-
require 'securerandom'
|
5
|
-
|
6
|
-
include AuthorizeNet::API
|
7
|
-
|
8
|
-
def create_visa_checkout_transaction()
|
9
|
-
config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml")
|
10
|
-
|
11
|
-
transaction = Transaction.new(config['api_login_id'], config['api_transaction_key'], :gateway => :sandbox)
|
12
|
-
|
13
|
-
request = CreateTransactionRequest.new
|
14
|
-
|
15
|
-
request.transactionRequest = TransactionRequestType.new()
|
16
|
-
request.transactionRequest.amount = 16.00
|
17
|
-
request.transactionRequest.payment = PaymentType.new
|
18
|
-
request.transactionRequest.payment.opaqueData = OpaqueDataType.new('COMMON.VCO.ONLINE.PAYMENT','MCOjZ5xX4lW0D9uN5azwGktYlwUMpCkyd7MAWmMVIekZAPa8GRa4C1OC225NWfplk+toHvTu3aCNq89TX/HGn3+wnVC+x2fgA2Eo5Cd9zRU5W1Gp6DoYD2CWpGIBRxHxcfNAmSmtm+UEbwublZi+qn9vqMSFlJg5E5/f5JqmPLq7rvvvTEWPmZBi/Um8PoJ0Ng0KsNzyRVnWGPhJ+XCQeF9KbgNhUFW0NwKNumKiY+LHZSEXZebzlEf9w7tvuZHxuWvh1lq/DZwXj1SKGrv0EQnmCmehJE18+DgP7WCa4Hv/27tYfIA7rA1Krg24MGZNGOxj2pa2zMXyP5m5f69CatC9+pFgYIlGI93YYgAc5yucxNUS6hyCjp4TunvUJ6Cm16bye0MH+6beG1oP4atC6MP++cLzvaSg/61NWGv+EsNRADbZX3Obk/v8L8oe65laIprFnTeS7v5ZPaWBB4G2UUajXP+o1+k9zv14lBFkit0rdLA5LbN2ob8gi5L2DY88qAynZkKcfFgpICqrsR9fVRs/7SAQAqy3y77OiTcERw11rAaEXus0zp/FPRKRevDkjOCrc5c2konp93ZBN3FwcdERf/NJpwGF+Mw5CMA956DJwX/lazc/tKZiWOnAQEhw2FzWxZL1VzdnLmw4IUxizrLr1h+xde39J1/+lTICTlAlR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ivaGHJbDbtXzFgwTmtYfOy8vyqS2c8bFC/gYvF6XqRBILDqUdCJhmgiuDVBzAR+c8DkwV3RKqu7DA0wk9K/TC0WEdyEuN+C0bVWqD2EgJb+tQAS5EibtaAlc3fJzBk9K9AcHFRlEb03EDFj6VwD59Z4Fr4oup8lcJP7/tkJtBHA4Jv33VghWnAhEbj8YE04vu5x/S5sGu0K1RW32GNRtU9JQ050Wrylyq4j9tLqVS04fu5BVEv1k5SzIO4VV+szZer90vXtHxKvGGF3Qqu1qLUuwkNDcaEiQ3zBGvKvGG/XUJpTM2HL7NyLFJgeJ5vxZmwjW7YiFB4au6Ld32jklRmKdlfoZMeSsDsB0WKW6iATvXKURgcAAgaBs/8sRk5S+B8PvvxYhzXgGKeY+GtopSP3f/4RI8NjZROirfyo7ztSqu7BYNL3WJAGY5ozxQVjqPs9rLc/oluv9j0eVZwMqHvAKaVoKByvAoH6qMFMFCkhMkrLDQ8Rq/JXX/ZzanxMB','nxmC7ZfWoAOHx2luMPW+G8xnXMkvDJcRgoAbBOuQrAfG+OnEmgzht3B7AzhjegzmqjtYpVYhjoCNzEjwZv+5AyaeNhAeny9mkx4h5Dc+XIrCT2GB4Q8BBI9AO7XtTd2V')
|
19
|
-
request.transactionRequest.callId = '2751969838440085201'
|
20
|
-
|
21
|
-
request.transactionRequest.transactionType = TransactionTypeEnum::AuthCaptureTransaction
|
22
|
-
|
23
|
-
response = transaction.create_transaction(request)
|
24
|
-
|
25
|
-
if response != nil
|
26
|
-
if response.messages.resultCode == MessageTypeEnum::Ok
|
27
|
-
if response.transactionResponse != nil && response.transactionResponse.messages != nil
|
28
|
-
puts "Successfully made a purchase (authorization code: #{response.transactionResponse.authCode})"
|
29
|
-
puts "Transaction Response code: #{response.transactionResponse.responseCode}"
|
30
|
-
puts "Code: #{response.transactionResponse.messages.messages[0].code}"
|
31
|
-
puts "Description: #{response.transactionResponse.messages.messages[0].description}"
|
32
|
-
else
|
33
|
-
puts "Transaction Failed"
|
34
|
-
if response.transactionResponse.errors != nil
|
35
|
-
puts "Error Code: #{response.transactionResponse.errors.errors[0].errorCode}"
|
36
|
-
puts "Error Message: #{response.transactionResponse.errors.errors[0].errorText}"
|
37
|
-
end
|
38
|
-
raise "Failed to make purchase."
|
39
|
-
end
|
40
|
-
else
|
41
|
-
puts "Transaction Failed"
|
42
|
-
if response.transactionResponse != nil && response.transactionResponse.errors != nil
|
43
|
-
puts "Error Code: #{response.transactionResponse.errors.errors[0].errorCode}"
|
44
|
-
puts "Error Message: #{response.transactionResponse.errors.errors[0].errorText}"
|
45
|
-
else
|
46
|
-
puts "Error Code: #{response.messages.messages[0].code}"
|
47
|
-
puts "Error Message: #{response.messages.messages[0].text}"
|
48
|
-
end
|
49
|
-
raise "Failed to make purchase."
|
50
|
-
end
|
51
|
-
else
|
52
|
-
puts "Response is null"
|
53
|
-
raise "Failed to make purchase."
|
54
|
-
end
|
55
|
-
|
56
|
-
return response
|
57
|
-
end
|
58
|
-
|
59
|
-
|
60
|
-
if __FILE__ == $0
|
61
|
-
create_visa_checkout_transaction()
|
62
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'yaml'
|
3
|
-
require 'authorizenet'
|
4
|
-
require 'securerandom'
|
5
|
-
|
6
|
-
include AuthorizeNet::API
|
7
|
-
|
8
|
-
def decrypt_visa_checkout_data()
|
9
|
-
config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml")
|
10
|
-
|
11
|
-
transaction = Transaction.new(config['api_login_id'], config['api_transaction_key'], :gateway => :sandbox)
|
12
|
-
|
13
|
-
request = DecryptPaymentDataRequest.new
|
14
|
-
request.opaqueData = OpaqueDataType.new('COMMON.VCO.ONLINE.PAYMENT','q1rx4GVCh0dqjZGgSBI8RB/VlI/1lwzTxDnrW/L1D4f/lfKZeQPo34eTB59akZXdRlRBW/dHVWgc2eVebvWpkAKmDrc+7Zr7lGXvHbLG78e0ZgfEReQNS4es6K7DxsDXp0UZSdnxw6g3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/YL+V9xBCDe4CmSjJ0MPHEodpWz4rmz78U8bR4Qqs1ipLBqH9mrfvLF4pytIcLOjKUtXvAII/xCze84INFMdtsVBgtEp5bZ4leehRQhNM+3/NH')
|
15
|
-
request.callId = '1238408836021304101'
|
16
|
-
|
17
|
-
response = transaction.decrypt_payment_data(request)
|
18
|
-
|
19
|
-
|
20
|
-
if response.messages.resultCode == MessageTypeEnum::Ok
|
21
|
-
puts "Successfully decrypted data (Card Number: #{response.cardInfo.cardNumber})"
|
22
|
-
puts "Billing Last Name #{response.billingInfo.lastName}"
|
23
|
-
puts "Shipping Last Name #{response.shippingInfo.lastName}"
|
24
|
-
puts "Amount #{response.paymentDetails.amount}"
|
25
|
-
else
|
26
|
-
puts response.messages.messages[0].code
|
27
|
-
puts response.messages.messages[0].text
|
28
|
-
raise "Failed to decrypt."
|
29
|
-
end
|
30
|
-
|
31
|
-
return response
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
if __FILE__ == $0
|
36
|
-
decrypt_visa_checkout_data()
|
37
|
-
end
|
data/lib/authorize_netsample.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# The SDK initialization enters here. Loads all needed libraries and files. Inspects
|
2
|
-
# the current runtime to see if Rails is present. If it is, we inject our helper into
|
3
|
-
# ActiveSupport.
|
4
|
-
|
5
|
-
# coverall
|
6
|
-
# require 'coveralls'
|
7
|
-
# Coveralls.wear!
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
# TODO: Add local data validation where possible
|
12
|
-
|
13
|
-
$LOAD_PATH.unshift File.dirname(__FILE__)
|
14
|
-
|
15
|
-
require "PaymentTransactions/create-an-accept-payment-transaction.rb"
|
16
|
-
|
17
|
-
require "PaymentTransactions/get-an-accept-payment-page.rb"
|
18
|
-
|
19
|
-
require "CustomerProfiles/get-customer-profile.rb"
|
20
|
-
|
21
|
-
require "CustomerProfiles/get-accept-customer-profile-page.rb"
|
data/lib/credentials.yml
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
#obtain an API login_id and transaction_id according to instructions at https://developer.authorize.net/faqs/#gettranskey
|
2
|
-
# api_login_id: 5KP3u95bQpv
|
3
|
-
# api_transaction_key: 346HZ32z3fP4hTG2
|
4
|
-
|
5
|
-
api_login_id: 87N83jqsSa3R
|
6
|
-
api_transaction_key: 4K7kREpEd2bc988W
|
7
|
-
|
8
|
-
#obtained md5 hash value by first setting the hash value in https://sandbox.authorize.net/ under the Account tab->MD5 Hash
|
9
|
-
md5_value: MD5_TEST
|