fat_zebra 3.0.11 → 3.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +3 -5
  4. data/.travis.yml +3 -3
  5. data/README.md +5 -5
  6. data/fat_zebra.gemspec +5 -7
  7. data/lib/fat_zebra.rb +8 -0
  8. data/lib/fat_zebra/api_operation/search.rb +1 -1
  9. data/lib/fat_zebra/authenticate.rb +64 -0
  10. data/lib/fat_zebra/card.rb +1 -0
  11. data/lib/fat_zebra/direct_credit.rb +1 -1
  12. data/lib/fat_zebra/direct_debit.rb +1 -1
  13. data/lib/fat_zebra/paypal/authorization.rb +49 -0
  14. data/lib/fat_zebra/paypal/billing_agreement.rb +56 -0
  15. data/lib/fat_zebra/paypal/capture.rb +36 -0
  16. data/lib/fat_zebra/paypal/order.rb +22 -0
  17. data/lib/fat_zebra/paypal/refund.rb +22 -0
  18. data/lib/fat_zebra/refund.rb +4 -0
  19. data/lib/fat_zebra/util.rb +1 -1
  20. data/lib/fat_zebra/validation.rb +4 -0
  21. data/lib/fat_zebra/version.rb +1 -1
  22. data/spec/cassettes/FatZebra_Authenticate/_authenticate/validations/1_3_5_1.yml +46 -0
  23. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_challenge_response/1_3_3_1.yml +90 -0
  24. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_challenge_response/1_3_3_2.yml +90 -0
  25. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_frictionless_response/1_3_2_1.yml +90 -0
  26. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_frictionless_response/1_3_2_2.yml +90 -0
  27. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_invalid_input/1_3_1_1.yml +90 -0
  28. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_invalid_input/1_3_1_2.yml +87 -0
  29. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_invalid_input/1_3_1_3.yml +92 -0
  30. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_invalid_input/1_3_1_4.yml +91 -0
  31. data/spec/cassettes/FatZebra_Authenticate/_authenticate/with_type_validation/1_3_4_1.yml +46 -0
  32. data/spec/cassettes/FatZebra_Authenticate/_decode_session/when_token_is_invalid/returns_error_when_invalid_token.yml +47 -0
  33. data/spec/cassettes/FatZebra_Authenticate/_decode_session/when_token_is_valid/decodes_JWT.yml +87 -0
  34. data/spec/cassettes/FatZebra_Authenticate/_session/returns_JWT_with_given_params.yml +44 -0
  35. data/spec/cassettes/FatZebra_Authenticate/_session/returns_JWT_with_no_amount.yml +44 -0
  36. data/spec/cassettes/FatZebra_Authenticate/_session/returns_error_when_amount_is_invalid.yml +44 -0
  37. data/spec/cassettes/FatZebra_Authenticate/_session/returns_error_when_currency_is_invalid.yml +46 -0
  38. data/spec/cassettes/FatZebra_BankAccount/_create/1_1_1.yml +8 -14
  39. data/spec/cassettes/FatZebra_BankAccount/_create/1_1_2.yml +8 -14
  40. data/spec/cassettes/FatZebra_BankAccount/_search/1_2_1.yml +34 -52
  41. data/spec/cassettes/FatZebra_BankAccount/_search/1_2_2.yml +34 -52
  42. data/spec/cassettes/FatZebra_BankAccount/_search/1_2_3.yml +34 -52
  43. data/spec/cassettes/FatZebra_Batch/_create/with_file/1_1_1_1.yml +11 -17
  44. data/spec/cassettes/FatZebra_Batch/_create/with_file/1_1_1_2.yml +11 -17
  45. data/spec/cassettes/FatZebra_Batch/_create/with_path/1_1_2_1.yml +11 -17
  46. data/spec/cassettes/FatZebra_Batch/_create/with_path/1_1_2_2.yml +11 -17
  47. data/spec/cassettes/FatZebra_Batch/_find/1_2_1.yml +19 -31
  48. data/spec/cassettes/FatZebra_Batch/_find/1_2_2.yml +19 -31
  49. data/spec/cassettes/FatZebra_Batch/_result/1_4_1.yml +26 -44
  50. data/spec/cassettes/FatZebra_Batch/_search/1_3_1.yml +8 -14
  51. data/spec/cassettes/FatZebra_Batch/_search/1_3_2.yml +8 -14
  52. data/spec/cassettes/FatZebra_Batch/_search/1_3_3.yml +8 -14
  53. data/spec/cassettes/FatZebra_Card/_create/1_1_1.yml +7 -13
  54. data/spec/cassettes/FatZebra_Card/_create/1_1_2.yml +7 -13
  55. data/spec/cassettes/FatZebra_Card/_create/1_1_3.yml +7 -13
  56. data/spec/cassettes/FatZebra_Card/_create/1_1_4.yml +7 -13
  57. data/spec/cassettes/FatZebra_Card/_create/1_1_5.yml +7 -13
  58. data/spec/cassettes/FatZebra_Card/_create/1_1_6.yml +7 -13
  59. data/spec/cassettes/FatZebra_Card/_find/1_3_1.yml +111 -0
  60. data/spec/cassettes/FatZebra_Card/_find/1_3_2.yml +111 -0
  61. data/spec/cassettes/FatZebra_Card/_update/1_2_1.yml +15 -27
  62. data/spec/cassettes/FatZebra_Card/_update/1_2_2.yml +15 -27
  63. data/spec/cassettes/FatZebra_Card/_update/1_2_3.yml +15 -27
  64. data/spec/cassettes/FatZebra_Card/_update/validations/1_2_4_1.yml +7 -13
  65. data/spec/cassettes/FatZebra_Customer/_create/1_1_1.yml +9 -15
  66. data/spec/cassettes/FatZebra_Customer/_create/1_1_2.yml +9 -15
  67. data/spec/cassettes/FatZebra_Customer/_create/1_1_3.yml +9 -15
  68. data/spec/cassettes/FatZebra_Customer/_create/1_1_4.yml +9 -15
  69. data/spec/cassettes/FatZebra_Customer/_create/1_1_5.yml +9 -15
  70. data/spec/cassettes/FatZebra_Customer/_create/1_1_6.yml +9 -15
  71. data/spec/cassettes/FatZebra_Customer/_delete/1_5_1.yml +18 -30
  72. data/spec/cassettes/FatZebra_Customer/_find/1_3_1.yml +18 -30
  73. data/spec/cassettes/FatZebra_Customer/_find/1_3_2.yml +18 -30
  74. data/spec/cassettes/FatZebra_Customer/_search/1_2_1.yml +14 -24
  75. data/spec/cassettes/FatZebra_Customer/_search/1_2_2.yml +14 -24
  76. data/spec/cassettes/FatZebra_Customer/_search/1_2_3.yml +14 -24
  77. data/spec/cassettes/FatZebra_Customer/_update/1_4_1.yml +19 -31
  78. data/spec/cassettes/FatZebra_Customer/_update/1_4_2.yml +19 -31
  79. data/spec/cassettes/FatZebra_DirectCredit/_create/1_1_1.yml +8 -14
  80. data/spec/cassettes/FatZebra_DirectCredit/_create/1_1_2.yml +8 -14
  81. data/spec/cassettes/FatZebra_DirectCredit/_create/1_1_3.yml +8 -14
  82. data/spec/cassettes/FatZebra_DirectCredit/_create/1_1_4.yml +8 -14
  83. data/spec/cassettes/FatZebra_DirectCredit/_create/validations/valid/1_1_5_1_1.yml +7 -13
  84. data/spec/cassettes/FatZebra_DirectCredit/_delete/1_4_1.yml +16 -28
  85. data/spec/cassettes/FatZebra_DirectCredit/_find/1_2_1.yml +16 -28
  86. data/spec/cassettes/FatZebra_DirectCredit/_find/1_2_2.yml +16 -28
  87. data/spec/cassettes/FatZebra_DirectCredit/_find/1_2_3.yml +103 -0
  88. data/spec/cassettes/FatZebra_DirectCredit/_search/1_3_1.yml +24 -42
  89. data/spec/cassettes/FatZebra_DirectCredit/_search/1_3_2.yml +24 -42
  90. data/spec/cassettes/FatZebra_DirectDebit/_create/1_1_1.yml +8 -14
  91. data/spec/cassettes/FatZebra_DirectDebit/_create/1_1_2.yml +8 -14
  92. data/spec/cassettes/FatZebra_DirectDebit/_create/1_1_3.yml +8 -14
  93. data/spec/cassettes/FatZebra_DirectDebit/_create/1_1_4.yml +8 -14
  94. data/spec/cassettes/FatZebra_DirectDebit/_create/validations/valid/1_1_5_1_1.yml +7 -13
  95. data/spec/cassettes/FatZebra_DirectDebit/_delete/1_4_1.yml +16 -28
  96. data/spec/cassettes/FatZebra_DirectDebit/_find/1_2_1.yml +16 -28
  97. data/spec/cassettes/FatZebra_DirectDebit/_find/1_2_2.yml +16 -28
  98. data/spec/cassettes/FatZebra_DirectDebit/_find/1_2_3.yml +103 -0
  99. data/spec/cassettes/FatZebra_DirectDebit/_search/1_3_1.yml +24 -42
  100. data/spec/cassettes/FatZebra_DirectDebit/_search/1_3_2.yml +24 -42
  101. data/spec/cassettes/FatZebra_Information/_ping/1_1_1.yml +7 -13
  102. data/spec/cassettes/FatZebra_Information/_ping/1_1_2.yml +7 -13
  103. data/spec/cassettes/FatZebra_PaymentPlan/_active_/1_8_1.yml +52 -76
  104. data/spec/cassettes/FatZebra_PaymentPlan/_active_/1_8_2.yml +52 -76
  105. data/spec/cassettes/FatZebra_PaymentPlan/_create/1_1_1.yml +22 -34
  106. data/spec/cassettes/FatZebra_PaymentPlan/_create/1_1_2.yml +22 -34
  107. data/spec/cassettes/FatZebra_PaymentPlan/_create/1_1_3.yml +22 -34
  108. data/spec/cassettes/FatZebra_PaymentPlan/_delete/1_5_1.yml +31 -49
  109. data/spec/cassettes/FatZebra_PaymentPlan/_destroy/1_6_1.yml +31 -49
  110. data/spec/cassettes/FatZebra_PaymentPlan/_find/1_2_1.yml +35 -53
  111. data/spec/cassettes/FatZebra_PaymentPlan/_find/1_2_2.yml +35 -53
  112. data/spec/cassettes/FatZebra_PaymentPlan/_find/1_2_3.yml +35 -53
  113. data/spec/cassettes/FatZebra_PaymentPlan/_suspend_/1_7_1.yml +37 -55
  114. data/spec/cassettes/FatZebra_PaymentPlan/_suspend_/1_7_2.yml +37 -55
  115. data/spec/cassettes/FatZebra_PaymentPlan/_update/1_3_1.yml +31 -49
  116. data/spec/cassettes/FatZebra_PaymentPlan/_update/1_3_2.yml +31 -49
  117. data/spec/cassettes/FatZebra_PaymentPlan/_update/1_3_3.yml +31 -49
  118. data/spec/cassettes/FatZebra_PaymentPlan/_update/1_4_1.yml +37 -55
  119. data/spec/cassettes/FatZebra_PaymentPlan/_update/1_4_2.yml +37 -55
  120. data/spec/cassettes/FatZebra_Paypal_Authorization/_capture/returns_a_new_capture_record.yml +45 -0
  121. data/spec/cassettes/FatZebra_Paypal_Authorization/_find/when_found/returns_authorization.yml +46 -0
  122. data/spec/cassettes/FatZebra_Paypal_Authorization/_search/with_date_filter/returns_records_created_after_start_date.yml +46 -0
  123. data/spec/cassettes/FatZebra_Paypal_Authorization/_void/returns_a_voided_capture_record.yml +44 -0
  124. data/spec/cassettes/FatZebra_Paypal_BillingAgreement/_charge/Valid_payload/returns_a_new_order_record.yml +48 -0
  125. data/spec/cassettes/FatZebra_Paypal_BillingAgreement/_find/when_found/returns_billing_agreement.yml +48 -0
  126. data/spec/cassettes/FatZebra_Paypal_BillingAgreement/_search/with_date_filter/returns_records_created_after_start_date.yml +48 -0
  127. data/spec/cassettes/FatZebra_Paypal_Capture/_find/when_found/returns_capture.yml +47 -0
  128. data/spec/cassettes/FatZebra_Paypal_Capture/_refund/returns_a_new_refund_record.yml +45 -0
  129. data/spec/cassettes/FatZebra_Paypal_Capture/_search/with_date_filter/returns_records_created_after_start_date.yml +49 -0
  130. data/spec/cassettes/FatZebra_Paypal_Order/_find/when_found/returns_order.yml +48 -0
  131. data/spec/cassettes/FatZebra_Paypal_Order/_search/with_date_filter/returns_orders_created_after_start_date.yml +55 -0
  132. data/spec/cassettes/FatZebra_Paypal_Refund/_find/when_found/returns_refund.yml +47 -0
  133. data/spec/cassettes/FatZebra_Paypal_Refund/_search/with_date_filter/returns_all_refund_records_created_after_start_date.yml +50 -0
  134. data/spec/cassettes/FatZebra_Purchase/_create/1_1_1.yml +9 -15
  135. data/spec/cassettes/FatZebra_Purchase/_create/1_1_10.yml +9 -15
  136. data/spec/cassettes/FatZebra_Purchase/_create/1_1_11.yml +9 -15
  137. data/spec/cassettes/FatZebra_Purchase/_create/1_1_12.yml +9 -15
  138. data/spec/cassettes/FatZebra_Purchase/_create/1_1_13.yml +9 -15
  139. data/spec/cassettes/FatZebra_Purchase/_create/1_1_2.yml +9 -15
  140. data/spec/cassettes/FatZebra_Purchase/_create/1_1_3.yml +9 -15
  141. data/spec/cassettes/FatZebra_Purchase/_create/1_1_4.yml +9 -15
  142. data/spec/cassettes/FatZebra_Purchase/_create/1_1_5.yml +9 -15
  143. data/spec/cassettes/FatZebra_Purchase/_create/1_1_6.yml +9 -15
  144. data/spec/cassettes/FatZebra_Purchase/_create/1_1_7.yml +9 -15
  145. data/spec/cassettes/FatZebra_Purchase/_create/1_1_8.yml +9 -15
  146. data/spec/cassettes/FatZebra_Purchase/_create/1_1_9.yml +9 -15
  147. data/spec/cassettes/FatZebra_Purchase/_create/bad_request/1_1_14_1.yml +11 -17
  148. data/spec/cassettes/FatZebra_Purchase/_create/bad_request/1_1_14_2.yml +11 -17
  149. data/spec/cassettes/FatZebra_Purchase/_search/1_3_1.yml +36 -54
  150. data/spec/cassettes/FatZebra_Purchase/_search/1_3_2.yml +36 -54
  151. data/spec/cassettes/FatZebra_Purchase/_search/1_3_3.yml +36 -54
  152. data/spec/cassettes/FatZebra_Purchase/_void/1_6_1.yml +18 -30
  153. data/spec/cassettes/FatZebra_Purchase/_void/1_6_2.yml +18 -30
  154. data/spec/cassettes/FatZebra_Purchase/_void/1_6_3.yml +18 -30
  155. data/spec/cassettes/FatZebra_Purchase/_void/1_6_4.yml +18 -30
  156. data/spec/cassettes/FatZebra_Purchase/_void/1_7_1.yml +18 -30
  157. data/spec/cassettes/FatZebra_Purchase/_void/1_7_2.yml +18 -30
  158. data/spec/cassettes/FatZebra_Purchase/_void/1_7_3.yml +18 -30
  159. data/spec/cassettes/FatZebra_Purchase/_void/1_7_4.yml +18 -30
  160. data/spec/cassettes/FatZebra_Refund/_create/1_1_1.yml +18 -30
  161. data/spec/cassettes/FatZebra_Refund/_create/1_1_10.yml +18 -30
  162. data/spec/cassettes/FatZebra_Refund/_create/1_1_2.yml +18 -30
  163. data/spec/cassettes/FatZebra_Refund/_create/1_1_3.yml +18 -30
  164. data/spec/cassettes/FatZebra_Refund/_create/1_1_4.yml +18 -30
  165. data/spec/cassettes/FatZebra_Refund/_create/1_1_5.yml +18 -30
  166. data/spec/cassettes/FatZebra_Refund/_create/1_1_6.yml +18 -30
  167. data/spec/cassettes/FatZebra_Refund/_create/1_1_7.yml +18 -30
  168. data/spec/cassettes/FatZebra_Refund/_create/1_1_8.yml +18 -30
  169. data/spec/cassettes/FatZebra_Refund/_create/1_1_9.yml +18 -30
  170. data/spec/cassettes/FatZebra_Refund/_find/1_2_1.yml +27 -45
  171. data/spec/cassettes/FatZebra_Refund/_find/1_2_2.yml +27 -45
  172. data/spec/cassettes/FatZebra_Refund/_find/1_2_3.yml +27 -45
  173. data/spec/cassettes/FatZebra_Refund/_search/responds_with_the_newly-created_refunds.yml +214 -0
  174. data/spec/cassettes/FatZebra_Refund/_void/1_4_1.yml +27 -45
  175. data/spec/cassettes/FatZebra_Refund/_void/1_4_2.yml +27 -45
  176. data/spec/cassettes/FatZebra_Refund/_void/1_4_3.yml +27 -45
  177. data/spec/cassettes/FatZebra_Refund/_void/1_4_4.yml +27 -45
  178. data/spec/cassettes/FatZebra_WebHook/_create/1_1_1.yml +7 -13
  179. data/spec/cassettes/FatZebra_WebHook/_create/1_1_2.yml +7 -13
  180. data/spec/cassettes/FatZebra_WebHook/_create/1_1_3.yml +7 -13
  181. data/spec/cassettes/FatZebra_WebHook/_delete/1_4_1.yml +15 -27
  182. data/spec/cassettes/FatZebra_WebHook/_search/1_2_1.yml +115 -43
  183. data/spec/cassettes/FatZebra_WebHook/_search/1_2_2.yml +115 -43
  184. data/spec/cassettes/FatZebra_WebHook/_update/1_3_1.yml +15 -27
  185. data/spec/cassettes/FatZebra_WebHook/_update/1_3_2.yml +15 -27
  186. data/spec/lib/fat_zebra/authenticate_spec.rb +187 -0
  187. data/spec/lib/fat_zebra/card_spec.rb +8 -0
  188. data/spec/lib/fat_zebra/direct_credit_spec.rb +14 -1
  189. data/spec/lib/fat_zebra/direct_debit_spec.rb +14 -1
  190. data/spec/lib/fat_zebra/payment_plan_spec.rb +1 -1
  191. data/spec/lib/fat_zebra/paypal/authorization_spec.rb +79 -0
  192. data/spec/lib/fat_zebra/paypal/billing_agreement_spec.rb +62 -0
  193. data/spec/lib/fat_zebra/paypal/capture_spec.rb +60 -0
  194. data/spec/lib/fat_zebra/paypal/order_spec.rb +35 -0
  195. data/spec/lib/fat_zebra/paypal/refund_spec.rb +36 -0
  196. data/spec/lib/fat_zebra/purchase_spec.rb +3 -3
  197. data/spec/lib/fat_zebra/refund_spec.rb +37 -17
  198. data/spec/spec_helper.rb +0 -1
  199. data/spec/support/payloads.rb +135 -0
  200. metadata +59 -15
  201. data/spec/cassettes/FatZebra_Refund/_search/1_3_1.yml +0 -295
  202. data/spec/cassettes/FatZebra_Refund/_search/1_3_2.yml +0 -295
