fat_zebra_multi 3.2.0.1 → 3.2.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.travis.yml +3 -3
  4. data/README.md +5 -4
  5. data/fat_zebra_multi.gemspec +4 -3
  6. data/lib/fat_zebra/authenticate.rb +64 -0
  7. data/lib/fat_zebra/card.rb +1 -0
  8. data/lib/fat_zebra/paypal/authorization.rb +49 -0
  9. data/lib/fat_zebra/paypal/billing_agreement.rb +56 -0
  10. data/lib/fat_zebra/paypal/capture.rb +36 -0
  11. data/lib/fat_zebra/paypal/order.rb +22 -0
  12. data/lib/fat_zebra/paypal/refund.rb +22 -0
  13. data/lib/fat_zebra/util.rb +1 -1
  14. data/lib/fat_zebra/version.rb +1 -1
  15. data/lib/fat_zebra.rb +8 -1
  16. data/spec/cassettes/FatZebra_Authenticate/_authenticate/validations/1_3_5_1.yml +46 -0
  17. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_challenge_response/1_3_3_1.yml +90 -0
  18. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_challenge_response/1_3_3_2.yml +90 -0
  19. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_frictionless_response/1_3_2_1.yml +90 -0
  20. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_frictionless_response/1_3_2_2.yml +90 -0
  21. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_invalid_input/1_3_1_1.yml +90 -0
  22. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_invalid_input/1_3_1_2.yml +87 -0
  23. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_invalid_input/1_3_1_3.yml +92 -0
  24. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_invalid_input/1_3_1_4.yml +91 -0
  25. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_type_validation/1_3_4_1.yml +46 -0
  26. data/spec/cassettes/FatZebra_Authenticate/_decode_session/when_token_is_invalid/returns_error_when_invalid_token.yml +47 -0
  27. data/spec/cassettes/FatZebra_Authenticate/_decode_session/when_token_is_valid/decodes_JWT.yml +87 -0
  28. data/spec/cassettes/FatZebra_Authenticate/_session/returns_JWT_with_given_params.yml +44 -0
  29. data/spec/cassettes/FatZebra_Authenticate/_session/returns_JWT_with_no_amount.yml +44 -0
  30. data/spec/cassettes/FatZebra_Authenticate/_session/returns_error_when_amount_is_invalid.yml +44 -0
  31. data/spec/cassettes/FatZebra_Authenticate/_session/returns_error_when_currency_is_invalid.yml +46 -0
  32. data/spec/cassettes/FatZebra_Card/_find/1_3_1.yml +111 -0
  33. data/spec/cassettes/FatZebra_Card/_find/1_3_2.yml +111 -0
  34. data/spec/cassettes/FatZebra_Paypal_Authorization/_capture/returns_a_new_capture_record.yml +45 -0
  35. data/spec/cassettes/{FatZebra_Authorise/_jwt_token/returns_JWT_with_no_params.yml → FatZebra_Paypal_Authorization/_find/when_found/returns_authorization.yml} +5 -5
  36. data/spec/cassettes/FatZebra_Paypal_Authorization/_search/with_date_filter/returns_records_created_after_start_date.yml +46 -0
  37. data/spec/cassettes/FatZebra_Paypal_Authorization/_void/returns_a_voided_capture_record.yml +44 -0
  38. data/spec/cassettes/FatZebra_Paypal_BillingAgreement/_charge/Valid_payload/returns_a_new_order_record.yml +48 -0
  39. data/spec/cassettes/FatZebra_Paypal_BillingAgreement/_find/when_found/returns_billing_agreement.yml +48 -0
  40. data/spec/cassettes/FatZebra_Paypal_BillingAgreement/_search/with_date_filter/returns_records_created_after_start_date.yml +48 -0
  41. data/spec/cassettes/FatZebra_Paypal_Capture/_find/when_found/returns_capture.yml +47 -0
  42. data/spec/cassettes/FatZebra_Paypal_Capture/_refund/returns_a_new_refund_record.yml +45 -0
  43. data/spec/cassettes/FatZebra_Paypal_Capture/_search/with_date_filter/returns_records_created_after_start_date.yml +49 -0
  44. data/spec/cassettes/FatZebra_Paypal_Order/_find/when_found/returns_order.yml +48 -0
  45. data/spec/cassettes/FatZebra_Paypal_Order/_search/with_date_filter/returns_orders_created_after_start_date.yml +55 -0
  46. data/spec/cassettes/{FatZebra_Authorise/_jwt_token/returns_JWT_with_some_params.yml → FatZebra_Paypal_Refund/_find/when_found/returns_refund.yml} +6 -5
  47. data/spec/cassettes/FatZebra_Paypal_Refund/_search/with_date_filter/returns_all_refund_records_created_after_start_date.yml +50 -0
  48. data/spec/lib/fat_zebra/authenticate_spec.rb +187 -0
  49. data/spec/lib/fat_zebra/card_spec.rb +8 -0
  50. data/spec/lib/fat_zebra/paypal/authorization_spec.rb +79 -0
  51. data/spec/lib/fat_zebra/paypal/billing_agreement_spec.rb +62 -0
  52. data/spec/lib/fat_zebra/paypal/capture_spec.rb +60 -0
  53. data/spec/lib/fat_zebra/paypal/order_spec.rb +35 -0
  54. data/spec/lib/fat_zebra/paypal/refund_spec.rb +36 -0
  55. data/spec/spec_helper.rb +0 -1
  56. data/spec/support/payloads.rb +129 -36
  57. metadata +65 -18
  58. data/lib/fat_zebra/authorise.rb +0 -49
  59. data/spec/cassettes/FatZebra_Authorise/_authorise/with_challenge_response/1_2_3_1.yml +0 -48
  60. data/spec/cassettes/FatZebra_Authorise/_authorise/with_challenge_response/1_2_3_2.yml +0 -48
  61. data/spec/cassettes/FatZebra_Authorise/_authorise/with_frictionless_response/1_2_2_1.yml +0 -48
  62. data/spec/cassettes/FatZebra_Authorise/_authorise/with_frictionless_response/1_2_2_2.yml +0 -48
  63. data/spec/cassettes/FatZebra_Authorise/_authorise/with_invalid_input/1_2_1_1.yml +0 -50
  64. data/spec/cassettes/FatZebra_Authorise/_jwt_token/returns_JWT_with_given_params.yml +0 -46
  65. data/spec/lib/fat_zebra/authorise_spec.rb +0 -101
