vantiv 0.1.0 → 0.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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +64 -0
  3. data/README.md +20 -4
  4. data/cert_fixtures/L_EP_1.json +3 -1
  5. data/cert_fixtures/L_EP_2.json +3 -1
  6. data/cert_fixtures/L_EP_3.json +3 -1
  7. data/cert_fixtures/L_EP_4.json +4 -0
  8. data/cert_fixtures/L_EP_5.json +4 -0
  9. data/cert_fixtures/L_EP_6.json +3 -1
  10. data/cert_fixtures/L_EP_7.json +3 -1
  11. data/exe/vantiv-certify-app +1 -0
  12. data/lib/vantiv.rb +13 -7
  13. data/lib/vantiv/api/live_transaction_response.rb +3 -1
  14. data/lib/vantiv/api/request_body.rb +28 -8
  15. data/lib/vantiv/api/response.rb +16 -5
  16. data/lib/vantiv/api/tokenization_response.rb +4 -0
  17. data/lib/vantiv/mocked_sandbox/api_request.rb +31 -3
  18. data/lib/vantiv/mocked_sandbox/dynamic_response_body.rb +40 -0
  19. data/lib/vantiv/mocked_sandbox/fixture_generator.rb +171 -19
  20. data/lib/vantiv/mocked_sandbox/fixtures/auth--4457002100000005.json.erb +26 -0
  21. data/lib/vantiv/mocked_sandbox/fixtures/auth--4457010000000009.json.erb +27 -0
  22. data/lib/vantiv/mocked_sandbox/fixtures/auth--5112001600000006.json.erb +26 -0
  23. data/lib/vantiv/mocked_sandbox/fixtures/auth--5112001900000003.json.erb +26 -0
  24. data/lib/vantiv/mocked_sandbox/fixtures/auth_capture--4457002100000005.json.erb +26 -0
  25. data/lib/vantiv/mocked_sandbox/fixtures/auth_capture--4457010000000009.json.erb +27 -0
  26. data/lib/vantiv/mocked_sandbox/fixtures/auth_capture--5112001600000006.json.erb +26 -0
  27. data/lib/vantiv/mocked_sandbox/fixtures/auth_capture--5112001900000003.json.erb +26 -0
  28. data/lib/vantiv/mocked_sandbox/fixtures/auth_reversal.json.erb +21 -0
  29. data/lib/vantiv/mocked_sandbox/fixtures/capture.json.erb +21 -0
  30. data/lib/vantiv/mocked_sandbox/fixtures/credit.json.erb +21 -0
  31. data/lib/vantiv/mocked_sandbox/fixtures/refund--4457002100000005.json.erb +22 -0
  32. data/lib/vantiv/mocked_sandbox/fixtures/refund--4457010000000009.json.erb +22 -0
  33. data/lib/vantiv/mocked_sandbox/fixtures/refund--5112001600000006.json.erb +22 -0
  34. data/lib/vantiv/mocked_sandbox/fixtures/refund--5112001900000003.json.erb +22 -0
  35. data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457002100000005.json.erb +4 -4
  36. data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457010000000009.json.erb +2 -2
  37. data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457010010900010.json.erb +3 -4
  38. data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--5112001600000006.json.erb +4 -4
  39. data/lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--5112001900000003.json.erb +2 -2
  40. data/lib/vantiv/mocked_sandbox/fixtures/void.json.erb +21 -0
  41. data/lib/vantiv/test_card.rb +25 -1
  42. data/lib/vantiv/version.rb +1 -1
  43. metadata +20 -2