@@ -23,7 +23,7 @@ http_interactions:
23
23
  message: OK
24
24
  headers:
25
25
  Date:
26
- - Tue, 08 May 2018 11:08:19 GMT
26
+ - Mon, 29 Apr 2019 09:20:37 GMT
27
27
  Content-Type:
28
28
  - application/json; charset=utf-8
29
29
  Transfer-Encoding:
@@ -35,27 +35,21 @@ http_interactions:
35
35
  Cache-Control:
36
36
  - no-store
37
37
  X-Request-Version:
38
- - 1.16.9-3186@7b619da
38
+ - 1.16.9-3941@c1d8236
39
+ X-Runtime:
40
+ - '0.033894'
39
41
  Pragma:
40
42
  - no-cache
41
- X-Xss-Protection:
42
- - 1; mode=block
43
43
  X-Request-Id:
44
- - 5f67b8fc031ce658f2e9e7d8
45
- X-Runtime:
46
- - '0.026258'
47
- X-Frame-Options:
48
- - SAMEORIGIN
49
- X-Content-Type-Options:
50
- - nosniff
44
+ - 40b0bc3f8aff4afaedf1759a
51
45
  X-Backend:
52
46
  - sbox-priv-gateway-a
53
47
  body:
54
48
  encoding: UTF-8