metadata CHANGED
@@ -1,16 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fat_zebra_multi
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0.1
4
+ version: 3.2.3.2
5
5
  platform: ruby
6
6
  authors:
7
- - Matthew Savage
7
+ - Fat Zebra
8
8
  - Aidan Samuel
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-09-11 00:00:00.000000000 Z
12
+ date: 2022-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: byebug
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
14
28
  - !ruby/object:Gem::Dependency
15
29
  name: pry
16
30
  requirement: !ruby/object:Gem::Requirement
@@ -99,7 +113,7 @@ description: Unofficial fork. Integrate with the Fat Zebra internet payment gate
99
113
  (www.fatzebra.com.au), including purchase, refund, auth, capture and recurring billing
100
114
  functionality.
101
115
  email:
102
- - matt@amasses.net
116
+ - support@fatzebra.com
103
117
  - aidan.samuel@supporterhub.com
104
118
  executables: []
105
119
  extensions: []
@@ -121,7 +135,7 @@ files:
121
135
  - lib/fat_zebra/api_operation/search.rb
122
136
  - lib/fat_zebra/api_operation/void.rb
123
137
  - lib/fat_zebra/api_resource.rb
124
- - lib/fat_zebra/authorise.rb
138
+ - lib/fat_zebra/authenticate.rb
125
139
  - lib/fat_zebra/bank_account.rb
126
140
  - lib/fat_zebra/batch.rb
127
141
  - lib/fat_zebra/card.rb
@@ -134,6 +148,11 @@ files:
134
148
  - lib/fat_zebra/information.rb
135
149
  - lib/fat_zebra/object_helper.rb
136
150
  - lib/fat_zebra/payment_plan.rb
151
+ - lib/fat_zebra/paypal/authorization.rb
152
+ - lib/fat_zebra/paypal/billing_agreement.rb
153
+ - lib/fat_zebra/paypal/capture.rb
154
+ - lib/fat_zebra/paypal/order.rb
155
+ - lib/fat_zebra/paypal/refund.rb
137
156
  - lib/fat_zebra/purchase.rb
138
157
  - lib/fat_zebra/refund.rb
139
158
  - lib/fat_zebra/request.rb
@@ -146,14 +165,22 @@ files:
146
165
  - lib/fat_zebra/validation.rb
147
166
  - lib/fat_zebra/version.rb
148
167
  - lib/fat_zebra/web_hook.rb
