authorizenetsample 1.1.9 → 1.2.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34198052629e4d7415e21dbe494855db055dc7bb
|
4
|
+
data.tar.gz: 1af4917af8db1460acf98b70edcd935e05d3034c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf2332578759254b303340c37ed2261a6a42e59517531b84c8ddb1c7f0c96b7a4ac83360d2b81e29a0ac543ce5769ce3708470a77af646ad76bf73b13b223a1a
|
7
|
+
data.tar.gz: b56c3f3e044dec716d932a651f6cb675bc16fd52c100cf266dd41b9eb98a261faa50049ca94f6044921c60d8b25dd6937ef69d972db0d20375b66a768a1e5456
|
@@ -5,7 +5,7 @@ require 'securerandom'
|
|
5
5
|
|
6
6
|
include AuthorizeNet::API
|
7
7
|
|
8
|
-
def create_an_accept_payment_transaction(api_login_id,api_transaction_key,token)
|
8
|
+
def create_an_accept_payment_transaction(api_login_id,api_transaction_key,token,customerName)
|
9
9
|
puts File.dirname(__FILE__)
|
10
10
|
config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml")
|
11
11
|
|
@@ -14,17 +14,19 @@ require 'securerandom'
|
|
14
14
|
|
15
15
|
request = CreateTransactionRequest.new
|
16
16
|
|
17
|
-
|
17
|
+
billTo = CustomerAddressType.new
|
18
18
|
# billTo.firstName = "John"
|
19
19
|
# billTo.lastName = "Doe"
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
billTo.firstName = customerName.split(" ").first
|
21
|
+
billTo.lastName = customerName.split(" ").last
|
22
|
+
billTo.address = "123 My St"
|
23
|
+
billTo.city = "OurTown"
|
24
|
+
billTo.zip = "98004"
|
23
25
|
|
24
26
|
request.transactionRequest = TransactionRequestType.new()
|
25
27
|
# request.transactionRequest.amount = ((SecureRandom.random_number + 1 ) * 150 ).round(2)
|
26
28
|
request.transactionRequest.amount = 99
|
27
|
-
|
29
|
+
request.transactionRequest.billTo = billTo
|
28
30
|
request.transactionRequest.payment = PaymentType.new
|
29
31
|
# request.transactionRequest.payment.opaqueData = OpaqueDataType.new('COMMON.ACCEPT.INAPP.PAYMENT','eyJjb2RlIjoiNTBfMl8wNjAwMDUzQTczNERGMDY0MUMyMzUxMkIyQTM2MUE3QTBFQUQ4NTIxQ0EzQjM3MUU1REMyMjlEQkYwMjRERjI5QzdFOTJBMDIzNzJGRDVDQkI0ODRDMTQ2NDYyQ0U4NkFCRjA0Q0Y3IiwidG9rZW4iOiI5NTM5MzYyNzY1NjM2NTgyODA0NjA0IiwidiI6IjEuMSJ9')
|
30
32
|
request.transactionRequest.payment.opaqueData = OpaqueDataType.new('COMMON.ACCEPT.INAPP.PAYMENT',token)
|