55
49
  string: '{"successful":true,"response":{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
56
- hook","id":"071-WH-JKDV6S0Z"},"errors":[],"test":true}'
50
+ hook","id":"071-WH-DJDYU9ZA"},"errors":[],"test":true}'
57
51
  http_version:
58
- recorded_at: Tue, 08 May 2018 11:08:19 GMT
52
+ recorded_at: Mon, 29 Apr 2019 09:20:37 GMT
59
53
  - request:
60
54
  method: post
61
55
  uri: https://gateway.sandbox.fatzebra.com.au/v1.0/web_hooks
@@ -79,7 +73,7 @@ http_interactions:
79
73
  message: OK
80
74
  headers:
81
75
  Date:
82
- - Tue, 08 May 2018 11:08:19 GMT
76
+ - Mon, 29 Apr 2019 09:20:37 GMT
83
77
  Content-Type:
84
78
  - application/json; charset=utf-8
85
79
  Transfer-Encoding:
@@ -91,30 +85,24 @@ http_interactions:
91
85
  Cache-Control:
92
86
  - no-store
93
87
  X-Request-Version:
94
- - 1.16.9-3186@7b619da
88
+ - 1.16.9-3941@c1d8236
89
+ X-Runtime:
90
+ - '0.032197'
95
91
  Pragma:
96
92
  - no-cache
97
- X-Xss-Protection:
98
- - 1; mode=block
99
93
  X-Request-Id:
100
- - ea6d6e9cedee5b8af732f14e
101
- X-Runtime:
102
- - '0.029002'
103
- X-Frame-Options:
104
- - SAMEORIGIN
105
- X-Content-Type-Options:
106
- - nosniff
94
+ - 788e194760c63d4a05335f8c
107
95
  X-Backend:
108
96
  - sbox-priv-gateway-a
109
97
  body:
110
98
  encoding: UTF-8
111
99
  string: '{"successful":true,"response":{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
112
- hook","id":"071-WH-IFMCIB5A"},"errors":[],"test":true}'
100
+ hook","id":"071-WH-KXDEUD81"},"errors":[],"test":true}'
113
101
  http_version:
114
- recorded_at: Tue, 08 May 2018 11:08:19 GMT
102
+ recorded_at: Mon, 29 Apr 2019 09:20:37 GMT
115
103
  - request:
116
104
  method: get
117
- uri: https://gateway.sandbox.fatzebra.com.au/v1.0/web_hooks?limit=10&offets=0&test=true
105
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/web_hooks?limit=10&offset=0&test=true
118
106
  body:
119
107
  encoding: US-ASCII
120
108
  string: ''
@@ -137,7 +125,7 @@ http_interactions:
137
125
  message: OK
138
126
  headers:
139
127
  Date:
140
- - Tue, 08 May 2018 11:08:20 GMT
128
+ - Mon, 29 Apr 2019 09:20:37 GMT
141
129
  Content-Type:
142
130
  - application/json; charset=utf-8
143
131
  Transfer-Encoding:
@@ -149,28 +137,29 @@ http_interactions:
149
137
  Cache-Control:
150
138
  - no-store
151
139
  X-Request-Version:
152
- - 1.16.9-3186@7b619da
140
+ - 1.16.9-3941@c1d8236
141
+ X-Runtime:
142
+ - '0.041893'
153
143
  Pragma:
154
144
  - no-cache