@@ -0,0 +1,26 @@
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": "e16727852155f082e1c7691d",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "@customerId": "not-dynamic-cust-id",
13
+ "orderId": "not-dynamic-order-id",
14
+ "response": "305",
15
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
16
+ "postDate": "<%= Time.now.strftime('%F') %>",
17
+ "message": "Expired Card",
18
+ "fraudResult": {
19
+ "avsResult": "00"
20
+ },
21
+ "TransactionID": "<%= rand(10**17) %>"
22
+ }
23
+ },
24
+ "RequestID": "8b05b70d-7200-48d7-9a6b-29bd38107454"
25
+ }
26
+ }
@@ -0,0 +1,21 @@
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
+ "authReversalResponse": {
10
+ "@id": "4fbee5b88cb1671134f9c9a2",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "response": "001",
13
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
14
+ "postDate": "<%= Time.now.strftime('%F') %>",
15
+ "message": "Transaction Received",
16
+ "TransactionID": "<%= rand(10**17) %>"
17
+ }
18
+ },
19
+ "RequestID": "5c3a93a0-885d-4388-ac12-cb40464e7ba8"
20
+ }
21
+ }
@@ -0,0 +1,21 @@
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
+ "captureResponse": {
10
+ "@id": "2a265fdb9a2b821d62ad4265",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "response": "001",
13
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
14
+ "postDate": "<%= Time.now.strftime('%F') %>",
15
+ "message": "Transaction Received",
16
+ "TransactionID": "<%= rand(10**17) %>"
17
+ }
18
+ },
19
+ "RequestID": "4112af2e-320c-4f6d-e193-dfa733b329e8"
20
+ }
21
+ }
@@ -0,0 +1,21 @@
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": "f7a0e51169ee434d38320e03",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "response": "001",
13
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
14
+ "postDate": "<%= Time.now.strftime('%F') %>",
15
+ "message": "Transaction Received",
16
+ "TransactionID": "<%= rand(10**17) %>"
17
+ }
18
+ },
19
+ "RequestID": "eb495ea5-b0aa-41bb-d936-52aa46306024"
20
+ }
21
+ }
@@ -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": "a700165516fcd2f6f7ba839b",
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": "e9c631ed-8c9a-4177-c9a5-c03235ea7695"
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": "6dc1c74c2453aef38ce23a9a",
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": "f4de6304-edb3-44eb-d8d7-aa6f03eab315"
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": "3373c6d8c51e565547676c72",
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": "b7a27dbb-eccb-4b4a-ea26-b4b6a9c59ef7"
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": "978fadc121dc8c018fd9a316",
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": "fc45b8c9-4930-443a-bc7c-2de5421d40a7"
21
+ }
22
+ }
@@ -7,17 +7,17 @@
7
7
  "@response": "0",
8
8
  "@message": "Valid Format",
9
9
  "registerTokenResponse": {
10
- "@id": "3cf703ab2b3151397e69abb8",
10
+ "@id": "b95979c353b5c13b5835b8bd",
11
11
  "@reportGroup": "<%= Vantiv.default_report_group %>",
12
- "response": "801",
12
+ "response": "802",
13
13
  "responseTime": "<%= Time.now.strftime('%FT%T') %>",
14
- "message": "Account number was successfully registered",
14
+ "message": "Account number was previously registered",
15
15
  "bin": "445700",
16
16
  "TransactionID": "<%= rand(10**17) %>",
17
17
  "PaymentAccountID": "1111111111120005",
18
18
  "Type": "VI"
19
19
  }
20
20
  },
21
- "RequestID": "793636cb-910d-4e28-d4cd-8efd548b6590"
21
+ "RequestID": "3f48399d-7ae5-4fd7-e4c6-0d28836d97ad"
22
22
  }
23
23
  }
@@ -7,7 +7,7 @@
7
7
  "@response": "0",
8
8
  "@message": "Valid Format",
9
9
  "registerTokenResponse": {
10
- "@id": "b61e4b75273284891b2dabf5",
10
+ "@id": "7cc76ae348ccfbca41173dc0",
11
11
  "@reportGroup": "<%= Vantiv.default_report_group %>",
12
12
  "response": "802",
13
13
  "responseTime": "<%= Time.now.strftime('%FT%T') %>",
@@ -18,6 +18,6 @@
18
18
  "Type": "VI"
19
19
  }
20
20
  },
21
- "RequestID": "2319c224-265a-46fa-9ff8-30878ab35703"
21
+ "RequestID": "edb95a82-2b84-453f-be0c-84fc15656223"
22
22
  }