149
- - spec/cassettes/FatZebra_Authorise/_authorise/with_challenge_response/1_2_3_1.yml
150
- - spec/cassettes/FatZebra_Authorise/_authorise/with_challenge_response/1_2_3_2.yml
151
- - spec/cassettes/FatZebra_Authorise/_authorise/with_frictionless_response/1_2_2_1.yml
152
- - spec/cassettes/FatZebra_Authorise/_authorise/with_frictionless_response/1_2_2_2.yml
153
- - spec/cassettes/FatZebra_Authorise/_authorise/with_invalid_input/1_2_1_1.yml
154
- - spec/cassettes/FatZebra_Authorise/_jwt_token/returns_JWT_with_given_params.yml
155
- - spec/cassettes/FatZebra_Authorise/_jwt_token/returns_JWT_with_no_params.yml
156
- - spec/cassettes/FatZebra_Authorise/_jwt_token/returns_JWT_with_some_params.yml
168
+ - spec/cassettes/FatZebra_Authenticate/_authenticate/validations/1_3_5_1.yml
169
+ - spec/cassettes/FatZebra_Authenticate/_authenticate/with_challenge_response/1_3_3_1.yml
170
+ - spec/cassettes/FatZebra_Authenticate/_authenticate/with_challenge_response/1_3_3_2.yml
171
+ - spec/cassettes/FatZebra_Authenticate/_authenticate/with_frictionless_response/1_3_2_1.yml
172
+ - spec/cassettes/FatZebra_Authenticate/_authenticate/with_frictionless_response/1_3_2_2.yml
173
+ - spec/cassettes/FatZebra_Authenticate/_authenticate/with_invalid_input/1_3_1_1.yml
174
+ - spec/cassettes/FatZebra_Authenticate/_authenticate/with_invalid_input/1_3_1_2.yml
175
+ - spec/cassettes/FatZebra_Authenticate/_authenticate/with_invalid_input/1_3_1_3.yml
176
+ - spec/cassettes/FatZebra_Authenticate/_authenticate/with_invalid_input/1_3_1_4.yml
177
+ - spec/cassettes/FatZebra_Authenticate/_authenticate/with_type_validation/1_3_4_1.yml
178
+ - spec/cassettes/FatZebra_Authenticate/_decode_session/when_token_is_invalid/returns_error_when_invalid_token.yml
179
+ - spec/cassettes/FatZebra_Authenticate/_decode_session/when_token_is_valid/decodes_JWT.yml
180
+ - spec/cassettes/FatZebra_Authenticate/_session/returns_JWT_with_given_params.yml
181
+ - spec/cassettes/FatZebra_Authenticate/_session/returns_JWT_with_no_amount.yml
182
+ - spec/cassettes/FatZebra_Authenticate/_session/returns_error_when_amount_is_invalid.yml
183
+ - spec/cassettes/FatZebra_Authenticate/_session/returns_error_when_currency_is_invalid.yml
157
184
  - spec/cassettes/FatZebra_BankAccount/_create/1_1_1.yml
158
185
  - spec/cassettes/FatZebra_BankAccount/_create/1_1_2.yml
159
186
  - spec/cassettes/FatZebra_BankAccount/_search/1_2_1.yml
@@ -175,6 +202,8 @@ files:
175
202
  - spec/cassettes/FatZebra_Card/_create/1_1_4.yml
176
203
  - spec/cassettes/FatZebra_Card/_create/1_1_5.yml
177
204
  - spec/cassettes/FatZebra_Card/_create/1_1_6.yml
205
+ - spec/cassettes/FatZebra_Card/_find/1_3_1.yml
206
+ - spec/cassettes/FatZebra_Card/_find/1_3_2.yml
178
207
  - spec/cassettes/FatZebra_Card/_update/1_2_1.yml
179
208
  - spec/cassettes/FatZebra_Card/_update/1_2_2.yml
180
209
  - spec/cassettes/FatZebra_Card/_update/1_2_3.yml
@@ -234,6 +263,20 @@ files:
234
263
  - spec/cassettes/FatZebra_PaymentPlan/_update/1_3_3.yml
235
264
  - spec/cassettes/FatZebra_PaymentPlan/_update/1_4_1.yml
236
265
  - spec/cassettes/FatZebra_PaymentPlan/_update/1_4_2.yml
266
+ - spec/cassettes/FatZebra_Paypal_Authorization/_capture/returns_a_new_capture_record.yml
267
+ - spec/cassettes/FatZebra_Paypal_Authorization/_find/when_found/returns_authorization.yml
268
+ - spec/cassettes/FatZebra_Paypal_Authorization/_search/with_date_filter/returns_records_created_after_start_date.yml
269
+ - spec/cassettes/FatZebra_Paypal_Authorization/_void/returns_a_voided_capture_record.yml
270
+ - spec/cassettes/FatZebra_Paypal_BillingAgreement/_charge/Valid_payload/returns_a_new_order_record.yml
271
+ - spec/cassettes/FatZebra_Paypal_BillingAgreement/_find/when_found/returns_billing_agreement.yml
272
+ - spec/cassettes/FatZebra_Paypal_BillingAgreement/_search/with_date_filter/returns_records_created_after_start_date.yml
273
+ - spec/cassettes/FatZebra_Paypal_Capture/_find/when_found/returns_capture.yml
274
+ - spec/cassettes/FatZebra_Paypal_Capture/_refund/returns_a_new_refund_record.yml
275
+ - spec/cassettes/FatZebra_Paypal_Capture/_search/with_date_filter/returns_records_created_after_start_date.yml
276
+ - spec/cassettes/FatZebra_Paypal_Order/_find/when_found/returns_order.yml
277
+ - spec/cassettes/FatZebra_Paypal_Order/_search/with_date_filter/returns_orders_created_after_start_date.yml
278
+ - spec/cassettes/FatZebra_Paypal_Refund/_find/when_found/returns_refund.yml
279
+ - spec/cassettes/FatZebra_Paypal_Refund/_search/with_date_filter/returns_all_refund_records_created_after_start_date.yml
237
280
  - spec/cassettes/FatZebra_Purchase/_capture/1_5_1.yml
238
281
  - spec/cassettes/FatZebra_Purchase/_capture/1_5_2.yml
239
282
  - spec/cassettes/FatZebra_Purchase/_capture/1_5_3.yml
@@ -303,7 +346,7 @@ files:
303
346
  - spec/cassettes/Multiple_accounts/The_basics/1_1_6.yml