155
- X-Xss-Protection:
156
- - 1; mode=block
157
145
  X-Request-Id:
158
- - 1df12423b43635f403650b12
159
- X-Runtime:
160
- - '0.022507'
161
- X-Frame-Options:
162
- - SAMEORIGIN
163
- X-Content-Type-Options:
164
- - nosniff
146
+ - 0caf5083d70fb82e8b4e50d7
165
147
  X-Backend:
166
148
  - sbox-priv-gateway-a
167
149
  body:
168
150
  encoding: UTF-8
169
- string: '{"successful":true,"response":[{"address":"https://nosnch.in/cc300bb516","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":true,"name":"Test","id":"071-WH-3W2KM1L3"},{"address":"https://requestb.in/1jkvbv31","events":"*","mode":"Test","authentication_username":"","authentication_password":"","is_active":true,"name":"Test","id":"071-WH-17G8TV1C"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
151
+ string: '{"successful":true,"response":[{"address":"https://nosnch.in/cc300bb516","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":true,"name":"Test","id":"071-WH-3W2KM1L3"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
170
152
  hook","id":"071-WH-59WBB09S"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
171
153
  hook","id":"071-WH-B4PU09SR"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
172
154
  hook","id":"071-WH-BDGKELWC"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
173
- hook","id":"071-WH-1K3BR0FQ"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
155
+ hook","id":"071-WH-1K3BR0FQ"},{"address":"http://requestbin.pmnts-sandbox.io/15itqsp1","events":"*","mode":"Test","authentication_username":"pmnts","authentication_password":"******","is_active":true,"name":"Test","id":"071-WH-17G8TV1C"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
156
+ hook","id":"071-WH-H4GJOG0N"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
157
+ hook","id":"071-WH-VTOHWEW3"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
158
+ hook","id":"071-WH-5W9QOBWP"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
159
+ hook","id":"071-WH-AJDNL1B9"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
160
+ hook","id":"071-WH-GVPQIPSU"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
161
+ hook","id":"071-WH-DJDYU9ZA"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
162
+ hook","id":"071-WH-KXDEUD81"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
174
163
  hook","id":"071-WH-5UWU3B16"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
175
164
  hook","id":"071-WH-SJ5IMZ0O"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
176
165
  hook","id":"071-WH-65P737MQ"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
@@ -206,7 +195,9 @@ http_interactions:
206
195
  hook","id":"071-WH-FNXJDTHV"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
207
196
  hook","id":"071-WH-KY73XCEI"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
208
197
  Test hook","id":"071-WH-1IT0ODXR"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
209
- Test hook","id":"071-WH-O3JYYZP6"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
198
+ Test hook","id":"071-WH-O3JYYZP6"},{"address":"https://www.your-server.com/payment/hook","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"Test
199
+ Hook","id":"071-WH-7RNNJP9T"},{"address":"https://www.your-server.com/payment/hook","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"Test
200
+ Hook","id":"071-WH-MJZN06HT"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
210
201
  hook","id":"071-WH-CQIOMJQ5"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
211
202
  hook","id":"071-WH-OBDDB2M5"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
212
203
  hook","id":"071-WH-5SFTPD5A"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
@@ -222,7 +213,88 @@ http_interactions:
222
213
  hook","id":"071-WH-XRI3VWA4"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
223
214
  hook","id":"071-WH-OV26VN20"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
224
215
  hook","id":"071-WH-JKDV6S0Z"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
