vantiv 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/README.md +11 -2
  4. data/cert_fixtures/L_AU_1.json +19 -0
  5. data/cert_fixtures/L_AU_2.json +19 -0
  6. data/cert_fixtures/L_AU_3.json +19 -0
  7. data/cert_fixtures/L_AU_4.json +19 -0
  8. data/cert_fixtures/L_AU_5.json +19 -0
  9. data/cert_fixtures/L_AU_6.json +19 -0
  10. data/cert_fixtures/L_AU_7.json +19 -0
  11. data/exe/vantiv-certify-app +35 -6
  12. data/lib/vantiv/api.rb +1 -0
  13. data/lib/vantiv/api/account_updater_response.rb +52 -0
  14. data/lib/vantiv/api/capture_response.rb +3 -3
  15. data/lib/vantiv/api/live_transaction_response.rb +7 -2
  16. data/lib/vantiv/api/tied_transaction_response.rb +2 -1
  17. data/lib/vantiv/api/tokenization_response.rb +11 -11
  18. data/lib/vantiv/certification/validation_test_runner.rb +5 -0
  19. data/lib/vantiv/mocked_sandbox/fixture_generator.rb +6 -0
  20. data/lib/vantiv/mocked_sandbox/fixtures/auth--4457000300000007.json.erb +43 -0
  21. data/lib/vantiv/mocked_sandbox/fixtures/auth--4457000301100004.json.erb +33 -0
  22. data/lib/vantiv/mocked_sandbox/fixtures/auth--5112000101110009.json.erb +47 -0
  23. data/lib/vantiv/mocked_sandbox/fixtures/auth_capture--4457000300000007.json.erb +43 -0
  24. data/lib/vantiv/mocked_sandbox/fixtures/auth_capture--4457000301100004.json.erb +33 -0
  25. data/lib/vantiv/mocked_sandbox/fixtures/auth_capture--5112000101110009.json.erb +47 -0
  26. data/lib/vantiv/mocked_sandbox/fixtures/refund--4457000300000007.json.erb +22 -0
  27. data/lib/vantiv/mocked_sandbox/fixtures/refund--4457000301100004.json.erb +22 -0
  28. data/lib/vantiv/mocked_sandbox/fixtures/refund--5112000101110009.json.erb +22 -0
  29. data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457000300000007.json.erb +23 -0
  30. data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457000301100004.json.erb +23 -0
  31. data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--5112000101110009.json.erb +23 -0
  32. data/lib/vantiv/test_card.rb +34 -1
  33. data/lib/vantiv/version.rb +1 -1
  34. data/vantiv-ruby.gemspec +2 -2
  35. metadata +24 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4eafce70c91d564dbbab06586a1fc13f0a7f1458
4
- data.tar.gz: b5abe4e788d601c489d882db8ac0b9f32dbacf59
3
+ metadata.gz: d1efaaa1e08215d02b11aea82752aeae9b0d29e4
4
+ data.tar.gz: 1274890cdde19ddaf6d0a877328c08f8b4982f53
5
5
  SHA512:
6
- metadata.gz: b85dc5bc03b74980e17ab655bd63b0999931a3e512ac4a28ef8a1bd3ee635b26d04e5a5f386930ac7fe722f573c7dac037c86415da70baf3bd484f1014969ae4
7
- data.tar.gz: 97b171c491f1503d1e5eb259d1140ce1e64487297eb8173588450a69eeed428c6a302c3e2a1c6760282143b7c6f70611e247c00fe4f16d80fa2e3cf800ce45e4
6
+ metadata.gz: ab197a8e6a118a8231877afc1a64d7a48c5369365eeb9d1cbe7a96ce222e304bcc8bb3838199eaa1f01f3b392c72210196a88c0e25063800f91f9926f123fe6a
7
+ data.tar.gz: dc10d17ba73113c21575e1c93ee4c7d13e9296b8893aab52c580c6d9b6a83a3b612c0a95f48423d32c65ea4162f0a0bcd34c1b0efeb86dedf6da881062b11217
@@ -1,4 +1,15 @@
1
1
  Vantiv Ruby Changes
2
+ 0.3.0
3
+ -----------
4
+ - Bug/fix: adds expiry arguments to the relevant methods when running the fixture generator
5
+ - Improve certification validation test runner
6
+ - Raise an exception if there is an api error while running certification
7
+ - Update the interface to be more user friendly and return more useful errors
8
+ - Implement account updater response handling
9
+ - Live transaction response objects now contain account updater response objects
10
+ - Add certifications for account updater
11
+ - Add account updater related test cards and test accounts
12
+ - Add related fixtures for the mocked sandbox
2
13
 
3
14
  0.2.0
4
15
  -----------
data/README.md CHANGED
@@ -39,10 +39,10 @@ Vantiv's DevHub requires merchants to certify their applications for usage with
39
39
  To certify your application, run the following script:
40
40
 