23
23
  }
@@ -7,15 +7,14 @@
7
7
  "@response": "0",
8
8
  "@message": "Valid Format",
9
9
  "registerTokenResponse": {
10
- "@id": "3a4d4089865d97b4b9afc1ee",
10
+ "@id": "4c4141c81f06319186454db6",
11
11
  "@reportGroup": "<%= Vantiv.default_report_group %>",
12
12
  "response": "820",
13
13
  "responseTime": "<%= Time.now.strftime('%FT%T') %>",
14
14
  "message": "Credit card number was invalid",
15
- "TransactionID": "<%= rand(10**17) %>",
16
- "PaymentAccountID": ""
15
+ "TransactionID": "<%= rand(10**17) %>"
17
16
  }
18
17
  },
19
- "RequestID": "4546b895-8388-4913-8d11-398f92997d2d"
18
+ "RequestID": "45459ca7-8bc9-414e-b002-eaaeb139ce6e"
20
19
  }
21
20
  }
@@ -7,17 +7,17 @@
7
7
  "@response": "0",
8
8
  "@message": "Valid Format",
9
9
  "registerTokenResponse": {
10
- "@id": "9cf8372cf4a87409b1406d26",
10
+ "@id": "6bce54b7201d9f8b1cba91ae",
11
11
  "@reportGroup": "<%= Vantiv.default_report_group %>",
12
- "response": "801",
12
+ "response": "802",
13
13
  "responseTime": "<%= Time.now.strftime('%FT%T') %>",
14
- "message": "Account number was successfully registered",
14
+ "message": "Account number was previously registered",
15
15
  "bin": "511200",
16
16
  "TransactionID": "<%= rand(10**17) %>",
17
17
  "PaymentAccountID": "1111111111130006",
18
18
  "Type": "MC"
19
19
  }
20
20
  },
21
- "RequestID": "d4d086b8-3f6c-4689-ae1e-3159a32d357b"
21
+ "RequestID": "f8b9c779-d233-4f08-f2fe-d95a06ed66db"
22
22
  }
23
23
  }
@@ -7,7 +7,7 @@
7
7
  "@response": "0",
8
8
  "@message": "Valid Format",
9
9
  "registerTokenResponse": {
10
- "@id": "9657fb0a279fe9f019b7d20c",
10
+ "@id": "9b3c2cc795e87083f25338a2",
11
11
  "@reportGroup": "<%= Vantiv.default_report_group %>",
12
12
  "response": "802",
13
13
  "responseTime": "<%= Time.now.strftime('%FT%T') %>",
@@ -18,6 +18,6 @@
18
18
  "Type": "MC"
19
19
  }
20
20
  },
21
- "RequestID": "ec038dcd-b6c8-4433-cd3f-678baaf721c6"
21
+ "RequestID": "42dd4db4-e1aa-49f0-9a8d-f19512f32b01"
22
22
  }
23
23
  }
@@ -0,0 +1,21 @@
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
+ "voidResponse": {
10
+ "@id": "30555f896e154803e250feb1",
11
+ "@reportGroup": "<%= Vantiv.default_report_group %>",
12
+ "response": "001",
13
+ "responseTime": "<%= Time.now.strftime('%FT%T') %>",
14
+ "postDate": "<%= Time.now.strftime('%F') %>",
15
+ "message": "Transaction Received",
16
+ "TransactionID": "<%= rand(10**17) %>"
17
+ }
18
+ },
19
+ "RequestID": "8b7bae9e-c8ee-4031-cf10-337c6c91e98b"
20
+ }
21
+ }
@@ -76,7 +76,15 @@ module Vantiv
76
76
  card_data[:attrs][:card_number] == card_number
77
77
  end
78
78
  raise CardNotFound.new("No card with account number #{card_number}") unless card