225
- hook","id":"071-WH-IFMCIB5A"}],"errors":[],"test":true}'
216
+ hook","id":"071-WH-IFMCIB5A"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
217
+ Test hook","id":"071-WH-IU6R12ZF"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
218
+ Test hook","id":"071-WH-1H7L5ZCI"},{"address":"https://www.your-server.com/payment/hook","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"Test
219
+ Hook","id":"071-WH-L6UDV1UN"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
220
+ hook","id":"071-WH-AJRIFECP"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
221
+ hook","id":"071-WH-YJ2WU6RT"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
222
+ hook","id":"071-WH-QRTVX85G"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
223
+ hook","id":"071-WH-1VHTN24O"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
224
+ hook","id":"071-WH-5Y5OZD4L"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
225
+ hook","id":"071-WH-J9NWFUMA"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
226
+ hook","id":"071-WH-I2LQBYJD"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
227
+ Test hook","id":"071-WH-1PZF9UFM"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
228
+ Test hook","id":"071-WH-HEIB7O0S"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
229
+ hook","id":"071-WH-FE6LDUM5"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
230
+ hook","id":"071-WH-Z7N1C7TM"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
231
+ Test hook","id":"071-WH-EWSTKQMJ"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
232
+ Test hook","id":"071-WH-2Y5C9ISE"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
233
+ hook","id":"071-WH-H2P1YLDR"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
234
+ hook","id":"071-WH-GYOOIN9F"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
235
+ hook","id":"071-WH-MVMY3652"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
236
+ hook","id":"071-WH-ZWMI68PR"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
237
+ hook","id":"071-WH-PXUXHDFB"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
238
+ hook","id":"071-WH-QJ8V4Y6"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
239
+ hook","id":"071-WH-884J1HQH"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
240
+ hook","id":"071-WH-RAAKULZA"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
241
+ Test hook","id":"071-WH-S7VL0Z7R"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
242
+ Test hook","id":"071-WH-UQC6KCE4"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
243
+ hook","id":"071-WH-MKHUJAGA"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
244
+ hook","id":"071-WH-FERO0FGQ"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
245
+ hook","id":"071-WH-ELD916O5"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
246
+ hook","id":"071-WH-2633UB4C"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
247
+ hook","id":"071-WH-1GLC38PA"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
248
+ hook","id":"071-WH-R04RNU4F"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
249
+ hook","id":"071-WH-9MN33BBJ"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
250
+ hook","id":"071-WH-VHBY61ZG"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
251
+ hook","id":"071-WH-IWBVZIJL"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
252
+ hook","id":"071-WH-B5RTPW8G"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
253
+ hook","id":"071-WH-5HXRYE8L"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
254
+ hook","id":"071-WH-Y5PVDD7R"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
255
+ Test hook","id":"071-WH-5AR9MJJJ"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
256
+ Test hook","id":"071-WH-99KJFHBJ"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
257
+ hook","id":"071-WH-MHJMG09"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
258
+ hook","id":"071-WH-EHA8OUN"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
259
+ hook","id":"071-WH-58JFZWN3"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
260
+ hook","id":"071-WH-WKML9ZH5"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
261
+ hook","id":"071-WH-D2447VN1"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
262
+ hook","id":"071-WH-4N1WLY1Q"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
263
+ hook","id":"071-WH-UERM4052"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
264
+ Test hook","id":"071-WH-SO8DU26D"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
265
+ Test hook","id":"071-WH-MN855CZY"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
266
+ hook","id":"071-WH-MJYI2MPK"},{"address":"http://requestbin.pmnts-sandbox.io/12xf8hq1","events":"chargeback:*","mode":"Test","authentication_username":"pmnts","authentication_password":"******","is_active":true,"name":"Chargebacks","id":"071-WH-IQITZMWZ"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
267
+ hook","id":"071-WH-T9GWRGUJ"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
268
+ hook","id":"071-WH-WNUCMF2J"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
269
+ hook","id":"071-WH-5S8OZVD"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
270
+ hook","id":"071-WH-T6UKNVSE"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
271
+ hook","id":"071-WH-RCOHFEK2"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
272
+ hook","id":"071-WH-GX528GDG"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
273
+ Test hook","id":"071-WH-5LP21F2E"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
274
+ Test hook","id":"071-WH-O46GZKRR"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
275
+ hook","id":"071-WH-G2ETIJ26"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
276
+ hook","id":"071-WH-ULA0ZNQ9"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
277
+ hook","id":"071-WH-G34SWHK5"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
278
+ hook","id":"071-WH-EW17FI36"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
279
+ hook","id":"071-WH-RTR44MQK"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
280
+ hook","id":"071-WH-2BOHCZUI"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
281
+ hook","id":"071-WH-QASOXU5Z"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
282
+ hook","id":"071-WH-WP9F36IL"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
283
+ hook","id":"071-WH-5T42PXO0"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
284
+ hook","id":"071-WH-JSAWOF8I"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
285
+ Test hook","id":"071-WH-87QV0GRB"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
286
+ Test hook","id":"071-WH-PUTITJDA"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
287
+ hook","id":"071-WH-E7I8SRMF"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
288
+ hook","id":"071-WH-VGOVU82W"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
289
+ hook","id":"071-WH-8YHLBVV5"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
290
+ hook","id":"071-WH-IOM0BGHY"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
291
+ hook","id":"071-WH-G6SJ9HHZ"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
292
+ hook","id":"071-WH-BE8J6WTV"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
293
+ hook","id":"071-WH-N69ITHIM"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
294
+ Test hook","id":"071-WH-EVZ6T0YK"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
295
+ Test hook","id":"071-WH-LPN9BZVS"},{"address":"https://www.your-server.com/payment/hook","events":"*","mode":"Test","authentication_username":"test_user","authentication_password":"*********","is_active":null,"name":"Test
296
+ Hook","id":"071-WH-JGIDLXUF"},{"address":"https://www.your-server.com/payment/hook","events":"*","mode":"Test","authentication_username":"test_user","authentication_password":"***","is_active":null,"name":"Test
297
+ Hook 123","id":"071-WH-V11EEUW7"}],"errors":[],"test":true}'
226
298
  http_version:
227
- recorded_at: Tue, 08 May 2018 11:08:20 GMT
299
+ recorded_at: Mon, 29 Apr 2019 09:20:37 GMT
228
300
  recorded_with: VCR 3.0.3
@@ -23,7 +23,7 @@ http_interactions:
23
23
  message: OK
24
24
  headers:
25
25
  Date:
26
- - Tue, 08 May 2018 11:08:20 GMT
26
+ - Mon, 29 Apr 2019 09:20:37 GMT
27
27
  Content-Type:
28
28
  - application/json; charset=utf-8
29
29
  Transfer-Encoding:
@@ -35,30 +35,24 @@ http_interactions:
35
35
  Cache-Control:
36
36
  - no-store
37
37
  X-Request-Version:
38
- - 1.16.9-3186@7b619da
38
+ - 1.16.9-3941@c1d8236
39
+ X-Runtime:
40
+ - '0.032522'
39
41
  Pragma:
40
42
  - no-cache
41
- X-Xss-Protection:
42
- - 1; mode=block
43
43
  X-Request-Id:
44
- - f6ea309c72e407639cea5b5c
45
- X-Runtime:
46
- - '0.027988'
47
- X-Frame-Options:
48
- - SAMEORIGIN
49
- X-Content-Type-Options:
50
- - nosniff
44
+ - 8cb733fcf021fd9072423e58
51
45
  X-Backend:
52
46
  - sbox-priv-gateway-a
53
47
  body:
54
48
  encoding: UTF-8
55
49
  string: '{"successful":true,"response":{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
56
- hook","id":"071-WH-IU6R12ZF"},"errors":[],"test":true}'
50
+ hook","id":"071-WH-NOQIX4KB"},"errors":[],"test":true}'
57
51
  http_version:
58
- recorded_at: Tue, 08 May 2018 11:08:20 GMT
52
+ recorded_at: Mon, 29 Apr 2019 09:20:37 GMT
59
53
  - request:
60
54
  method: put
61
- uri: https://gateway.sandbox.fatzebra.com.au/v1.0/web_hooks/071-WH-IU6R12ZF
55
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/web_hooks/071-WH-NOQIX4KB
62
56
  body:
63
57
  encoding: UTF-8
64
58
  string: '{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
@@ -80,7 +74,7 @@ http_interactions:
80
74
  message: OK
81
75
  headers:
82
76
  Date:
83
- - Tue, 08 May 2018 11:08:20 GMT
77
+ - Mon, 29 Apr 2019 09:20:37 GMT
84
78
  Content-Type:
85
79
  - application/json; charset=utf-8
86
80
  Transfer-Encoding:
@@ -92,25 +86,19 @@ http_interactions:
92
86
  Cache-Control:
93
87
  - no-store
94
88
  X-Request-Version:
95
- - 1.16.9-3186@7b619da
89
+ - 1.16.9-3941@c1d8236
90
+ X-Runtime:
91
+ - '0.031956'
96
92
  Pragma:
97
93
  - no-cache
98
- X-Xss-Protection:
99
- - 1; mode=block
100
94
  X-Request-Id:
101
- - ebd6bac370b3aab1dab345ab
102
- X-Runtime:
103
- - '0.029835'
104
- X-Frame-Options:
105
- - SAMEORIGIN
106
- X-Content-Type-Options:
107
- - nosniff
95
+ - 94529f48078709302340b848
108
96
  X-Backend:
109
97
  - sbox-priv-gateway-a
110
98
  body:
111
99
  encoding: UTF-8
112
100
  string: '{"successful":true,"response":{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
113
- Test hook","id":"071-WH-IU6R12ZF"},"errors":[],"test":true}'
101
+ Test hook","id":"071-WH-NOQIX4KB"},"errors":[],"test":true}'
114
102
  http_version:
115
- recorded_at: Tue, 08 May 2018 11:08:20 GMT
103
+ recorded_at: Mon, 29 Apr 2019 09:20:37 GMT
116
104
  recorded_with: VCR 3.0.3
@@ -23,7 +23,7 @@ http_interactions:
23
23
  message: OK
24
24
  headers:
25
25
  Date:
26
- - Tue, 08 May 2018 11:08:20 GMT
26
+ - Mon, 29 Apr 2019 09:20:38 GMT
27
27
  Content-Type:
28
28
  - application/json; charset=utf-8
29
29
  Transfer-Encoding:
@@ -35,30 +35,24 @@ http_interactions:
35
35
  Cache-Control:
36
36
  - no-store
37
37
  X-Request-Version:
38
- - 1.16.9-3186@7b619da
38
+ - 1.16.9-3941@c1d8236
39
+ X-Runtime:
40
+ - '0.030886'
39
41
  Pragma:
40
42
  - no-cache
41
- X-Xss-Protection:
42
- - 1; mode=block
43
43
  X-Request-Id:
44
- - f036676f5d59d8ce28caf7db
45
- X-Runtime:
46
- - '0.028663'
47
- X-Frame-Options:
48
- - SAMEORIGIN
49
- X-Content-Type-Options:
50
- - nosniff
44
+ - 1d1740ccf6ae9e943b19214c
51
45
  X-Backend:
52
46
  - sbox-priv-gateway-a
53
47
  body:
54
48
  encoding: UTF-8
55
49
  string: '{"successful":true,"response":{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
56
- hook","id":"071-WH-1H7L5ZCI"},"errors":[],"test":true}'
50
+ hook","id":"071-WH-Q5W5NSU9"},"errors":[],"test":true}'
57
51
  http_version:
58
- recorded_at: Tue, 08 May 2018 11:08:20 GMT
52
+ recorded_at: Mon, 29 Apr 2019 09:20:38 GMT
59
53
  - request:
60
54
  method: put
61
- uri: https://gateway.sandbox.fatzebra.com.au/v1.0/web_hooks/071-WH-1H7L5ZCI
55
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/web_hooks/071-WH-Q5W5NSU9
62
56
  body:
63
57
  encoding: UTF-8
64
58
  string: '{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
@@ -80,7 +74,7 @@ http_interactions:
80
74
  message: OK
81
75
  headers:
82
76
  Date:
83
- - Tue, 08 May 2018 11:08:20 GMT
77
+ - Mon, 29 Apr 2019 09:20:38 GMT
84
78
  Content-Type:
85
79
  - application/json; charset=utf-8
86
80
  Transfer-Encoding:
@@ -92,25 +86,19 @@ http_interactions:
92
86
  Cache-Control:
93
87
  - no-store
94
88
  X-Request-Version:
95
- - 1.16.9-3186@7b619da
89
+ - 1.16.9-3941@c1d8236
90
+ X-Runtime:
91
+ - '0.034236'
96
92
  Pragma:
97
93
  - no-cache
98
- X-Xss-Protection:
99
- - 1; mode=block
100
94
  X-Request-Id:
101
- - a8c5edf2ac586652e4c0b818
102
- X-Runtime:
103
- - '0.029149'
104
- X-Frame-Options:
105
- - SAMEORIGIN
106
- X-Content-Type-Options:
107
- - nosniff
95
+ - 0ca930a64c9287f6466e0332
108
96
  X-Backend:
109
97
  - sbox-priv-gateway-a
110
98
  body:
111
99
  encoding: UTF-8
112
100
  string: '{"successful":true,"response":{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
113
- Test hook","id":"071-WH-1H7L5ZCI"},"errors":[],"test":true}'
101
+ Test hook","id":"071-WH-Q5W5NSU9"},"errors":[],"test":true}'
114
102
  http_version:
115
- recorded_at: Tue, 08 May 2018 11:08:20 GMT
103
+ recorded_at: Mon, 29 Apr 2019 09:20:38 GMT
116
104
  recorded_with: VCR 3.0.3