304
347
  - spec/fixtures/batch_test.csv
305
348
  - spec/lib/fat_zebra/api_resource_spec.rb
306
- - spec/lib/fat_zebra/authorise_spec.rb
349
+ - spec/lib/fat_zebra/authenticate_spec.rb
307
350
  - spec/lib/fat_zebra/bank_account_spec.rb
308
351
  - spec/lib/fat_zebra/batch_spec.rb
309
352
  - spec/lib/fat_zebra/card_spec.rb
@@ -315,6 +358,11 @@ files:
315
358
  - spec/lib/fat_zebra/information_spec.rb
316
359
  - spec/lib/fat_zebra/multiple_accounts_spec.rb
317
360
  - spec/lib/fat_zebra/payment_plan_spec.rb
361
+ - spec/lib/fat_zebra/paypal/authorization_spec.rb
362
+ - spec/lib/fat_zebra/paypal/billing_agreement_spec.rb
363
+ - spec/lib/fat_zebra/paypal/capture_spec.rb
364
+ - spec/lib/fat_zebra/paypal/order_spec.rb
365
+ - spec/lib/fat_zebra/paypal/refund_spec.rb
318
366
  - spec/lib/fat_zebra/purchase_spec.rb
319
367
  - spec/lib/fat_zebra/refund_spec.rb
320
368
  - spec/lib/fat_zebra/request_spec.rb
@@ -333,17 +381,16 @@ require_paths:
333
381
  - lib
334
382
  required_ruby_version: !ruby/object:Gem::Requirement
335
383
  requirements:
336
- - - "~>"
384
+ - - ">="
337
385
  - !ruby/object:Gem::Version
338
- version: '2.3'
386
+ version: 2.3.0
339
387
  required_rubygems_version: !ruby/object:Gem::Requirement
340
388
  requirements:
341
389
  - - ">="
342
390
  - !ruby/object:Gem::Version
343
391
  version: '0'
344
392
  requirements: []
345
- rubyforge_project:
346
- rubygems_version: 2.7.6.2
393
+ rubygems_version: 3.2.5
347
394
  signing_key:
348
395
  specification_version: 4
349
396
  summary: Unofficial fork of the Fat Zebra API client - integrate your Ruby app with
