vantiv 0.3.0 → 1.0.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 +4 -4
- data/.codeclimate.yml +16 -0
- data/.env.example +4 -2
- data/.rubocop.yml +1157 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +10 -0
- data/README.md +42 -29
- data/bin/console +5 -3
- data/bin/generate_sandbox_fixtures +5 -3
- data/bin/paypage_server +5 -3
- data/cert_fixtures/{L_AU_1.json → ACCOUNT_UPDATER_100.json} +0 -0
- data/cert_fixtures/{L_AU_3.json → ACCOUNT_UPDATER_100A.json} +0 -0
- data/cert_fixtures/{L_AU_7.json → ACCOUNT_UPDATER_100B.json} +1 -1
- data/cert_fixtures/{L_AU_2.json → ACCOUNT_UPDATER_101.json} +0 -0
- data/cert_fixtures/{L_AU_4.json → ACCOUNT_UPDATER_101A.json} +0 -0
- data/cert_fixtures/{L_AU_5.json → ACCOUNT_UPDATER_102.json} +0 -0
- data/cert_fixtures/{L_AU_6.json → ACCOUNT_UPDATER_103.json} +0 -0
- data/cert_fixtures/{L_AC_1.json → AUTH_CAPTURE_1.json} +0 -0
- data/cert_fixtures/AUTH_CAPTURE_1A.json +8 -0
- data/cert_fixtures/{L_AC_2.json → AUTH_CAPTURE_2.json} +0 -0
- data/cert_fixtures/AUTH_CAPTURE_2A.json +8 -0
- data/cert_fixtures/{L_AC_3.json → AUTH_CAPTURE_3.json} +0 -0
- data/cert_fixtures/AUTH_CAPTURE_3A.json +8 -0
- data/cert_fixtures/{L_AC_4.json → AUTH_CAPTURE_4.json} +0 -0
- data/cert_fixtures/AUTH_CAPTURE_4A.json +8 -0
- data/cert_fixtures/{L_AC_5.json → AUTH_CAPTURE_5.json} +0 -0
- data/cert_fixtures/AUTH_CAPTURE_5A.json +8 -0
- data/cert_fixtures/{L_AC_6.json → AUTH_CAPTURE_6.json} +0 -0
- data/cert_fixtures/{L_AC_7.json → AUTH_CAPTURE_7.json} +0 -0
- data/cert_fixtures/{L_AC_8.json → AUTH_CAPTURE_8.json} +0 -0
- data/cert_fixtures/{L_AC_9.json → AUTH_CAPTURE_9.json} +0 -0
- data/cert_fixtures/{L_AR_1.json → AUTH_REVERSAL_32.json} +0 -0
- data/cert_fixtures/{L_AR_1A.json → AUTH_REVERSAL_32A.json} +1 -1
- data/cert_fixtures/AUTH_REVERSAL_32B.json +8 -0
- data/cert_fixtures/{L_AR_2.json → AUTH_REVERSAL_33.json} +0 -0
- data/cert_fixtures/AUTH_REVERSAL_33A.json +8 -0
- data/cert_fixtures/{L_AR_3.json → AUTH_REVERSAL_34.json} +0 -0
- data/cert_fixtures/AUTH_REVERSAL_34A.json +8 -0
- data/cert_fixtures/{L_AR_4.json → AUTH_REVERSAL_35.json} +0 -0
- data/cert_fixtures/{L_AR_4A.json → AUTH_REVERSAL_35A.json} +1 -1
- data/cert_fixtures/{L_AR_4B.json → AUTH_REVERSAL_35B.json} +1 -1
- data/cert_fixtures/{L_AR_5.json → AUTH_REVERSAL_36.json} +0 -0
- data/cert_fixtures/{L_AR_5A.json → AUTH_REVERSAL_36A.json} +1 -1
- data/cert_fixtures/{L_RC_1.json → CREDIT_1.json} +0 -0
- data/cert_fixtures/CREDIT_1A.json +8 -0
- data/cert_fixtures/CREDIT_1B.json +8 -0
- data/cert_fixtures/{L_RC_2.json → CREDIT_2.json} +0 -0
- data/cert_fixtures/CREDIT_2A.json +8 -0
- data/cert_fixtures/CREDIT_2B.json +8 -0
- data/cert_fixtures/{L_RC_3.json → CREDIT_3.json} +0 -0
- data/cert_fixtures/CREDIT_3A.json +8 -0
- data/cert_fixtures/CREDIT_3B.json +8 -0
- data/cert_fixtures/{L_RC_4.json → CREDIT_4.json} +0 -0
- data/cert_fixtures/CREDIT_4A.json +8 -0
- data/cert_fixtures/CREDIT_4B.json +8 -0
- data/cert_fixtures/{L_RC_5.json → CREDIT_5.json} +0 -0
- data/cert_fixtures/CREDIT_5A.json +8 -0
- data/cert_fixtures/CREDIT_5B.json +8 -0
- data/cert_fixtures/{L_RC_6.json → SALE_1.json} +0 -0
- data/cert_fixtures/{L_S_2.json → SALE_2.json} +0 -0
- data/cert_fixtures/{L_S_3.json → SALE_3.json} +0 -0
- data/cert_fixtures/{L_S_4.json → SALE_4.json} +0 -0
- data/cert_fixtures/{L_S_5.json → SALE_5.json} +0 -0
- data/cert_fixtures/{L_S_6.json → SALE_6.json} +0 -0
- data/cert_fixtures/{L_S_7.json → SALE_7.json} +0 -0
- data/cert_fixtures/{L_S_8.json → SALE_8.json} +0 -0
- data/cert_fixtures/{L_S_9.json → SALE_9.json} +0 -0
- data/cert_fixtures/{L_S_1.json → SECURITY_CODE_FILTER_R1.json} +9 -9
- data/cert_fixtures/SECURITY_CODE_FILTER_R2.json +27 -0
- data/cert_fixtures/{L_T_1.json → TOKENIZATION_1.json} +0 -0
- data/cert_fixtures/{L_T_10.json → TOKENIZATION_10.json} +0 -0
- data/cert_fixtures/{L_T_11.json → TOKENIZATION_11.json} +0 -0
- data/cert_fixtures/{L_T_2.json → TOKENIZATION_2.json} +0 -0
- data/cert_fixtures/{L_T_3.json → TOKENIZATION_3.json} +0 -0
- data/cert_fixtures/{L_T_4.json → TOKENIZATION_4.json} +0 -0
- data/cert_fixtures/{L_T_6.json → TOKENIZATION_6.json} +0 -0
- data/cert_fixtures/{L_T_7.json → TOKENIZATION_7.json} +0 -0
- data/cert_fixtures/{L_T_8.json → TOKENIZATION_8.json} +0 -0
- data/cert_fixtures/{L_T_9.json → TOKENIZATION_9.json} +1 -1
- data/cert_fixtures/{L_V_1.json → VOID_1.json} +0 -0
- data/cert_fixtures/VOID_1A.json +8 -0
- data/cert_fixtures/VOID_1B.json +8 -0
- data/cert_fixtures/VOID_1C.json +8 -0
- data/cert_fixtures/{L_V_2.json → VOID_2.json} +0 -0
- data/cert_fixtures/VOID_2A.json +8 -0
- data/cert_fixtures/{L_V_3.json → VOID_3.json} +0 -0
- data/cert_fixtures/VOID_3A.json +8 -0
- data/cert_fixtures/{L_V_4.json → VOID_4.json} +0 -0
- data/cert_fixtures/VOID_4A.json +8 -0
- data/cert_fixtures/{L_EP_1.json → ePROTECT_1.json} +0 -0
- data/cert_fixtures/{L_EP_2.json → ePROTECT_2.json} +0 -0
- data/cert_fixtures/{L_EP_3.json → ePROTECT_3.json} +0 -0
- data/cert_fixtures/{L_EP_4.json → ePROTECT_4.json} +1 -1
- data/cert_fixtures/{L_EP_5.json → ePROTECT_5.json} +1 -1
- data/cert_fixtures/{L_EP_6.json → ePROTECT_6.json} +0 -0
- data/cert_fixtures/{L_EP_7.json → ePROTECT_7.json} +0 -0
- data/exe/vantiv-certify-app +18 -12
- data/lib/monkey_patches/representable/xml.rb +12 -0
- data/lib/vantiv.rb +39 -14
- data/lib/vantiv/api.rb +13 -1
- data/lib/vantiv/api/account_updater_response.rb +24 -29
- data/lib/vantiv/api/address.rb +8 -0
- data/lib/vantiv/api/apple_pay_response.rb +9 -0
- data/lib/vantiv/api/capture_response.rb +1 -1
- data/lib/vantiv/api/card.rb +47 -0
- data/lib/vantiv/api/cardholder_authentication.rb +11 -0
- data/lib/vantiv/api/fraud_result.rb +7 -0
- data/lib/vantiv/api/live_transaction_response.rb +4 -5
- data/lib/vantiv/api/payment_account.rb +11 -0
- data/lib/vantiv/api/request.rb +72 -33
- data/lib/vantiv/api/request_body.rb +100 -97
- data/lib/vantiv/api/request_body_representer.rb +54 -0
- data/lib/vantiv/api/request_body_representer_xml.rb +19 -0
- data/lib/vantiv/api/response.rb +9 -29
- data/lib/vantiv/api/response_body.rb +12 -0
- data/lib/vantiv/api/response_body_representer.rb +23 -0
- data/lib/vantiv/api/response_body_representer_xml.rb +25 -0
- data/lib/vantiv/api/tied_transaction_response.rb +5 -5
- data/lib/vantiv/api/tokenization_response.rb +15 -9
- data/lib/vantiv/api/transaction.rb +42 -0
- data/lib/vantiv/api/transaction_request_representer_xml.rb +57 -0
- data/lib/vantiv/api/transaction_response.rb +9 -0
- data/lib/vantiv/api/transaction_response_representer.rb +64 -0
- data/lib/vantiv/api/transaction_response_representer_xml.rb +54 -0
- data/lib/vantiv/certification/paypage_server.rb +13 -2
- data/lib/vantiv/certification/response_cache.rb +4 -12
- data/lib/vantiv/certification/validation_test_runner.rb +29 -10
- data/lib/vantiv/mocked_sandbox.rb +3 -2
- data/lib/vantiv/mocked_sandbox/api_request.rb +56 -27
- data/lib/vantiv/mocked_sandbox/fixture_generator.rb +56 -50
- data/lib/vantiv/mocked_sandbox/fixtures/{auth--4457000300000007.json.erb → auth--4457000300000007.json} +18 -16
- data/lib/vantiv/mocked_sandbox/fixtures/{auth--4457000301100004.json.erb → auth--4457000301100004.json} +16 -14
- data/lib/vantiv/mocked_sandbox/fixtures/{auth--4457002100000005.json.erb → auth--4457002100000005.json} +10 -10
- data/lib/vantiv/mocked_sandbox/fixtures/{auth--4457010000000009.json.erb → auth--4457010000000009.json} +11 -11
- data/lib/vantiv/mocked_sandbox/fixtures/{auth--5112000101110009.json.erb → auth--5112000101110009.json} +16 -16
- data/lib/vantiv/mocked_sandbox/fixtures/{auth--5112001600000006.json.erb → auth--5112001600000006.json} +10 -10
- data/lib/vantiv/mocked_sandbox/fixtures/{auth--5112001900000003.json.erb → auth--5112001900000003.json} +10 -10
- data/lib/vantiv/mocked_sandbox/fixtures/{auth_capture--4457000300000007.json.erb → auth_capture--4457000300000007.json} +18 -16
- data/lib/vantiv/mocked_sandbox/fixtures/{auth_capture--4457000301100004.json.erb → auth_capture--4457000301100004.json} +16 -14
- data/lib/vantiv/mocked_sandbox/fixtures/{auth_capture--4457002100000005.json.erb → auth_capture--4457002100000005.json} +10 -10
- data/lib/vantiv/mocked_sandbox/fixtures/{auth_capture--4457010000000009.json.erb → auth_capture--4457010000000009.json} +11 -11
- data/lib/vantiv/mocked_sandbox/fixtures/{auth_capture--5112000101110009.json.erb → auth_capture--5112000101110009.json} +16 -16
- data/lib/vantiv/mocked_sandbox/fixtures/{auth_capture--5112001600000006.json.erb → auth_capture--5112001600000006.json} +10 -10
- data/lib/vantiv/mocked_sandbox/fixtures/{auth_capture--5112001900000003.json.erb → auth_capture--5112001900000003.json} +10 -10
- data/lib/vantiv/mocked_sandbox/fixtures/auth_reversal.json +21 -0
- data/lib/vantiv/mocked_sandbox/fixtures/capture.json +21 -0
- data/lib/vantiv/mocked_sandbox/fixtures/credit.json +21 -0
- data/lib/vantiv/mocked_sandbox/fixtures/refund--4457000300000007.json +22 -0
- data/lib/vantiv/mocked_sandbox/fixtures/refund--4457000301100004.json +22 -0
- data/lib/vantiv/mocked_sandbox/fixtures/refund--4457002100000005.json +22 -0
- data/lib/vantiv/mocked_sandbox/fixtures/refund--4457010000000009.json +22 -0
- data/lib/vantiv/mocked_sandbox/fixtures/refund--5112000101110009.json +22 -0
- data/lib/vantiv/mocked_sandbox/fixtures/refund--5112001600000006.json +22 -0
- data/lib/vantiv/mocked_sandbox/fixtures/refund--5112001900000003.json +22 -0
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize--RGFQNCt6U1d1M21SeVByVTM4dHlHb1FsVkUrSmpnWXhNY0o5UkMzRlZFanZiUHVnYjN1enJXbG1WSDF4aXlNc.json +17 -0
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize--mocked-valid-temporary-token.json +23 -0
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize--pDZJcmd1VjNlYXNaSlRMTGpocVZQY1NWVXE4Z W5UTko4NU9KK3p1L1p1Vzg4YzVPQVlSUHNITG1 JN2I0Nzl.json +17 -0
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457000300000007.json +23 -0
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457000301100004.json +23 -0
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457002100000005.json +23 -0
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457010000000009.json +23 -0
- data/lib/vantiv/mocked_sandbox/fixtures/{tokenize_by_direct_post--4457010010900010.json.erb → tokenize_by_direct_post--4457010010900010.json} +8 -8
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--5112000101110009.json +23 -0
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--5112001600000006.json +23 -0
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--5112001900000003.json +23 -0
- data/lib/vantiv/mocked_sandbox/fixtures/void.json +21 -0
- data/lib/vantiv/mocked_sandbox/mocked_response_representer.rb +11 -0
- data/lib/vantiv/paypage.rb +5 -1
- data/lib/vantiv/test_temporary_token.rb +20 -0
- data/lib/vantiv/version.rb +1 -1
- data/vantiv-ruby.gemspec +5 -1
- metadata +191 -129
- data/cert_fixtures/L_AC_1A.json +0 -8
- data/cert_fixtures/L_AC_2A.json +0 -8
- data/cert_fixtures/L_AC_3A.json +0 -8
- data/cert_fixtures/L_AC_4A.json +0 -8
- data/cert_fixtures/L_AC_5A.json +0 -8
- data/cert_fixtures/L_AR_1B.json +0 -8
- data/cert_fixtures/L_AR_2A.json +0 -8
- data/cert_fixtures/L_AR_3A.json +0 -8
- data/cert_fixtures/L_RC_1A.json +0 -8
- data/cert_fixtures/L_RC_1B.json +0 -8
- data/cert_fixtures/L_RC_2A.json +0 -8
- data/cert_fixtures/L_RC_2B.json +0 -8
- data/cert_fixtures/L_RC_3A.json +0 -8
- data/cert_fixtures/L_RC_3B.json +0 -8
- data/cert_fixtures/L_RC_4A.json +0 -8
- data/cert_fixtures/L_RC_4B.json +0 -8
- data/cert_fixtures/L_RC_5A.json +0 -8
- data/cert_fixtures/L_RC_5B.json +0 -8
- data/cert_fixtures/L_RC_6A.json +0 -8
- data/cert_fixtures/L_RC_7.json +0 -26
- data/cert_fixtures/L_RC_7A.json +0 -8
- data/cert_fixtures/L_RC_8.json +0 -18
- data/cert_fixtures/L_V_1A.json +0 -8
- data/cert_fixtures/L_V_1B.json +0 -8
- data/cert_fixtures/L_V_1C.json +0 -8
- data/cert_fixtures/L_V_2A.json +0 -8
- data/cert_fixtures/L_V_3A.json +0 -8
- data/cert_fixtures/L_V_4A.json +0 -8
- data/lib/vantiv/api/request_body_generator.rb +0 -43
- data/lib/vantiv/mocked_sandbox/dynamic_response_body.rb +0 -40
- data/lib/vantiv/mocked_sandbox/fixtures/auth_reversal.json.erb +0 -21
- data/lib/vantiv/mocked_sandbox/fixtures/capture.json.erb +0 -21
- data/lib/vantiv/mocked_sandbox/fixtures/credit.json.erb +0 -21
- data/lib/vantiv/mocked_sandbox/fixtures/refund--4457000300000007.json.erb +0 -22
- data/lib/vantiv/mocked_sandbox/fixtures/refund--4457000301100004.json.erb +0 -22
- data/lib/vantiv/mocked_sandbox/fixtures/refund--4457002100000005.json.erb +0 -22
- data/lib/vantiv/mocked_sandbox/fixtures/refund--4457010000000009.json.erb +0 -22
- data/lib/vantiv/mocked_sandbox/fixtures/refund--5112000101110009.json.erb +0 -22
- data/lib/vantiv/mocked_sandbox/fixtures/refund--5112001600000006.json.erb +0 -22
- data/lib/vantiv/mocked_sandbox/fixtures/refund--5112001900000003.json.erb +0 -22
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457000300000007.json.erb +0 -23
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457000301100004.json.erb +0 -23
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457002100000005.json.erb +0 -23
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457010000000009.json.erb +0 -23
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--5112000101110009.json.erb +0 -23
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--5112001600000006.json.erb +0 -23
- data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--5112001900000003.json.erb +0 -23
- data/lib/vantiv/mocked_sandbox/fixtures/void.json.erb +0 -21
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -3,24 +3,24 @@
|
|
3
3
|
"body": {
|
4
4
|
"Transaction": {
|
5
5
|
"ReferenceNumber": "1",
|
6
|
-
"TransactionAmount": "
|
6
|
+
"TransactionAmount": "91.00",
|
7
7
|
"OrderSource": "ecommerce",
|
8
8
|
"CustomerID": "345",
|
9
9
|
"PartialApprovedFlag": "false"
|
10
10
|
},
|
11
11
|
"Card": {
|
12
|
-
"Type": "
|
13
|
-
"CardNumber": "
|
12
|
+
"Type": "MC",
|
13
|
+
"CardNumber": "5112002200000008",
|
14
14
|
"ExpirationMonth": "01",
|
15
15
|
"ExpirationYear": "16",
|
16
|
-
"CVV": "
|
16
|
+
"CVV": "123"
|
17
17
|
},
|
18
18
|
"Address": {
|
19
|
-
"BillingName": "John
|
20
|
-
"BillingAddress1": "
|
21
|
-
"BillingCity": "
|
22
|
-
"BillingState": "
|
23
|
-
"BillingZipcode": "
|
19
|
+
"BillingName": "John Doe",
|
20
|
+
"BillingAddress1": "10 Main St.",
|
21
|
+
"BillingCity": "San Jose",
|
22
|
+
"BillingState": "CA",
|
23
|
+
"BillingZipcode": "95032",
|
24
24
|
"BillingCountry": "US"
|
25
25
|
}
|
26
26
|
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"endpoint": "SALE",
|
3
|
+
"body": {
|
4
|
+
"Transaction": {
|
5
|
+
"ReferenceNumber": "1",
|
6
|
+
"TransactionAmount": "91.00",
|
7
|
+
"OrderSource": "ecommerce",
|
8
|
+
"CustomerID": "345",
|
9
|
+
"PartialApprovedFlag": "false"
|
10
|
+
},
|
11
|
+
"Card": {
|
12
|
+
"Type": "MC",
|
13
|
+
"CardNumber": "5112000200000002",
|
14
|
+
"ExpirationMonth": "01",
|
15
|
+
"ExpirationYear": "16",
|
16
|
+
"CVV": "123"
|
17
|
+
},
|
18
|
+
"Address": {
|
19
|
+
"BillingName": "John Doe",
|
20
|
+
"BillingAddress1": "10 Main St.",
|
21
|
+
"BillingCity": "San Jose",
|
22
|
+
"BillingState": "CA",
|
23
|
+
"BillingZipcode": "95032",
|
24
|
+
"BillingCountry": "US"
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -14,7 +14,7 @@
|
|
14
14
|
"CVV": "987"
|
15
15
|
},
|
16
16
|
"PaymentAccount": {
|
17
|
-
"PaymentAccountID": "#{
|
17
|
+
"PaymentAccountID": "#{TOKENIZATION_8.body.authorization_response.token_response.payment_account_id}"
|
18
18
|
}
|
19
19
|
}
|
20
20
|
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -9,7 +9,7 @@
|
|
9
9
|
"PartialApprovedFlag": "false"
|
10
10
|
},
|
11
11
|
"PaymentAccount": {
|
12
|
-
"PaymentAccountID": "#{
|
12
|
+
"PaymentAccountID": "#{ePROTECT_1.body.authorization_response.token_response.payment_account_id}"
|
13
13
|
},
|
14
14
|
"Card": {
|
15
15
|
"ExpirationMonth": "01",
|
@@ -9,7 +9,7 @@
|
|
9
9
|
"PartialApprovedFlag": "false"
|
10
10
|
},
|
11
11
|
"PaymentAccount": {
|
12
|
-
"PaymentAccountID": "#{
|
12
|
+
"PaymentAccountID": "#{ePROTECT_2.body.sale_response.token_response.payment_account_id}"
|
13
13
|
},
|
14
14
|
"Card": {
|
15
15
|
"ExpirationMonth": "01",
|
File without changes
|
File without changes
|
data/exe/vantiv-certify-app
CHANGED
@@ -6,20 +6,24 @@ require 'optparse'
|
|
6
6
|
|
7
7
|
options = {}
|
8
8
|
parser = OptionParser.new do |opts|
|
9
|
-
opts.banner = "Usage: vantiv-certify-app -a <
|
9
|
+
opts.banner = "Usage: vantiv-certify-app -a <merchant_id> -p <paypage_id> -u <user> -w <password> [--filter_by <test_name>]"
|
10
10
|
|
11
|
-
opts.on("-a", "--
|
12
|
-
options[:
|
13
|
-
end
|
14
|
-
|
15
|
-
opts.on("-l", "--license_id LICENSE_ID", "Vantiv License ID") do |license_id|
|
16
|
-
options[:license_id] = license_id
|
11
|
+
opts.on("-a", "--merchant_id MERCHANT_ID", "Vantiv Merchant ID") do |merchant_id|
|
12
|
+
options[:merchant_id] = merchant_id
|
17
13
|
end
|
18
14
|
|
19
15
|
opts.on("-p", "--paypage_id PAYPAGE_ID", "Vantiv Paypage ID") do |paypage_id|
|
20
16
|
options[:paypage_id] = paypage_id
|
21
17
|
end
|
22
18
|
|
19
|
+
opts.on("-u", "--user VANTIV_USER", "Vantiv XML User") do |user|
|
20
|
+
options[:user] = user
|
21
|
+
end
|
22
|
+
|
23
|
+
opts.on("-w", "--password VANTIV_PASSWORD", "Vantiv XML Password") do |password|
|
24
|
+
options[:password] = password
|
25
|
+
end
|
26
|
+
|
23
27
|
opts.on("--filter_by [TEST_NAME]", "Filter which certifications to run") do |filter|
|
24
28
|
options[:filter_by] = filter
|
25
29
|
end
|
@@ -27,7 +31,7 @@ end
|
|
27
31
|
|
28
32
|
parser.parse!
|
29
33
|
|
30
|
-
required_arguments = %i[
|
34
|
+
required_arguments = %i[merchant_id paypage_id user password]
|
31
35
|
missing_arguments = required_arguments.select{ |required_argument| options[required_argument].nil? }
|
32
36
|
|
33
37
|
if missing_arguments.any?
|
@@ -37,17 +41,19 @@ if missing_arguments.any?
|
|
37
41
|
end
|
38
42
|
|
39
43
|
Vantiv.configure do |config|
|
40
|
-
config.
|
41
|
-
config.acceptor_id = options.fetch(:acceptor_id)
|
44
|
+
config.merchant_id = options.fetch(:merchant_id)
|
42
45
|
config.paypage_id = options.fetch(:paypage_id)
|
43
46
|
config.environment = Vantiv::Environment::CERTIFICATION
|
44
47
|
|
48
|
+
config.user = options.fetch(:user)
|
49
|
+
config.password = options.fetch(:password)
|
50
|
+
|
45
51
|
config.default_report_group = '1'
|
46
52
|
end
|
47
53
|
|
48
54
|
Vantiv::Certification::ValidationTestRunner.run(
|
49
|
-
|
50
|
-
|
55
|
+
save_to: "certs.txt",
|
56
|
+
filter_by: options[:filter_by]
|
51
57
|
)
|
52
58
|
|
53
59
|
%x(open certs.txt)
|
data/lib/vantiv.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
require 'json'
|
2
2
|
require 'net/http'
|
3
|
+
require 'representable/xml'
|
4
|
+
require 'monkey_patches/representable/xml'
|
3
5
|
require 'vantiv/api'
|
4
6
|
require 'vantiv/test_card'
|
7
|
+
require 'vantiv/test_temporary_token'
|
5
8
|
require 'vantiv/environment'
|
6
9
|
require 'vantiv/mocked_sandbox'
|
7
10
|
require 'vantiv/paypage'
|
@@ -37,14 +40,29 @@ module Vantiv
|
|
37
40
|
).run
|
38
41
|
end
|
39
42
|
|
40
|
-
def self.auth(amount:, payment_account_id:, customer_id:, order_id:, expiry_month:, expiry_year
|
43
|
+
def self.auth(amount:, payment_account_id:, customer_id:, order_id:, expiry_month:, expiry_year:,
|
44
|
+
order_source: Vantiv.default_order_source, use_temporarily_stored_security_code: false,
|
45
|
+
online_payment_cryptogram: nil)
|
46
|
+
|
47
|
+
# RE use_temporarily_stored_security_code
|
48
|
+
# From XML Docs:
|
49
|
+
# When you submit the CVV2/CVC2/CID in a registerTokenRequest, the platform encrypts
|
50
|
+
# and stores the value on a temporary basis for later use in a tokenized Auth/Sale
|
51
|
+
# transaction submitted without the value. To use the store value when
|
52
|
+
# submitting an Auth/Sale transaction, set the cardValidationNum value to 000.
|
53
|
+
|
54
|
+
cvv = use_temporarily_stored_security_code ? '000' : nil
|
55
|
+
|
41
56
|
body = Api::RequestBody.for_auth_or_sale(
|
42
57
|
amount: amount,
|
43
58
|
order_id: order_id,
|
44
59
|
customer_id: customer_id,
|
45
60
|
payment_account_id: payment_account_id,
|
46
61
|
expiry_month: expiry_month,
|
47
|
-
expiry_year: expiry_year
|
62
|
+
expiry_year: expiry_year,
|
63
|
+
cvv: cvv,
|
64
|
+
order_source: order_source,
|
65
|
+
online_payment_cryptogram: online_payment_cryptogram
|
48
66
|
)
|
49
67
|
Api::Request.new(
|
50
68
|
endpoint: Api::Endpoints::AUTHORIZATION,
|
@@ -79,14 +97,18 @@ module Vantiv
|
|
79
97
|
).run
|
80
98
|
end
|
81
99
|
|
82
|
-
def self.auth_capture(amount:, payment_account_id:, customer_id:, order_id:,
|
100
|
+
def self.auth_capture(amount:, payment_account_id:, customer_id:, order_id:,
|
101
|
+
expiry_month:, expiry_year:, order_source: Vantiv.default_order_source,
|
102
|
+
online_payment_cryptogram: nil)
|
83
103
|
body = Api::RequestBody.for_auth_or_sale(
|
84
104
|
amount: amount,
|
85
105
|
order_id: order_id,
|
86
106
|
customer_id: customer_id,
|
87
107
|
payment_account_id: payment_account_id,
|
88
108
|
expiry_month: expiry_month,
|
89
|
-
expiry_year: expiry_year
|
109
|
+
expiry_year: expiry_year,
|
110
|
+
order_source: order_source,
|
111
|
+
online_payment_cryptogram: online_payment_cryptogram
|
90
112
|
)
|
91
113
|
Api::Request.new(
|
92
114
|
endpoint: Api::Endpoints::SALE,
|
@@ -109,14 +131,16 @@ module Vantiv
|
|
109
131
|
).run
|
110
132
|
end
|
111
133
|
|
112
|
-
def self.refund(amount:, payment_account_id:, customer_id:, order_id:,
|
134
|
+
def self.refund(amount:, payment_account_id:, customer_id:, order_id:,
|
135
|
+
expiry_month:, expiry_year:, order_source: Vantiv.default_order_source)
|
113
136
|
body = Api::RequestBody.for_return(
|
114
137
|
amount: amount,
|
115
138
|
customer_id: customer_id,
|
116
139
|
order_id: order_id,
|
117
140
|
payment_account_id: payment_account_id,
|
118
141
|
expiry_month: expiry_month,
|
119
|
-
expiry_year: expiry_year
|
142
|
+
expiry_year: expiry_year,
|
143
|
+
order_source: order_source
|
120
144
|
)
|
121
145
|
Api::Request.new(
|
122
146
|
endpoint: Api::Endpoints::RETURN,
|
@@ -139,16 +163,16 @@ module Vantiv
|
|
139
163
|
end
|
140
164
|
|
141
165
|
class << self
|
142
|
-
[
|
143
|
-
|
144
|
-
value = instance_variable_get(:"@#{config_var}")
|
145
|
-
raise "Missing Vantiv configuration: #{config_var}" unless value
|
146
|
-
value
|
147
|
-
end
|
166
|
+
%i[ environment merchant_id default_report_group
|
167
|
+
default_order_source paypage_id user password ].freeze.each do |config_var|
|
148
168
|
|
149
|
-
define_method
|
150
|
-
|
169
|
+
define_method(config_var) do
|
170
|
+
instance_variable_get("@#{config_var}").tap do |value|
|
171
|
+
raise "Missing Vantiv configuration: #{config_var}" unless value
|
172
|
+
end
|
151
173
|
end
|
174
|
+
|
175
|
+
attr_writer config_var
|
152
176
|
end
|
153
177
|
end
|
154
178
|
|
@@ -156,3 +180,4 @@ module Vantiv
|
|
156
180
|
File.dirname __dir__
|
157
181
|
end
|
158
182
|
end
|
183
|
+
|
data/lib/vantiv/api.rb
CHANGED
@@ -1,11 +1,23 @@
|
|
1
1
|
require 'vantiv/api/response'
|
2
|
+
require 'vantiv/api/transaction_response'
|
2
3
|
require 'vantiv/api/tied_transaction_response'
|
3
4
|
require 'vantiv/api/live_transaction_response'
|
4
5
|
require 'vantiv/api/account_updater_response'
|
5
6
|
require 'vantiv/api/tokenization_response'
|
6
7
|
|
8
|
+
require 'vantiv/api/card'
|
9
|
+
require 'vantiv/api/transaction'
|
10
|
+
require 'vantiv/api/payment_account'
|
11
|
+
require 'vantiv/api/address'
|
12
|
+
require 'vantiv/api/fraud_result'
|
13
|
+
|
7
14
|
require 'vantiv/api/request'
|
8
|
-
require 'vantiv/api/
|
15
|
+
require 'vantiv/api/request_body_representer'
|
9
16
|
require 'vantiv/api/request_body'
|
10
17
|
|
18
|
+
require 'vantiv/api/cardholder_authentication'
|
19
|
+
|
20
|
+
require 'vantiv/api/request_body_representer_xml'
|
21
|
+
require 'vantiv/api/response_body_representer_xml'
|
22
|
+
|
11
23
|
require 'vantiv/api/endpoints'
|