@@ -0,0 +1,187 @@
1
+ require 'spec_helper'
2
+
3
+ describe FatZebra::Authenticate do
4
+ describe '.session', :vcr do
5
+ subject(:token) { FatZebra::Authenticate.session(valid_3ds_token_payload) }
6
+
7
+ let(:valid_3ds_token_payload) {{
8
+ currency: 'AUD',
9
+ amount: 100
10
+ }}
11
+
12
+ it 'returns JWT with given params' do
13
+ is_expected.to be_accepted
14
+ expect(token.jwt).to be_truthy
15
+ end
16
+
17
+ it 'returns JWT with no amount' do
18
+ valid_3ds_token_payload.delete(:amount)
19
+ is_expected.to be_accepted
20
+ expect(token.jwt).to be_truthy
21
+ end
22
+
23
+ it 'returns error when currency is invalid' do
24
+ valid_3ds_token_payload[:currency] = 'INVALID'
25
+ is_expected.not_to be_accepted
26
+ expect(token.errors).to be_a(Array)
27
+ expect(token.errors.join).to match(/INVALID is not valid for this merchant. Permitted currencies:/)
28
+ end
29
+
30
+ it 'returns error when amount is invalid' do
31
+ valid_3ds_token_payload[:amount] = 'INVALID'
32
+ is_expected.not_to be_accepted
33
+ expect(token.errors).to eq(['Amount is invalid'])
34
+ end
35
+ end
36
+
37
+ describe '.decode_session', :vcr do
38
+ subject(:decoded) { FatZebra::Authenticate.decode_session(token: jwt) }
39
+
40
+ context 'when token is valid' do
41
+ let(:valid_3ds_token_payload) {{
42
+ currency: 'AUD',
43
+ amount: 100
44
+ }}
45
+ let(:jwt) { FatZebra::Authenticate.session(valid_3ds_token_payload).jwt }
46
+
47
+ it 'decodes JWT' do
48
+ is_expected.to be_accepted
49
+ expect(decoded.keys).to include('processor_transaction_id', 'consumer_session_id', 'error_number', 'error_description')
50
+ expect(decoded.errors).to be_empty
51
+ end
52
+ end
53
+
54
+ context 'when token is invalid' do
55
+ let(:jwt) { 'INVALID TOKEN' }
56
+
57
+ it 'returns error when invalid token' do
58
+ is_expected.not_to be_accepted
59
+ expect(decoded.errors).to eq(['Decoding JWT failed: The token is invalid'])
60
+ end
61
+ end
62
+ end
63
+
64
+ describe '.authenticate', :vcr do
65
+ subject(:authenticate) { FatZebra::Authenticate.authenticate(valid_sca_authentication_payload) }
66
+ let!(:credit_card) { FatZebra::Card.create(valid_credit_card_payload) }
67
+
68
+ context 'with invalid input' do
69
+ before do
70
+ valid_sca_authentication_payload[:sca].merge!(valid_sca_enrollment_payload)
71
+ end
72
+
73
+ it do
74
+ valid_sca_authentication_payload[:card_token] = 'INVALID'
75
+ is_expected.not_to be_accepted
76
+ expect(authenticate.errors.join).to match(/Card not found/)
77
+ end
78
+
79
+ it do
80
+ valid_sca_authentication_payload[:sca] = {}
81
+ is_expected.not_to be_accepted
82
+ expect(authenticate.errors.join).to match(/Invalid input data/)
83
+ end
84
+
85
+ it do
86
+ valid_sca_authentication_payload[:currency] = 'INVALID'
87
+ is_expected.not_to be_accepted
88
+ expect(authenticate.errors.join).to match(/INVALID is not valid for this merchant. Permitted currencies:/)
89
+ end
90
+
91
+ it do
92
+ valid_sca_authentication_payload[:amount] = 'INVALID'
93
+ is_expected.not_to be_accepted
94
+ expect(authenticate.errors.join).to match(/3DS authenticate request failed: amount must be filled/)
95
+ end
96
+ end
97
+
98
+ context 'with frictionless response' do
99
+ before do
100
+ valid_credit_card_payload[:card_number] = '4000000000001000'
101
+ valid_sca_authentication_payload[:sca].merge!(valid_sca_enrollment_payload)
102
+ end
103
+
104
+ it do
105
+ is_expected.to be_accepted
106
+ expect(authenticate.keys).to include('enrolled', 'acs_url', 'version', 'card_bin', 'authentication_transaction_id')
107
+ expect(authenticate.errors).to be_empty
108
+ end
109
+
110
+ it do
111
+ expect(authenticate.enrolled).to be_truthy
112
+ expect(authenticate.version).to be_truthy
113
+ expect(authenticate.card_bin).to be_truthy
114
+ expect(authenticate.authentication_transaction_id).to be_truthy
115
+ end
116
+ end
117
+
118
+ context 'with challenge response' do
119
+ before do
120
+ valid_credit_card_payload[:card_number] = '4000000000001091'
121
+ valid_sca_authentication_payload[:sca].merge!(valid_sca_enrollment_payload)
122
+ end
123
+
124
+ it do
125
+ is_expected.to be_accepted
126
+ expect(authenticate.keys).to include('enrolled', 'version', 'card_bin', 'authentication_transaction_id')
127
+ expect(authenticate.errors).to be_empty
128
+ end
129
+
130
+ it do
131
+ expect(authenticate.enrolled).to be_truthy
132
+ expect(authenticate.version).to be_truthy
133
+ expect(authenticate.card_bin).to be_truthy
134
+ expect(authenticate.authentication_transaction_id).to be_truthy
135
+ end
136
+ end
137
+
138
+ context 'with type = validation' do
139
+ subject(:authenticate) { FatZebra::Authenticate.authenticate(valid_sca_authentication_payload) }
140
+
141
+ before do
142
+ allow(FatZebra::Authenticate).to receive(:authenticate)
143
+ .with(valid_sca_authentication_payload)
144
+ .and_return(FatZebra::FatZebraObject.initialize_from(validation_response.to_json))
145
+
146
+ valid_credit_card_payload[:card_number] = '4000000000001091'
147
+ valid_sca_authentication_payload[:sca][:type] = 'validation'
148
+ valid_sca_authentication_payload[:sca].merge!(valid_sca_validation_payload)
149
+ end
150
+
151
+ let(:validation_response) do
152
+ {
153
+ successful: true,
154
+ response: {
155
+ action: {
156
+ proceed: true
157
+ },
158
+ version: '2.2.0',
159
+ enrolled: 'Y',
160
+ cavv: SecureRandom.hex,
161
+ xid: SecureRandom.hex,
162
+ pares: 'Y',
163
+ eci: '05',
164
+ authentication_transaction_id: SecureRandom.hex,
165
+ card_bin: '400000',
166
+ request_id: SecureRandom.hex,
167
+ decision: 'ACCEPT'
168
+ },
169
+ errors: [],
170
+ test: true
171
+ }
172
+ end
173
+
174
+ it do
175
+ is_expected.to be_accepted
176
+ expect(authenticate.keys).to include('enrolled', 'version', 'card_bin', 'authentication_transaction_id', 'cavv', 'eci', 'xid', 'pares')
177
+ expect(authenticate.errors).to be_empty
178
+ end
179
+ end
180
+
181
+ context 'validations' do
182
+ let(:valid_sca_authentication_payload) {{}}
183
+
184
+ it { expect{ authenticate }.to raise_error(FatZebra::RequestValidationError) }
185
+ end
186
+ end
187
+ end