41
41
  ```
42
- $ LICENSE_ID=sub-your-license-id-in-here ACCEPTOR_ID=sub-your-acceptor-id-in-here PAYPAGE_ID=your-paypage-id vantiv-certify-app
42
+ $ bundle exec vantiv-certify-app -l sub-your-license-id-in-here -a sub-your-acceptor-id-in-here -p your-paypage-id
43
43
  ```
44
44
 
45
- A certs.txt file will be generated in the directory that the script is run, and then opened. It contains a list of DevHub Certification test names and associated Request IDs, like follows:
45
+ A certs.txt file will be generated in the directory that the script is run, and then opened. It contains a list of DevHub Certification Test IDs and associated Request IDs, like follows:
46
46
 
47
47
  ```
48
48
  L_AC_1, request-id-for-L_AC_1-here
@@ -51,6 +51,15 @@ L_AC_2, request-id-for-L_AC_2-here
51
51
 
52
52
  Navigate to your application's page in DevHub's developer portal (apideveloper.vantiv.com). Paste the contents of this file into the validation form input field, and then click "Validate".
53
53
 
54
+ ### Running a subset of the certifications
55
+
56
+ If you want to just run a subset of the certifications you can pass in the Test ID that you want to which match against using the `--filter_by` option. For example, if you only want to run the Account Updater certification, which have Test IDs that are prefixed with `L_AU`, you would filter by `AU` like follows:
57
+
58
+ ```
59
+ $ bundle exec vantiv-certify-app -l foo -a bar -p bla --filter_by=AU
60
+ ```
61
+
62
+
54
63
  ## Usage
55
64
 
56
65
  The vantiv gem provides a simple ruby client for interacting with Vantiv's DevHub API. This API wraps their Litle/XML API and provides an API that uses json. This gem provides a way for a merchant to:
@@ -0,0 +1,19 @@
1
+ {
2
+ "endpoint": "AUTHORIZATION",
3
+ "body": {
4
+ "Transaction": {
5
+ "ReferenceNumber": "1",
6
+ "TransactionAmount": "100.00",
7
+ "OrderSource": "ecommerce",
8
+ "CustomerID": "345",
9
+ "PartialApprovedFlag": "false"
10
+ },
11
+ "Card": {
12
+ "Type": "VI",
13
+ "CardNumber": "4457000300000007",
14
+ "ExpirationMonth": "01",
15
+ "ExpirationYear": "15",
16
+ "CVV": "349"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "endpoint": "AUTHORIZATION",
3
+ "body": {
4
+ "Transaction": {
5
+ "ReferenceNumber": "1",
6
+ "TransactionAmount": "100.00",
7
+ "OrderSource": "ecommerce",
8
+ "CustomerID": "345",
9
+ "PartialApprovedFlag": "false"
10
+ },
11
+ "Card": {
12
+ "Type": "DI",
13
+ "CardNumber": "6500102087026221",
14
+ "ExpirationMonth": "01",
15
+ "ExpirationYear": "15",
16
+ "CVV": "349"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "endpoint": "SALE",
3
+ "body": {
4
+ "Transaction": {
5
+ "ReferenceNumber": "1",
6
+ "TransactionAmount": "100.00",
7
+ "OrderSource": "ecommerce",
8
+ "CustomerID": "345",
9
+ "PartialApprovedFlag": "false"
10
+ },
11
+ "Card": {
12
+ "Type": "VI",
13
+ "CardNumber": "4457000300000007",
14
+ "ExpirationMonth": "01",
15
+ "ExpirationYear": "15",
16
+ "CVV": "349"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "endpoint": "SALE",
3
+ "body": {
4
+ "Transaction": {
5
+ "ReferenceNumber": "1",
6
+ "TransactionAmount": "100.00",
7
+ "OrderSource": "ecommerce",
8
+ "CustomerID": "345",
9
+ "PartialApprovedFlag": "false"
10
+ },
11
+ "Card": {
12
+ "Type": "DI",
13
+ "CardNumber": "6500102087026221",
14
+ "ExpirationMonth": "01",
15
+ "ExpirationYear": "15",
16
+ "CVV": "349"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "endpoint": "AUTHORIZATION",
3
+ "body": {
4
+ "Transaction": {
5
+ "ReferenceNumber": "1",
6
+ "TransactionAmount": "100.00",
7
+ "OrderSource": "ecommerce",
8
+ "CustomerID": "345",
9
+ "PartialApprovedFlag": "false"
10
+ },
11
+ "Card": {
12
+ "Type": "MC",
13
+ "CardNumber": "5112000101110009",
14
+ "ExpirationMonth": "11",
15
+ "ExpirationYear": "99",
16
+ "CVV": "349"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "endpoint": "AUTHORIZATION",
3
+ "body": {
4
+ "Transaction": {
5
+ "ReferenceNumber": "1",
6
+ "TransactionAmount": "100.00",
7
+ "OrderSource": "ecommerce",
8
+ "CustomerID": "345",
9
+ "PartialApprovedFlag": "false"
10
+ },
11
+ "Card": {
12
+ "Type": "VI",
13
+ "CardNumber": "4457000301100004",
14
+ "ExpirationMonth": "11",
15
+ "ExpirationYear": "99",
16
+ "CVV": "349"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "endpoint": "AUTHORIZATION",
3
+ "body": {
4
+ "Transaction": {
5
+ "ReferenceNumber": "1",
6
+ "TransactionAmount": "100.00",
7
+ "OrderSource": "ecommerce",
8
+ "CustomerID": "345",
9
+ "PartialApprovedFlag": "false"
10
+ },
11
+ "PaymentAccount": {
12
+ "PaymentAccountID": "#{L_AU_3.litleOnlineResponse.saleResponse.tokenResponse.PaymentAccountID}"
13
+ },
14
+ "Card": {
15
+ "ExpirationMonth": "01",
16
+ "ExpirationYear": "15"
17
+ }
18
+ }
19
+ }
@@ -2,22 +2,51 @@
2
2
 
3
3
  require 'vantiv'
4
4
  require 'vantiv/certification/validation_test_runner'
5
+ require 'optparse'
5
6
 
6
- unless ENV['ACCEPTOR_ID'] && ENV['LICENSE_ID'] && ENV['PAYPAGE_ID']
7
- raise "Vantiv License ID, Acceptor ID, Paypage ID and Application ID required"
7
+ options = {}
8
+ parser = OptionParser.new do |opts|
9
+ opts.banner = "Usage: vantiv-certify-app -a <acceptor_id> -l <license_id> -p <paypage_id> [--filter_by <test_name>]"
10
+
11
+ opts.on("-a", "--acceptor_id ACCEPTOR_ID", "Vantiv Acceptor ID") do |acceptor_id|
12
+ options[:acceptor_id] = acceptor_id
13
+ end
14
+
15
+ opts.on("-l", "--license_id LICENSE_ID", "Vantiv License ID") do |license_id|
16
+ options[:license_id] = license_id
17
+ end
18
+
19
+ opts.on("-p", "--paypage_id PAYPAGE_ID", "Vantiv Paypage ID") do |paypage_id|
20
+ options[:paypage_id] = paypage_id
21
+ end
22
+
23
+ opts.on("--filter_by [TEST_NAME]", "Filter which certifications to run") do |filter|
24
+ options[:filter_by] = filter
25
+ end
26
+ end
27
+
28
+ parser.parse!
29
+
30
+ required_arguments = %i[acceptor_id license_id paypage_id]
31
+ missing_arguments = required_arguments.select{ |required_argument| options[required_argument].nil? }
32
+
33
+ if missing_arguments.any?
34
+ puts "Missing options: #{missing_arguments.join(", ")}"
35
+ puts parser.banner
36
+ exit
8
37
  end
9
38
 
10
39
  Vantiv.configure do |config|
11
- config.license_id = ENV["LICENSE_ID"]
12
- config.acceptor_id = ENV["ACCEPTOR_ID"]
13
- config.paypage_id = ENV["PAYPAGE_ID"]
40
+ config.license_id = options.fetch(:license_id)
41
+ config.acceptor_id = options.fetch(:acceptor_id)
42
+ config.paypage_id = options.fetch(:paypage_id)
14
43
  config.environment = Vantiv::Environment::CERTIFICATION
15
44
 
16
45
  config.default_report_group = '1'
17
46
  end
18
47
 
19
48
  Vantiv::Certification::ValidationTestRunner.run(
20
- filter_by: ENV["FILTER_BY"],
49
+ filter_by: options[:filter_by],
21
50
  save_to: "certs.txt"
22
51
  )
23
52
 
@@ -1,6 +1,7 @@
1
1
  require 'vantiv/api/response'
2
2
  require 'vantiv/api/tied_transaction_response'
3
3
  require 'vantiv/api/live_transaction_response'
4
+ require 'vantiv/api/account_updater_response'
4
5
  require 'vantiv/api/tokenization_response'
5
6
 
6
7
  require 'vantiv/api/request'
@@ -0,0 +1,52 @@
1
+ module Vantiv
2
+ module Api
3
+ class AccountUpdaterResponse
4
+ def initialize(account_updater)
5
+ @account_updater_response = account_updater
6
+ end
7
+
8
+ def payment_account_id
9
+ new_card_token_info["PaymentAccountID"]
10
+ end
11
+
12
+ def card_type
13
+ new_card_token_info["Type"]
14
+ end
15
+
16
+ def expiry_month
17
+ new_card_token_info["ExpirationMonth"]
18
+ end
19
+
20
+ def expiry_year
21
+ new_card_token_info["ExpirationYear"]
22
+ end
23
+
24
+ def extended_card_response_code
25
+ extended_card_response["code"]
26
+ end
27
+
28
+ def extended_card_response_message
29
+ extended_card_response["message"]
30
+ end
31
+
32
+ def new_card_token?
33
+ new_card_token_info.any?
34
+ end
35
+
36
+ def extended_card_response?
37
+ extended_card_response.any?
38
+ end
39
+
40
+ private
41
+ attr_reader :account_updater_response
42
+
43
+ def new_card_token_info
44
+ account_updater_response.fetch("newCardTokenInfo", {})
45
+ end
46
+
47
+ def extended_card_response
48
+ account_updater_response.fetch("extendedCardResponse", {})
49
+ end
50
+ end
51
+ end
52
+ end
@@ -1,15 +1,15 @@
1
1
  module Vantiv
2
2
  module Api
3
3
  class CaptureResponse < Api::Response
4
- ResponseCodes = {
4
+ RESPONSE_CODES = {
5
5
  transaction_received: '001',
6
6
  # TODO: check this and other possible response codes for this txn,
7
7
  # because currently the API _ONLY_ returns 001... :'(
8
8
  invalid_amount: '209'
9
- }
9
+ }.freeze
10
10
 
11
11
  def success?
12
- !api_level_failure? && response_code == ResponseCodes[:transaction_received]
12
+ !api_level_failure? && response_code == RESPONSE_CODES[:transaction_received]
13
13
  end
14
14
 
15
15
  def failure?
@@ -9,7 +9,7 @@ module Vantiv
9
9
  expired_card: '305',
10
10
  token_not_found: '822',
11
11
  token_invalid: '823'
12
- }
12
+ }.freeze
13
13
 
14
14
  LIVE_TRANSACTION_RESPONSE_NAMES = {
15
15
  auth: "authorizationResponse",
@@ -42,8 +42,13 @@ module Vantiv
42
42
  response_code == RESPONSE_CODES[:expired_card]
43
43
  end
44
44
 
45
- private
45
+ def account_updater
46
+ @account_updater ||= AccountUpdaterResponse.new(
47
+ litle_transaction_response.fetch("accountUpdater", {})
48
+ )
49
+ end
46
50
 
51
+ private
47
52
  def transaction_approved?
48
53
  response_code == RESPONSE_CODES[:approved]
49
54
  end
@@ -3,7 +3,8 @@ module Vantiv
3
3
  class TiedTransactionResponse < Api::Response
4
4
  RESPONSE_CODES = {
5
5
  transaction_received: '001'
6
- }
6
+ }.freeze
7
+
7
8
  TIED_TRANSACTION_RESPONSE_NAMES = {
8
9
  auth_reversal: 'authReversalResponse',
9
10
  capture: "captureResponse",
@@ -2,17 +2,17 @@ module Vantiv
2
2
  module Api
3
3
  class TokenizationResponse < Api::Response
4
4
  RESPONSE_CODES = {
5
- account_successfully_registered: "801",
6
- account_already_registered: "802",
7
- credit_card_number_invalid: "820",
8
- merchant_not_authorized_for_tokens: "821",
9
- token_not_found: "822",
10
- token_invalid: "823",
11
- invalid_paypage_registration_id: "877",
12
- expired_paypage_registration_id: "878",
13
- generic_token_registration_error: "898",
14
- generic_token_use_error: "899"
15
- }
5
+ account_successfully_registered: '801',
6
+ account_already_registered: '802',
7
+ credit_card_number_invalid: '820',
8
+ merchant_not_authorized_for_tokens: '821',
9
+ token_not_found: '822',
10
+ token_invalid: '823',
11
+ invalid_paypage_registration_id: '877',
12
+ expired_paypage_registration_id: '878',
13
+ generic_token_registration_error: '898',
14
+ generic_token_use_error: '899'
15
+ }.freeze
16
16
 
17
17
  def success?
18
18
  !api_level_failure? && tokenization_successful?
@@ -95,6 +95,11 @@ module Vantiv
95
95
  response_object: Vantiv::Api::Response.new
96
96
  ).run
97
97
 
98
+ if response.api_level_failure?
99
+ error_message = "CERT FAILED: #{cert_name} \n WITH: #{response.body}"
100
+ raise StandardError.new(error_message)
101
+ end
102
+
98
103
  response_cache.push(cert_name, response)
99
104
  results_file << "#{cert_name},#{response.request_id}\n"
100
105
  end
@@ -49,6 +49,8 @@ module Vantiv
49
49
  cert_response = Vantiv.auth_capture(
50
50
  amount: 10901,
51
51
  payment_account_id: card.payment_account_id,
52
+ expiry_month: card.expiry_month,
53
+ expiry_year: card.expiry_year,
52
54
  customer_id: "not-dynamic-cust-id",
53
55
  order_id: "not-dynamic-order-id"
54
56
  )
@@ -63,6 +65,8 @@ module Vantiv
63
65
  cert_response = Vantiv.auth(
64
66
  amount: 10901,
65
67
  payment_account_id: card.payment_account_id,
68
+ expiry_month: card.expiry_month,
69
+ expiry_year: card.expiry_year,
66
70
  customer_id: "not-dynamic-cust-id",
67
71
  order_id: "not-dynamic-order-id"
68
72
  )
@@ -77,6 +81,8 @@ module Vantiv
77
81
  cert_response = Vantiv.refund(
78
82
  amount: 10901,
79
83
  payment_account_id: card.payment_account_id,
84
+ expiry_month: card.expiry_month,
85
+ expiry_year: card.expiry_year,
80
86
  customer_id: "not-dynamic-cust-id",
81
87
  order_id: "not-dynamic-order-id"
82
88
  )
@@ -0,0 +1,43 @@
1
+ {
2
+ "httpok": true,
3
+ "http_response_code": "200",
4
+ "response_body": {
5
+ "litleOnlineResponse": {
6
+ "@version": "10.2",
7
+ "@response": "0",
8
+ "@message": "Valid Format",
9
+ "authorizationResponse": {
10
+ "@id": "0d12e55c8a33073a11d3cee1",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "@customerId": "not-dynamic-cust-id",
13
+ "orderId": "not-dynamic-order-id",
14
+ "response": "000",
15
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
16
+ "postDate": "<%= Time.now.strftime('%F') %>",
17
+ "message": "Approved",
18
+ "authCode": "654321",
19
+ "accountUpdater": {
20
+ "originalCardTokenInfo": {
21
+ "bin": "445700",
22
+ "PaymentAccountID": "1111000242220007",
23
+ "Type": "VI",
24
+ "ExpirationMonth": "01",
25
+ "ExpirationYear": "15"
26
+ },
27
+ "newCardTokenInfo": {
28
+ "bin": "511200",
29
+ "PaymentAccountID": "1112000247040003",
30
+ "Type": "MC",
31
+ "ExpirationMonth": "01",
32
+ "ExpirationYear": "15"
33
+ }
34
+ },
35
+ "fraudResult": {
36
+ "avsResult": "12"
37
+ },
38
+ "TransactionID": "<%= rand(10**17) %>"
39
+ }
40
+ },
41
+ "RequestID": "433bb593-fe52-4b6b-ee71-b0c26d38d711"
42
+ }
43
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "httpok": true,
3
+ "http_response_code": "200",
4
+ "response_body": {
5
+ "litleOnlineResponse": {
6
+ "@version": "10.2",
7
+ "@response": "0",
8
+ "@message": "Valid Format",
9
+ "authorizationResponse": {
10
+ "@id": "83cf937a566ae82f88054bf4",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "@customerId": "not-dynamic-cust-id",
13
+ "orderId": "not-dynamic-order-id",
14
+ "response": "000",
15
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
16
+ "postDate": "<%= Time.now.strftime('%F') %>",
17
+ "message": "Approved",
18
+ "authCode": "123457",
19
+ "accountUpdater": {
20
+ "extendedCardResponse": {
21
+ "code": "504",
22
+ "message": "Contact the cardholder for updated information"
23
+ }
24
+ },
25
+ "fraudResult": {
26
+ "avsResult": "00"
27
+ },
28
+ "TransactionID": "<%= rand(10**17) %>"
29
+ }
30
+ },
31
+ "RequestID": "73268927-b273-4a07-b5cf-bacaafb446c9"
32
+ }
33
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "httpok": true,
3
+ "http_response_code": "200",
4
+ "response_body": {
5
+ "litleOnlineResponse": {
6
+ "@version": "10.2",
7
+ "@response": "0",
8
+ "@message": "Valid Format",
9
+ "authorizationResponse": {
10
+ "@id": "90f46988ecb53684f70ad8ba",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "@customerId": "not-dynamic-cust-id",
13
+ "orderId": "not-dynamic-order-id",
14
+ "response": "000",
15
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
16
+ "postDate": "<%= Time.now.strftime('%F') %>",
17
+ "message": "Approved",
18
+ "authCode": "123457",
19
+ "accountUpdater": {
20
+ "originalCardTokenInfo": {
21
+ "bin": "511200",
22
+ "PaymentAccountID": "1112000239160009",
23
+ "Type": "MC",
24
+ "ExpirationMonth": "11",
25
+ "ExpirationYear": "99"
26
+ },
27
+ "newCardTokenInfo": {
28
+ "bin": "445700",
29
+ "PaymentAccountID": "1111000288150001",
30
+ "Type": "VI",
31
+ "ExpirationMonth": "11",
32
+ "ExpirationYear": "99"
33
+ },
34
+ "extendedCardResponse": {
35
+ "code": "501",
36
+ "message": "The account was closed"
37
+ }
38
+ },
39
+ "fraudResult": {
40
+ "avsResult": "00"
41
+ },
42
+ "TransactionID": "<%= rand(10**17) %>"
43
+ }
44
+ },
45
+ "RequestID": "b0d811ec-f575-4c0b-c316-ef873e92682f"
46
+ }
47
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "httpok": true,
3
+ "http_response_code": "200",
4
+ "response_body": {
5
+ "litleOnlineResponse": {
6
+ "@version": "10.2",
7
+ "@response": "0",
8
+ "@message": "Valid Format",
9
+ "saleResponse": {
10
+ "@id": "d7f76be2e184f15778a08370",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "@customerId": "not-dynamic-cust-id",
13
+ "orderId": "not-dynamic-order-id",
14
+ "response": "000",
15
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
16
+ "postDate": "<%= Time.now.strftime('%F') %>",
17
+ "message": "Approved",
18
+ "authCode": "654321",
19
+ "accountUpdater": {
20
+ "originalCardTokenInfo": {
21
+ "bin": "445700",
22
+ "PaymentAccountID": "1111000242220007",
23
+ "Type": "VI",
24
+ "ExpirationMonth": "01",
25
+ "ExpirationYear": "15"
26
+ },
27
+ "newCardTokenInfo": {
28
+ "bin": "511200",
29
+ "PaymentAccountID": "1112000247040003",
30
+ "Type": "MC",
31
+ "ExpirationMonth": "01",
32
+ "ExpirationYear": "15"
33
+ }
34
+ },
35
+ "fraudResult": {
36
+ "avsResult": "12"
37
+ },
38
+ "TransactionID": "<%= rand(10**17) %>"
39
+ }
40
+ },
41
+ "RequestID": "924ec9ea-2cb5-4960-d487-54e09555ddc4"
42
+ }
43
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "httpok": true,
3
+ "http_response_code": "200",
4
+ "response_body": {
5
+ "litleOnlineResponse": {
6
+ "@version": "10.2",
7
+ "@response": "0",
8
+ "@message": "Valid Format",
9
+ "saleResponse": {
10
+ "@id": "dcfb9b1146c325ae2b81ef8b",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "@customerId": "not-dynamic-cust-id",
13
+ "orderId": "not-dynamic-order-id",
14
+ "response": "000",
15
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
16
+ "postDate": "<%= Time.now.strftime('%F') %>",
17
+ "message": "Approved",
18
+ "authCode": "123457",
19
+ "accountUpdater": {
20
+ "extendedCardResponse": {
21
+ "code": "504",
22
+ "message": "Contact the cardholder for updated information"
23
+ }
24
+ },
25
+ "fraudResult": {
26
+ "avsResult": "00"
27
+ },
28
+ "TransactionID": "<%= rand(10**17) %>"
29
+ }
30
+ },
31
+ "RequestID": "91fc5e75-8c73-4236-9294-950045eb8e18"
32
+ }
33
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "httpok": true,
3
+ "http_response_code": "200",
4
+ "response_body": {
5
+ "litleOnlineResponse": {
6
+ "@version": "10.2",
7
+ "@response": "0",
8
+ "@message": "Valid Format",
9
+ "saleResponse": {
10
+ "@id": "06d227679a4401ed29f5a8ee",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "@customerId": "not-dynamic-cust-id",
13
+ "orderId": "not-dynamic-order-id",
14
+ "response": "000",
15
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
16
+ "postDate": "<%= Time.now.strftime('%F') %>",
17
+ "message": "Approved",
18
+ "authCode": "123457",
19
+ "accountUpdater": {
20
+ "originalCardTokenInfo": {
21
+ "bin": "511200",
22
+ "PaymentAccountID": "1112000239160009",
23
+ "Type": "MC",
24
+ "ExpirationMonth": "11",
25
+ "ExpirationYear": "99"
26
+ },
27
+ "newCardTokenInfo": {
28
+ "bin": "445700",
29
+ "PaymentAccountID": "1111000288150001",
30
+ "Type": "VI",
31
+ "ExpirationMonth": "11",
32
+ "ExpirationYear": "99"
33
+ },
34
+ "extendedCardResponse": {
35
+ "code": "501",
36
+ "message": "The account was closed"
37
+ }
38
+ },
39
+ "fraudResult": {
40
+ "avsResult": "00"
41
+ },
42
+ "TransactionID": "<%= rand(10**17) %>"
43
+ }
44
+ },
45
+ "RequestID": "1c44b672-56ff-42fd-c877-479365d93d50"
46
+ }
47
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "httpok": true,
3
+ "http_response_code": "200",
4
+ "response_body": {
5
+ "litleOnlineResponse": {
6
+ "@version": "10.2",
7
+ "@response": "0",
8
+ "@message": "Valid Format",
9
+ "creditResponse": {
10
+ "@id": "55932cc299579b693e377e08",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "@customerId": "not-dynamic-cust-id",
13
+ "response": "001",
14
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
15
+ "postDate": "<%= Time.now.strftime('%F') %>",
16
+ "message": "Transaction Received",
17
+ "TransactionID": "<%= rand(10**17) %>"
18
+ }
19
+ },
20
+ "RequestID": "22b06bb5-6ffb-474a-e9e4-2190c5d9a2a1"
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "httpok": true,
3
+ "http_response_code": "200",
4
+ "response_body": {
5
+ "litleOnlineResponse": {
6
+ "@version": "10.2",
7
+ "@response": "0",
8
+ "@message": "Valid Format",
9
+ "creditResponse": {
10
+ "@id": "3f1f4d9dc10a832642d740ef",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "@customerId": "not-dynamic-cust-id",
13
+ "response": "001",
14
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
15
+ "postDate": "<%= Time.now.strftime('%F') %>",
16
+ "message": "Transaction Received",
17
+ "TransactionID": "<%= rand(10**17) %>"
18
+ }
19
+ },
20
+ "RequestID": "6b7f3723-22d8-4306-dc17-7e5ef082040a"
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "httpok": true,
3
+ "http_response_code": "200",
4
+ "response_body": {
5
+ "litleOnlineResponse": {
6
+ "@version": "10.2",
7
+ "@response": "0",
8
+ "@message": "Valid Format",
9
+ "creditResponse": {
10
+ "@id": "8c7e276a2d1ad091eb3bb229",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "@customerId": "not-dynamic-cust-id",
13
+ "response": "001",
14
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
15
+ "postDate": "<%= Time.now.strftime('%F') %>",
16
+ "message": "Transaction Received",
17
+ "TransactionID": "<%= rand(10**17) %>"
18
+ }
19
+ },
20
+ "RequestID": "6cd60cef-3d05-4658-81f3-f9112ce89d03"
21
+ }
22
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "httpok": true,
3
+ "http_response_code": "200",
4
+ "response_body": {
5
+ "litleOnlineResponse": {
6
+ "@version": "10.2",
7
+ "@response": "0",
8
+ "@message": "Valid Format",
9
+ "registerTokenResponse": {
10
+ "@id": "3184cbf03f86c15efb4caad0",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "response": "802",
13
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
14
+ "message": "Account number was previously registered",
15
+ "bin": "445700",
16
+ "TransactionID": "<%= rand(10**17) %>",
17
+ "PaymentAccountID": "1111111111120007",
18
+ "Type": "VI"
19
+ }
20
+ },
21
+ "RequestID": "de076c5d-43d0-43ff-d1a2-65f8103de2c7"
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "httpok": true,
3
+ "http_response_code": "200",
4
+ "response_body": {
5
+ "litleOnlineResponse": {
6
+ "@version": "10.2",
7
+ "@response": "0",
8
+ "@message": "Valid Format",
9
+ "registerTokenResponse": {
10
+ "@id": "fcaae319313d48026e691eb9",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "response": "802",
13
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
14
+ "message": "Account number was previously registered",
15
+ "bin": "445700",
16
+ "TransactionID": "<%= rand(10**17) %>",
17
+ "PaymentAccountID": "1111111111130004",
18
+ "Type": "VI"
19
+ }
20
+ },
21
+ "RequestID": "cda65f65-d6be-40da-cd48-e16002073648"
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "httpok": true,
3
+ "http_response_code": "200",
4
+ "response_body": {
5
+ "litleOnlineResponse": {
6
+ "@version": "10.2",
7
+ "@response": "0",
8
+ "@message": "Valid Format",
9
+ "registerTokenResponse": {
10
+ "@id": "c2fe47f62ecc065c290fdc6a",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "response": "802",
13
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
14
+ "message": "Account number was previously registered",
15
+ "bin": "511200",
16
+ "TransactionID": "<%= rand(10**17) %>",
17
+ "PaymentAccountID": "1111111111160009",
18
+ "Type": "MC"
19
+ }
20
+ },
21
+ "RequestID": "9f9a6403-1766-4df5-a34d-e4a10c547cdf"
22
+ }
23
+ }
@@ -56,7 +56,40 @@ module Vantiv
56
56
  mocked_sandbox_payment_account_id: "1111111111140003",
57
57
  network: "MC"
58
58
  }
59
- }
59
+ },
60
+ {
61
+ access_method_name: "account_updater",
62
+ attrs: {
63
+ card_number: "4457000300000007",
64
+ expiry_month: "01",
65
+ expiry_year: "15",
66
+ cvv: "123",
67
+ mocked_sandbox_payment_account_id: "1111111111120007",
68
+ network: "VI"
69
+ }
70
+ },
71
+ {
72
+ access_method_name: "account_updater_account_closed",
73
+ attrs: {
74
+ card_number: "5112000101110009",
75
+ expiry_month: "11",
76
+ expiry_year: "99",
77
+ cvv: "123",
78
+ mocked_sandbox_payment_account_id: "1111111111160009",
79
+ network: "MC"
80
+ }
81
+ },
82
+ {
83
+ access_method_name: "account_updater_contact_cardholder",
84
+ attrs: {
85
+ card_number: "4457000301100004",
86
+ expiry_month: "11",
87
+ expiry_year: "99",
88
+ cvv: "123",
89
+ mocked_sandbox_payment_account_id: "1111111111130004",
90
+ network: "VI"
91
+ }
92
+ },
60
93
  ]
61
94
 
62
95
  def self.all
@@ -1,3 +1,3 @@
1
1
  module Vantiv
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -6,8 +6,8 @@ require 'vantiv/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "vantiv"
8
8
  spec.version = Vantiv::VERSION
9
- spec.authors = ["Joshua Balloch", "Chris Voxland"]
10
- spec.email = ["joshuaballoch@gmail.com", "chrisvoxland@gmail.com"]
9
+ spec.authors = ["Joshua Balloch", "Chris Voxland", "Scott Bartell"]
10
+ spec.email = ["joshuaballoch@gmail.com", "chrisvoxland@gmail.com", "me@scottbartell.com"]
11
11
 
12
12
  spec.summary = %q{A simple ruby client to use Vantiv's DevHub API}
13
13
  spec.homepage = "https://github.com/plated/vantiv-ruby"
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vantiv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Balloch
8
8
  - Chris Voxland
9
+ - Scott Bartell
9
10
  autorequire:
10
11
  bindir: exe
11
12
  cert_chain: []
12
- date: 2016-05-05 00:00:00.000000000 Z
13
+ date: 2016-06-22 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: selenium-webdriver
@@ -113,6 +114,7 @@ description:
113
114
  email:
114
115
  - joshuaballoch@gmail.com
115
116
  - chrisvoxland@gmail.com
117
+ - me@scottbartell.com
116
118
  executables:
117
119
  - vantiv-certify-app
118
120
  extensions: []
@@ -158,6 +160,13 @@ files:
158
160
  - cert_fixtures/L_AR_4B.json
159
161
  - cert_fixtures/L_AR_5.json
160
162
  - cert_fixtures/L_AR_5A.json
163
+ - cert_fixtures/L_AU_1.json
164
+ - cert_fixtures/L_AU_2.json
165
+ - cert_fixtures/L_AU_3.json
166
+ - cert_fixtures/L_AU_4.json
167
+ - cert_fixtures/L_AU_5.json
168
+ - cert_fixtures/L_AU_6.json
169
+ - cert_fixtures/L_AU_7.json
161
170
  - cert_fixtures/L_EP_1.json
162
171
  - cert_fixtures/L_EP_2.json
163
172
  - cert_fixtures/L_EP_3.json
@@ -217,6 +226,7 @@ files:
217
226
  - exe/vantiv-certify-app
218
227
  - lib/vantiv.rb
219
228
  - lib/vantiv/api.rb
229
+ - lib/vantiv/api/account_updater_response.rb
220
230
  - lib/vantiv/api/capture_response.rb
221
231
  - lib/vantiv/api/endpoints.rb
222
232
  - lib/vantiv/api/live_transaction_response.rb
@@ -237,24 +247,36 @@ files:
237
247
  - lib/vantiv/mocked_sandbox/api_request.rb
238
248
  - lib/vantiv/mocked_sandbox/dynamic_response_body.rb
239
249
  - lib/vantiv/mocked_sandbox/fixture_generator.rb
250
+ - lib/vantiv/mocked_sandbox/fixtures/auth--4457000300000007.json.erb
251
+ - lib/vantiv/mocked_sandbox/fixtures/auth--4457000301100004.json.erb
240
252
  - lib/vantiv/mocked_sandbox/fixtures/auth--4457002100000005.json.erb
241
253
  - lib/vantiv/mocked_sandbox/fixtures/auth--4457010000000009.json.erb
254
+ - lib/vantiv/mocked_sandbox/fixtures/auth--5112000101110009.json.erb
242
255
  - lib/vantiv/mocked_sandbox/fixtures/auth--5112001600000006.json.erb
243
256
  - lib/vantiv/mocked_sandbox/fixtures/auth--5112001900000003.json.erb
257
+ - lib/vantiv/mocked_sandbox/fixtures/auth_capture--4457000300000007.json.erb
258
+ - lib/vantiv/mocked_sandbox/fixtures/auth_capture--4457000301100004.json.erb
244
259
  - lib/vantiv/mocked_sandbox/fixtures/auth_capture--4457002100000005.json.erb
245
260
  - lib/vantiv/mocked_sandbox/fixtures/auth_capture--4457010000000009.json.erb
261
+ - lib/vantiv/mocked_sandbox/fixtures/auth_capture--5112000101110009.json.erb
246
262
  - lib/vantiv/mocked_sandbox/fixtures/auth_capture--5112001600000006.json.erb
247
263
  - lib/vantiv/mocked_sandbox/fixtures/auth_capture--5112001900000003.json.erb
248
264
  - lib/vantiv/mocked_sandbox/fixtures/auth_reversal.json.erb
249
265
  - lib/vantiv/mocked_sandbox/fixtures/capture.json.erb
250
266
  - lib/vantiv/mocked_sandbox/fixtures/credit.json.erb
267
+ - lib/vantiv/mocked_sandbox/fixtures/refund--4457000300000007.json.erb
268
+ - lib/vantiv/mocked_sandbox/fixtures/refund--4457000301100004.json.erb
251
269
  - lib/vantiv/mocked_sandbox/fixtures/refund--4457002100000005.json.erb
252
270
  - lib/vantiv/mocked_sandbox/fixtures/refund--4457010000000009.json.erb
271
+ - lib/vantiv/mocked_sandbox/fixtures/refund--5112000101110009.json.erb
253
272
  - lib/vantiv/mocked_sandbox/fixtures/refund--5112001600000006.json.erb
254
273
  - lib/vantiv/mocked_sandbox/fixtures/refund--5112001900000003.json.erb
274
+ - lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457000300000007.json.erb
275
+ - lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457000301100004.json.erb
255
276
  - lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457002100000005.json.erb
256
277
  - lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457010000000009.json.erb
257
278
  - lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457010010900010.json.erb
279
+ - lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--5112000101110009.json.erb
258
280
  - lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--5112001600000006.json.erb
259
281
  - lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--5112001900000003.json.erb
260
282
  - lib/vantiv/mocked_sandbox/fixtures/void.json.erb