79
- new(card[:attrs])
79
+ new(card[:attrs].merge(name: card[:access_method_name]))
80
+ end
81
+
82
+ def self.find_by_payment_account_id(payment_account_id)
83
+ card = CARDS.find do |card_data|
84
+ card_data[:attrs][:mocked_sandbox_payment_account_id] == payment_account_id
85
+ end
86
+ raise CardNotFound.new("No card with mocked sandbox payment account id #{payment_account_id}") unless card
87
+ new(card[:attrs].merge(name: card[:access_method_name]))
80
88
  end
81
89
 
82
90
  attr_reader :card_number, :expiry_month, :expiry_year, :cvv, :mocked_sandbox_payment_account_id, :network, :name
@@ -90,5 +98,21 @@ module Vantiv
90
98
  @network = network
91
99
  @name = name
92
100
  end
101
+
102
+ def ==(other_object)
103
+ if other_object.is_a?(TestCard)
104
+ name == other_object.name
105
+ else
106
+ super
107
+ end
108
+ end
109
+
110
+ def !=(other_object)
111
+ !(self == other_object)
112
+ end
113
+
114
+ def tokenizable?
115
+ self != TestCard.invalid_card_number
116
+ end
93
117
  end
94
118
  end
@@ -1,3 +1,3 @@
1
1
  module Vantiv
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vantiv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Balloch
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-04-01 00:00:00.000000000 Z
12
+ date: 2016-05-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
@@ -123,6 +123,7 @@ files:
123
123
  - ".rspec"
124
124
  - ".ruby-version"
125
125
  - ".travis.yml"
126
+ - CHANGELOG.md
126
127
  - Gemfile
127
128
  - LICENSE.txt
128
129
  - README.md
@@ -234,12 +235,29 @@ files:
234
235
  - lib/vantiv/environment.rb
235
236
  - lib/vantiv/mocked_sandbox.rb
236
237
  - lib/vantiv/mocked_sandbox/api_request.rb
238
+ - lib/vantiv/mocked_sandbox/dynamic_response_body.rb
237
239
  - lib/vantiv/mocked_sandbox/fixture_generator.rb
240
+ - lib/vantiv/mocked_sandbox/fixtures/auth--4457002100000005.json.erb
241
+ - lib/vantiv/mocked_sandbox/fixtures/auth--4457010000000009.json.erb
242
+ - lib/vantiv/mocked_sandbox/fixtures/auth--5112001600000006.json.erb
243
+ - lib/vantiv/mocked_sandbox/fixtures/auth--5112001900000003.json.erb
244
+ - lib/vantiv/mocked_sandbox/fixtures/auth_capture--4457002100000005.json.erb
245
+ - lib/vantiv/mocked_sandbox/fixtures/auth_capture--4457010000000009.json.erb
246
+ - lib/vantiv/mocked_sandbox/fixtures/auth_capture--5112001600000006.json.erb
247
+ - lib/vantiv/mocked_sandbox/fixtures/auth_capture--5112001900000003.json.erb
248
+ - lib/vantiv/mocked_sandbox/fixtures/auth_reversal.json.erb
249
+ - lib/vantiv/mocked_sandbox/fixtures/capture.json.erb
250
+ - lib/vantiv/mocked_sandbox/fixtures/credit.json.erb
251
+ - lib/vantiv/mocked_sandbox/fixtures/refund--4457002100000005.json.erb
252
+ - lib/vantiv/mocked_sandbox/fixtures/refund--4457010000000009.json.erb
253
+ - lib/vantiv/mocked_sandbox/fixtures/refund--5112001600000006.json.erb
254
+ - lib/vantiv/mocked_sandbox/fixtures/refund--5112001900000003.json.erb
238
255
  - lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457002100000005.json.erb
239
256
  - lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457010000000009.json.erb
240
257
  - lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--4457010010900010.json.erb
241
258
  - lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--5112001600000006.json.erb
242
259
  - lib/vantiv/mocked_sandbox/fixtures/tokenize_by_direct_post--5112001900000003.json.erb
260
+ - lib/vantiv/mocked_sandbox/fixtures/void.json.erb
243
261
  - lib/vantiv/paypage.rb
244
262
  - lib/vantiv/test_card.rb
245
263
  - lib/vantiv/version.rb