@@ -1,49 +0,0 @@
1
- module FatZebra
2
- ##
3
- # == FatZebra \Authorise
4
- #
5
- # Manage 3DS authorisation for the API
6
- #
7
- # * token
8
- # * authorise
9
- #
10
- class Authorise < APIResource
11
- @resource_name = 'authorise'
12
-
13
- validates :card_number, required: true, on: :authorise
14
- validates :card_expiry, required: true, on: :authorise
15
- validates :threeds, required: true, on: :authorise
16
-
17
- class << self
18
-
19
- ##
20
- # Returns a JWT token for the 3DS authorisation process
21
- #
22
- # @param [Hash] params
23
- # @param [Hash] options for the request, and configurations (Optional)
24
- #
25
- # @return [FatZebra::Authorise]
26
- def jwt_token(params = {}, options = {})
27
- valid!(params, :jwt_token) if respond_to?(:valid!)
28
-
29
- response = request(:get, "#{resource_path}/jwt_token", params, options)
30
- initialize_from(response)
31
- end
32
-
33
- ##
34
- # Creates a lookup request to 3DS server
35
- #
36
- # @param [Hash] params
37
- # @param [Hash] options for the request, and configurations (Optional)
38
- #
39
- # @return [FatZebra::Authorise]
40
- def authorise(params = {}, options = {})
41
- valid!(params, :authorise) if respond_to?(:valid!)
42
-
43
- response = request(:post, resource_path, params, options)
44
- initialize_from(response)
45
- end
46
- end
47
-
48
- end
49
- end
@@ -1,48 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://gateway.sandbox.fatzebra.com.au/v1.0/authorise
6
- body:
7
- encoding: UTF-8
8
- string: '{"card_number":"4111111111111111","card_expiry":"09/2020","threeds":{"enabled":true,"amount":100,"billing_address1":"SOME
9
- ADDRESS","billing_city":"Sydney","billing_country_code":"036","billing_first_name":"John","billing_last_name":"Smith","billing_postal_code":"2000","billing_state":"NSW","currency_code":"036","df_reference_id":"d11506cf96cdbb83badc","mobile_phone":"1234567890","email":"dev@fatzebra.com.au","transaction_mode":"mobile","transaction_type":"C","order_number":"118884994ef0db99f4f5","shipping_address1":"SOME
10
- ADDRESS","shipping_state":"NSW","shipping_city":"Sydney","shipping_country_code":"036","shipping_address2":"SOME
11
- ADDRESS","shipping_address3":"SOME ADDRESS","shipping_postal_code":"2000","billing_phone":"1234567890","work_phone":"1234567890","billing_address2":"SOME
12
- ADDRESS","billing_address3":"SOME ADDRESS","authentication_indicator":"01","product_code":"PHY","installment":2,"purchase_date":"20200902104008","recurring_end":"20200902","recurring_frequency":31},"test":true}'
13
- headers:
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Accept:
17
- - application/json
18
- User-Agent:
19
- - Ruby
20
- Authorization:
21
- - Basic VEVTVDpURVNU
22
- Content-Type:
23
- - application/json
24
- response:
25
- status:
26
- code: 200
27
- message: OK
28
- headers:
29
- Cache-Control:
30
- - no-store
31
- Pragma:
32
- - no-cache
33
- Content-Type:
34
- - application/json; charset=utf-8
35
- X-Request-Version:
36
- - 1.21.8
37
- X-Request-Id:
38
- - 67d00e9d5db8ed66fbbb01dee8150f11
39
- X-Runtime:
40
- - '1.262001'
41
- Transfer-Encoding:
42
- - chunked
43
- body:
44
- encoding: UTF-8
45
- string: '{"successful":true,"response":{"ThreeDSVersion":"1.0.2","Enrolled":"Y","ErrorDesc":null,"ErrorNo":"0","EciFlag":"07","OrderId":"8000143411954523","TransactionId":"KJpHTe72N6ePm5HTxYk0","TransactionType":null,"SignatureVerification":null,"CardBrand":"VISA","CardBin":"411111","DSTransactionId":null,"RawACSUrl":"https://someacsurl.com","ACSUrl":"https://someacsurl.com","StepUpUrl":"https://somestepupurl.com","Cavv":null,"PAResStatus":null,"Payload":"551f6bb1db7ba013570c9d96a1aa","Xid":null,"ReasonCode":null,"ReasonDesc":null,"ChallengeRequired":null,"StatusReason":null,"ACSTransactionId":null,"ThreeDSServerTransactionId":null},"errors":null,"test":true}'
46
- http_version:
47
- recorded_at: Mon, 02 Sep 2019 00:40:09 GMT
48
- recorded_with: VCR 3.0.3
@@ -1,48 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://gateway.sandbox.fatzebra.com.au/v1.0/authorise
6
- body:
7
- encoding: UTF-8
8
- string: '{"card_number":"4111111111111111","card_expiry":"09/2020","threeds":{"enabled":true,"amount":100,"billing_address1":"SOME
9
- ADDRESS","billing_city":"Sydney","billing_country_code":"036","billing_first_name":"John","billing_last_name":"Smith","billing_postal_code":"2000","billing_state":"NSW","currency_code":"036","df_reference_id":"2bcec7c03322c1603ce0","mobile_phone":"1234567890","email":"dev@fatzebra.com.au","transaction_mode":"mobile","transaction_type":"C","order_number":"eb6932557e2500078ac1","shipping_address1":"SOME
10
- ADDRESS","shipping_state":"NSW","shipping_city":"Sydney","shipping_country_code":"036","shipping_address2":"SOME
11
- ADDRESS","shipping_address3":"SOME ADDRESS","shipping_postal_code":"2000","billing_phone":"1234567890","work_phone":"1234567890","billing_address2":"SOME
12
- ADDRESS","billing_address3":"SOME ADDRESS","authentication_indicator":"01","product_code":"PHY","installment":2,"purchase_date":"20200902104009","recurring_end":"20200902","recurring_frequency":31},"test":true}'
13
- headers:
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Accept:
17
- - application/json
18
- User-Agent:
19
- - Ruby
20
- Authorization:
21
- - Basic VEVTVDpURVNU
22
- Content-Type:
23
- - application/json
24
- response:
25
- status:
26
- code: 200
27
- message: OK
28
- headers:
29
- Cache-Control:
30
- - no-store
31
- Pragma:
32
- - no-cache
33
- Content-Type:
34
- - application/json; charset=utf-8
35
- X-Request-Version:
36
- - 1.21.8
37
- X-Request-Id:
38
- - a31f46e23fa3e98ede0c58f789916eeb
39
- X-Runtime:
40
- - '1.011716'
41
- Transfer-Encoding:
42
- - chunked
43
- body:
44
- encoding: UTF-8
45
- string: '{"successful":true,"response":{"ThreeDSVersion":"1.0.2","Enrolled":"Y","ErrorDesc":null,"ErrorNo":"0","EciFlag":"07","OrderId":"8000087145309035","TransactionId":"p3gebCQ2vbqT7jKzquU0","TransactionType":null,"SignatureVerification":null,"CardBrand":"VISA","CardBin":"411111","DSTransactionId":null,"RawACSUrl":"https://someacsurl.com","ACSUrl":"https://someacsurl.com","StepUpUrl":"https://somestepupurl.com","Cavv":null,"PAResStatus":null,"Payload":"39b8551f6bb1db7ba013570c9d96a1aa","Xid":null,"ReasonCode":null,"ReasonDesc":null,"ChallengeRequired":null,"StatusReason":null,"ACSTransactionId":null,"ThreeDSServerTransactionId":null},"errors":null,"test":true}'
46
- http_version:
47
- recorded_at: Mon, 02 Sep 2019 00:40:10 GMT
48
- recorded_with: VCR 3.0.3
@@ -1,48 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://gateway.sandbox.fatzebra.com.au/v1.0/authorise
6
- body:
7
- encoding: UTF-8
8
- string: '{"card_number":"4000000000001000","card_expiry":"09/2020","threeds":{"enabled":true,"amount":100,"billing_address1":"SOME
9
- ADDRESS","billing_city":"Sydney","billing_country_code":"036","billing_first_name":"John","billing_last_name":"Smith","billing_postal_code":"2000","billing_state":"NSW","currency_code":"036","df_reference_id":"9b078159eefbc57e34fb","mobile_phone":"1234567890","email":"dev@fatzebra.com.au","transaction_mode":"mobile","transaction_type":"C","order_number":"c2123ed55ff5c2d9e024","shipping_address1":"SOME
10
- ADDRESS","shipping_state":"NSW","shipping_city":"Sydney","shipping_country_code":"036","shipping_address2":"SOME
11
- ADDRESS","shipping_address3":"SOME ADDRESS","shipping_postal_code":"2000","billing_phone":"1234567890","work_phone":"1234567890","billing_address2":"SOME
12
- ADDRESS","billing_address3":"SOME ADDRESS","authentication_indicator":"01","product_code":"PHY","installment":2,"purchase_date":"20200902104005","recurring_end":"20200902","recurring_frequency":31},"test":true}'
13
- headers:
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Accept:
17
- - application/json
18
- User-Agent:
19
- - Ruby
20
- Authorization:
21
- - Basic VEVTVDpURVNU
22
- Content-Type:
23
- - application/json
24
- response:
25
- status:
26
- code: 200
27
- message: OK
28
- headers:
29
- Cache-Control:
30
- - no-store
31
- Pragma:
32
- - no-cache
33
- Content-Type:
34
- - application/json; charset=utf-8
35
- X-Request-Version:
36
- - 1.21.8
37
- X-Request-Id:
38
- - 57648875a0bcbe1d7d5fa04695234c31
39
- X-Runtime:
40
- - '1.365493'
41
- Transfer-Encoding:
42
- - chunked
43
- body:
44
- encoding: UTF-8
45
- string: '{"successful":true,"response":{"ThreeDSVersion":"1.0.2","Enrolled":"Y","ErrorDesc":null,"ErrorNo":"0","EciFlag":"07","OrderId":"8000785369280523","TransactionId":"3UFULPbYKAJtaKXx41S0","TransactionType":null,"SignatureVerification":null,"CardBrand":"VISA","CardBin":"400000","DSTransactionId":null,"RawACSUrl":null,"ACSUrl":null,"StepUpUrl":null,"Cavv":null,"PAResStatus":null,"Payload":null,"Xid":null,"ReasonCode":null,"ReasonDesc":null,"ChallengeRequired":null,"StatusReason":null,"ACSTransactionId":null,"ThreeDSServerTransactionId":null},"errors":null,"test":true}'
46
- http_version:
47
- recorded_at: Mon, 02 Sep 2019 00:40:07 GMT
48
- recorded_with: VCR 3.0.3
@@ -1,48 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://gateway.sandbox.fatzebra.com.au/v1.0/authorise
6
- body:
7
- encoding: UTF-8
8
- string: '{"card_number":"4000000000001000","card_expiry":"09/2020","threeds":{"enabled":true,"amount":100,"billing_address1":"SOME
9
- ADDRESS","billing_city":"Sydney","billing_country_code":"036","billing_first_name":"John","billing_last_name":"Smith","billing_postal_code":"2000","billing_state":"NSW","currency_code":"036","df_reference_id":"e65ac29e83de2dcb6fec","mobile_phone":"1234567890","email":"dev@fatzebra.com.au","transaction_mode":"mobile","transaction_type":"C","order_number":"0b6724482dfdf72a0dff","shipping_address1":"SOME
10
- ADDRESS","shipping_state":"NSW","shipping_city":"Sydney","shipping_country_code":"036","shipping_address2":"SOME
11
- ADDRESS","shipping_address3":"SOME ADDRESS","shipping_postal_code":"2000","billing_phone":"1234567890","work_phone":"1234567890","billing_address2":"SOME
12
- ADDRESS","billing_address3":"SOME ADDRESS","authentication_indicator":"01","product_code":"PHY","installment":2,"purchase_date":"20200902104007","recurring_end":"20200902","recurring_frequency":31},"test":true}'
13
- headers:
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Accept:
17
- - application/json
18
- User-Agent:
19
- - Ruby
20
- Authorization:
21
- - Basic VEVTVDpURVNU
22
- Content-Type:
23
- - application/json
24
- response:
25
- status:
26
- code: 200
27
- message: OK
28
- headers:
29
- Cache-Control:
30
- - no-store
31
- Pragma:
32
- - no-cache
33
- Content-Type:
34
- - application/json; charset=utf-8
35
- X-Request-Version:
36
- - 1.21.8
37
- X-Request-Id:
38
- - 3e75bd7fc1cc1e64a5373a1909d64c10
39
- X-Runtime:
40
- - '1.313599'
41
- Transfer-Encoding:
42
- - chunked
43
- body:
44
- encoding: UTF-8
45
- string: '{"successful":true,"response":{"ThreeDSVersion":"1.0.2","Enrolled":"Y","ErrorDesc":null,"ErrorNo":"0","EciFlag":"07","OrderId":"8000886189302370","TransactionId":"SJjPCuSo1xgEQmxhWqz0","TransactionType":null,"SignatureVerification":null,"CardBrand":"VISA","CardBin":"400000","DSTransactionId":null,"RawACSUrl":null,"ACSUrl":null,"StepUpUrl":null,"Cavv":null,"PAResStatus":null,"Payload":null,"Xid":null,"ReasonCode":null,"ReasonDesc":null,"ChallengeRequired":null,"StatusReason":null,"ACSTransactionId":null,"ThreeDSServerTransactionId":null},"errors":null,"test":true}'
46
- http_version:
47
- recorded_at: Mon, 02 Sep 2019 00:40:08 GMT
48
- recorded_with: VCR 3.0.3
@@ -1,50 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://gateway.sandbox.fatzebra.com.au/v1.0/authorise
6
- body:
7
- encoding: UTF-8
8
- string: '{"card_number":"5123456789012346","card_expiry":"08/2019","threeds":{"enabled":true,"amount":100,"billing_address1":"SOME
9
- ADDRESS","billing_city":"Sydney","billing_country_code":"036","billing_first_name":"John","billing_last_name":"Smith","billing_postal_code":"2000","billing_state":"NSW","currency_code":"036","df_reference_id":"ae9c3a1e8a26f09c3312","mobile_phone":"1234567890","email":"dev@fatzebra.com.au","transaction_mode":"mobile","transaction_type":"C","order_number":"7515ae6a2fc575777efa","shipping_address1":"SOME
10
- ADDRESS","shipping_state":"NSW","shipping_city":"Sydney","shipping_country_code":"036","shipping_address2":"SOME
11
- ADDRESS","shipping_address3":"SOME ADDRESS","shipping_postal_code":"2000","billing_phone":"1234567890","work_phone":"1234567890","billing_address2":"SOME
12
- ADDRESS","billing_address3":"SOME ADDRESS","authentication_indicator":"01","product_code":"PHY","installment":2,"purchase_date":"20200902104004","recurring_end":"20200902","recurring_frequency":31},"test":true}'
13
- headers:
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Accept:
17
- - application/json
18
- User-Agent:
19
- - Ruby
20
- Authorization:
21
- - Basic VEVTVDpURVNU
22
- Content-Type:
23
- - application/json
24
- response:
25
- status:
26
- code: 422
27
- message: Unprocessable Entity
28
- headers:
29
- Cache-Control:
30
- - no-store
31
- Pragma:
32
- - no-cache
33
- Content-Type:
34
- - application/json; charset=utf-8
35
- X-Request-Version:
36
- - 1.21.8
37
- X-Request-Id:
38
- - 38c5e6b4a7af7dc35fb8f6608ae52b4c
39
- X-Runtime:
40
- - '1.637937'
41
- Transfer-Encoding:
42
- - chunked
43
- body:
44
- encoding: UTF-8
45
- string: '{"successful":false,"response":{"ThreeDSVersion":"1.0.2","Enrolled":"U","ErrorDesc":"Error
46
- Validating Credit Card Expiration Information Passed (YYMM)","ErrorNo":"4000","EciFlag":"00","OrderId":"8010307730195369","TransactionId":"EBw7c1ZzTL50yr3JH7S0","TransactionType":null,"SignatureVerification":null,"CardBrand":"MASTERCARD","CardBin":"512345","DSTransactionId":null,"RawACSUrl":null,"ACSUrl":null,"StepUpUrl":null,"Cavv":null,"PAResStatus":null,"Payload":null,"Xid":null,"ReasonCode":null,"ReasonDesc":null,"ChallengeRequired":null,"StatusReason":null,"ACSTransactionId":null,"ThreeDSServerTransactionId":null},"errors":"Error
47
- Validating Credit Card Expiration Information Passed (YYMM)","test":true}'
48
- http_version:
49
- recorded_at: Mon, 02 Sep 2019 00:40:05 GMT
50
- recorded_with: VCR 3.0.3
@@ -1,46 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://gateway.sandbox.fatzebra.com.au/v1.0/authorise/jwt_token?amount=100&confirm_url=https://example.com&currency_code=036&order_number=xxxx-xxxx-xxxx&reference_id=xxxx-xxxx-xxxx&test=true
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept-Encoding:
11
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
- Accept:
13
- - application/json
14
- User-Agent:
15
- - Ruby
16
- Host:
17
- - gateway.sandbox.fatzebra.com.au
18
- Authorization:
19
- - Basic VEVTVDpURVNU
20
- Content-Type:
21
- - application/json
22
- response:
23
- status:
24
- code: 200
25
- message: OK
26
- headers:
27
- Cache-Control:
28
- - no-store
29
- Pragma:
30
- - no-cache
31
- Content-Type:
32
- - application/json; charset=utf-8
33
- X-Request-Version:
34
- - 1.21.8
35
- X-Request-Id:
36
- - ca35fe7e5bb33bf91045771b066e3225
37
- X-Runtime:
38
- - '2.541608'
39
- Transfer-Encoding:
40
- - chunked
41
- body:
42
- encoding: UTF-8
43
- string: '{"successful":true,"response":{"jwt":"eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NjczOTkyMDMsImlhdCI6MTU2NzM4NDgwMywiaXNzIjoiNTgyZTBhMjAzM2ZhZGQxMjYwZjk5MGY2IiwianRpIjoiNzJjYzkzZTktY2I0Ni00NjNiLTllZWMtNWFjYzViMzRlZDk2IiwiT3JnVW5pdElkIjoiNTgyYmU5ZGVkYTUyOTMyYTk0NmM0NWM0IiwiT2JqZWN0aWZ5UGF5bG9hZCI6dHJ1ZSwiUmVmZXJlbmNlSWQiOiJlMTdkMGIxNy1jYTViLTRhYzQtYWE3YS0xN2ZhYzQzMDNiM2IifQ.pslZfApXY1MtDA2OKks9OhkEY_KIFkc-XTrO4Xc7zIg","reference_id":"e17d0b17-ca5b-4ac4-aa7a-17fac4303b3b"},"errors":[],"test":true}'
44
- http_version:
45
- recorded_at: Mon, 02 Sep 2019 00:40:03 GMT
46
- recorded_with: VCR 3.0.3
@@ -1,101 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe FatZebra::Authorise do
4
-
5
- describe '.jwt_token', :vcr do
6
- subject(:token) { FatZebra::Authorise.jwt_token(valid_3ds_token_payload) }
7
-
8
- let(:valid_3ds_token_payload) {{
9
- reference_id: 'xxxx-xxxx-xxxx',
10
- confirm_url: 'https://example.com',
11
- order_number: 'xxxx-xxxx-xxxx',
12
- currency_code: '036',
13
- amount: 100
14
- }}
15
-
16
- it 'returns JWT with given params' do
17
- is_expected.to be_accepted
18
- expect(token.jwt).to be_truthy
19
- expect(token.reference_id).to be_truthy
20
- end
21
-
22
- it 'returns JWT with some params' do
23
- valid_3ds_token_payload.delete(:reference_id)
24
- is_expected.to be_accepted
25
- expect(token.jwt).to be_truthy
26
- expect(token.reference_id).to be_truthy
27
- end
28
-
29
- it 'returns JWT with no params' do
30
- valid_3ds_token_payload.clear
31
- is_expected.to be_accepted
32
- expect(token.jwt).to be_truthy
33
- expect(token.reference_id).to be_truthy
34
- end
35
- end
36
-
37
- describe '.authorise', :vcr do
38
- subject(:authorise) { FatZebra::Authorise.authorise(valid_3ds_authorise_payload) }
39
-
40
- context 'with invalid input' do
41
- before do
42
- valid_3ds_authorise_payload[:card_expiry] = DateTime.now.prev_month.strftime('%m/%Y')
43
- end
44
-
45
- it do
46
- is_expected.not_to be_accepted
47
- expect(authorise.errors).to match(/Error Validating Credit Card Expiration/)
48
- end
49
- end
50
-
51
- context 'with frictionless response' do
52
- before do
53
- valid_3ds_authorise_payload[:card_number] = '4000000000001000'
54
- end
55
-
56
- it do
57
- is_expected.to be_accepted
58
- expect(authorise.keys).to include('Enrolled', 'ACSUrl', 'CardBin', 'TransactionId')
59
- expect(authorise.errors).not_to be_truthy
60
- end
61
-
62
- it do
63
- expect(authorise.Enrolled).to eq('Y')
64
- expect(authorise.ACSUrl).not_to be_truthy
65
- expect(authorise.CardBin).to be_truthy
66
- expect(authorise.ErrorNo).to eq('0')
67
- expect(authorise.ErrorDesc).not_to be_truthy
68
- expect(authorise.CardBrand).to be_truthy
69
- expect(authorise.TransactionId).to be_truthy
70
- end
71
- end
72
-
73
- context 'with challenge response' do
74
- before do
75
- valid_3ds_authorise_payload[:card_number] = '4111111111111111'
76
- end
77
-
78
- it do
79
- is_expected.to be_accepted
80
- expect(authorise.keys).to include('Enrolled', 'ACSUrl', 'CardBin', 'TransactionId')
81
- expect(authorise.errors).not_to be_truthy
82
- end
83
-
84
- it do
85
- expect(authorise.Enrolled).to eq('Y')
86
- expect(authorise.ACSUrl).to be_truthy
87
- expect(authorise.CardBin).to be_truthy
88
- expect(authorise.ErrorNo).to eq('0')
89
- expect(authorise.ErrorDesc).not_to be_truthy
90
- expect(authorise.CardBrand).to be_truthy
91
- expect(authorise.TransactionId).to be_truthy
92
- end
93
- end
94
-
95
- context 'validations' do
96
- let(:valid_3ds_authorise_payload) {{}}
97
-
98
- it { expect{ authorise }.to raise_error(FatZebra::RequestValidationError) }
99
- end
100
- end
101
- end