fat_zebra 2.0.13 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.rubocop.yml +42 -0
- data/.travis.yml +9 -2
- data/Gemfile +1 -1
- data/{README.markdown → README.md} +19 -20
- data/Rakefile +2 -12
- data/fat_zebra.gemspec +27 -0
- data/lib/fat_zebra/api_operation/delete.rb +38 -0
- data/lib/fat_zebra/api_operation/find.rb +23 -0
- data/lib/fat_zebra/api_operation/save.rb +62 -0
- data/lib/fat_zebra/api_operation/search.rb +32 -0
- data/lib/fat_zebra/api_operation/void.rb +52 -0
- data/lib/fat_zebra/api_resource.rb +135 -0
- data/lib/fat_zebra/bank_account.rb +21 -0
- data/lib/fat_zebra/batch.rb +56 -0
- data/lib/fat_zebra/card.rb +22 -0
- data/lib/fat_zebra/config.rb +65 -25
- data/lib/fat_zebra/customer.rb +27 -0
- data/lib/fat_zebra/direct_credit.rb +27 -0
- data/lib/fat_zebra/direct_debit.rb +27 -0
- data/lib/fat_zebra/errors.rb +18 -4
- data/lib/fat_zebra/fat_zebra_object.rb +179 -0
- data/lib/fat_zebra/information.rb +25 -0
- data/lib/fat_zebra/payment_plan.rb +62 -0
- data/lib/fat_zebra/purchase.rb +99 -0
- data/lib/fat_zebra/refund.rb +25 -0
- data/lib/fat_zebra/request/multipart/epilogue.rb +23 -0
- data/lib/fat_zebra/request/multipart/file_io.rb +40 -0
- data/lib/fat_zebra/request/multipart/param.rb +37 -0
- data/lib/fat_zebra/request/multipart/part.rb +28 -0
- data/lib/fat_zebra/request/multipart/stream.rb +55 -0
- data/lib/fat_zebra/request.rb +162 -0
- data/lib/fat_zebra/util.rb +70 -0
- data/lib/fat_zebra/validation.rb +47 -0
- data/lib/fat_zebra/version.rb +1 -1
- data/lib/fat_zebra/web_hook.rb +23 -0
- data/lib/fat_zebra.rb +51 -55
- data/spec/cassettes/FatZebra_BankAccount/_create/1_1_1.yml +57 -0
- data/spec/cassettes/FatZebra_BankAccount/_create/1_1_2.yml +57 -0
- data/spec/cassettes/FatZebra_BankAccount/_create/validations/1_1_3_1.yml +57 -0
- data/spec/cassettes/FatZebra_BankAccount/_search/1_2_1.yml +172 -0
- data/spec/cassettes/FatZebra_BankAccount/_search/1_2_2.yml +172 -0
- data/spec/cassettes/FatZebra_BankAccount/_search/1_2_3.yml +172 -0
- data/spec/cassettes/FatZebra_Batch/_create/1_1_1.yml +58 -0
- data/spec/cassettes/FatZebra_Batch/_create/1_1_2.yml +58 -0
- data/spec/cassettes/FatZebra_Batch/_create/validations/1_1_3_1.yml +57 -0
- data/spec/cassettes/FatZebra_Batch/_create/with_file/1_1_1_1.yml +58 -0
- data/spec/cassettes/FatZebra_Batch/_create/with_file/1_1_1_2.yml +58 -0
- data/spec/cassettes/FatZebra_Batch/_create/with_path/1_1_2_1.yml +58 -0
- data/spec/cassettes/FatZebra_Batch/_create/with_path/1_1_2_2.yml +58 -0
- data/spec/cassettes/FatZebra_Batch/_find/1_2_1.yml +109 -0
- data/spec/cassettes/FatZebra_Batch/_find/1_2_2.yml +109 -0
- data/spec/cassettes/FatZebra_Batch/_result/1_4_1.yml +160 -0
- data/spec/cassettes/FatZebra_Batch/_search/1_3_1.yml +54 -0
- data/spec/cassettes/FatZebra_Batch/_search/1_3_2.yml +54 -0
- data/spec/cassettes/FatZebra_Batch/_search/1_3_3.yml +54 -0
- data/spec/cassettes/FatZebra_Card/_create/1_1_1.yml +55 -0
- data/spec/cassettes/FatZebra_Card/_create/1_1_2.yml +55 -0
- data/spec/cassettes/FatZebra_Card/_create/1_1_3.yml +55 -0
- data/spec/cassettes/FatZebra_Card/_create/1_1_4.yml +55 -0
- data/spec/cassettes/FatZebra_Card/_create/1_1_5.yml +55 -0
- data/spec/cassettes/FatZebra_Card/_create/1_1_6.yml +55 -0
- data/spec/cassettes/FatZebra_Card/_create/validations/1_1_7_1.yml +56 -0
- data/spec/cassettes/FatZebra_Card/_update/1_2_1.yml +105 -0
- data/spec/cassettes/FatZebra_Card/_update/1_2_2.yml +105 -0
- data/spec/cassettes/FatZebra_Card/_update/1_2_3.yml +105 -0
- data/spec/cassettes/FatZebra_Card/_update/validations/1_2_4_1.yml +55 -0
- data/spec/cassettes/FatZebra_Customer/_create/1_1_1.yml +59 -0
- data/spec/cassettes/FatZebra_Customer/_create/1_1_2.yml +59 -0
- data/spec/cassettes/FatZebra_Customer/_create/1_1_3.yml +59 -0
- data/spec/cassettes/FatZebra_Customer/_create/1_1_4.yml +59 -0
- data/spec/cassettes/FatZebra_Customer/_create/1_1_5.yml +59 -0
- data/spec/cassettes/FatZebra_Customer/_create/1_1_6.yml +59 -0
- data/spec/cassettes/FatZebra_Customer/_create/validations/1_1_7_1.yml +56 -0
- data/spec/cassettes/FatZebra_Customer/_delete/1_4_1.yml +113 -0
- data/spec/cassettes/FatZebra_Customer/_delete/1_5_1.yml +113 -0
- data/spec/cassettes/FatZebra_Customer/_find/1_2_1.yml +111 -0
- data/spec/cassettes/FatZebra_Customer/_find/1_2_2.yml +111 -0
- data/spec/cassettes/FatZebra_Customer/_find/1_3_1.yml +111 -0
- data/spec/cassettes/FatZebra_Customer/_find/1_3_2.yml +111 -0
- data/spec/cassettes/FatZebra_Customer/_search/1_2_1.yml +56 -0
- data/spec/cassettes/FatZebra_Customer/_search/1_2_2.yml +56 -0
- data/spec/cassettes/FatZebra_Customer/_search/1_2_3.yml +56 -0
- data/spec/cassettes/FatZebra_Customer/_update/1_3_1.yml +114 -0
- data/spec/cassettes/FatZebra_Customer/_update/1_3_2.yml +114 -0
- data/spec/cassettes/FatZebra_Customer/_update/1_4_1.yml +114 -0
- data/spec/cassettes/FatZebra_Customer/_update/1_4_2.yml +114 -0
- data/spec/cassettes/FatZebra_DirectCredit/_create/1_1_1.yml +56 -0
- data/spec/cassettes/FatZebra_DirectCredit/_create/1_1_2.yml +56 -0
- data/spec/cassettes/FatZebra_DirectCredit/_create/1_1_3.yml +56 -0
- data/spec/cassettes/FatZebra_DirectCredit/_create/1_1_4.yml +56 -0
- data/spec/cassettes/FatZebra_DirectCredit/_create/validations/1_1_5_1.yml +59 -0
- data/spec/cassettes/FatZebra_DirectCredit/_delete/1_4_1.yml +109 -0
- data/spec/cassettes/FatZebra_DirectCredit/_find/1_2_1.yml +107 -0
- data/spec/cassettes/FatZebra_DirectCredit/_find/1_2_2.yml +107 -0
- data/spec/cassettes/FatZebra_DirectCredit/_search/1_3_1.yml +160 -0
- data/spec/cassettes/FatZebra_DirectCredit/_search/1_3_2.yml +160 -0
- data/spec/cassettes/FatZebra_DirectDebit/_create/1_1_1.yml +56 -0
- data/spec/cassettes/FatZebra_DirectDebit/_create/1_1_2.yml +56 -0
- data/spec/cassettes/FatZebra_DirectDebit/_create/1_1_3.yml +56 -0
- data/spec/cassettes/FatZebra_DirectDebit/_create/1_1_4.yml +56 -0
- data/spec/cassettes/FatZebra_DirectDebit/_create/validations/1_1_5_1.yml +59 -0
- data/spec/cassettes/FatZebra_DirectDebit/_delete/1_4_1.yml +109 -0
- data/spec/cassettes/FatZebra_DirectDebit/_find/1_2_1.yml +107 -0
- data/spec/cassettes/FatZebra_DirectDebit/_find/1_2_2.yml +107 -0
- data/spec/cassettes/FatZebra_DirectDebit/_search/1_3_1.yml +160 -0
- data/spec/cassettes/FatZebra_DirectDebit/_search/1_3_2.yml +160 -0
- data/spec/cassettes/FatZebra_Information/_ping/1_1_1.yml +54 -0
- data/spec/cassettes/FatZebra_Information/_ping/1_1_2.yml +54 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_active_/1_7_1.yml +238 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_active_/1_7_2.yml +238 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_active_/1_8_1.yml +238 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_active_/1_8_2.yml +238 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_create/1_1_1.yml +118 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_create/1_1_2.yml +118 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_create/1_1_3.yml +118 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_create/validations/1_1_4_1.yml +55 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_delete/1_5_1.yml +172 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_destroy/1_6_1.yml +172 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_find/1_2_1.yml +175 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_find/1_2_2.yml +175 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_find/1_2_3.yml +175 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_suspend_/1_6_1.yml +178 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_suspend_/1_6_2.yml +178 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_suspend_/1_7_1.yml +178 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_suspend_/1_7_2.yml +178 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_update/1_3_1.yml +172 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_update/1_3_2.yml +172 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_update/1_3_3.yml +172 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_update/1_4_1.yml +178 -0
- data/spec/cassettes/FatZebra_PaymentPlan/_update/1_4_2.yml +178 -0
- data/spec/cassettes/FatZebra_Purchase/_capture/1_5_1.yml +111 -0
- data/spec/cassettes/FatZebra_Purchase/_capture/1_5_2.yml +111 -0
- data/spec/cassettes/FatZebra_Purchase/_capture/1_6_1.yml +111 -0
- data/spec/cassettes/FatZebra_Purchase/_capture/1_6_2.yml +111 -0
- data/spec/cassettes/FatZebra_Purchase/_create/1_1_1.yml +57 -0
- data/spec/cassettes/FatZebra_Purchase/_create/1_1_10.yml +57 -0
- data/spec/cassettes/FatZebra_Purchase/_create/1_1_11.yml +57 -0
- data/spec/cassettes/FatZebra_Purchase/_create/1_1_12.yml +57 -0
- data/spec/cassettes/FatZebra_Purchase/_create/1_1_2.yml +57 -0
- data/spec/cassettes/FatZebra_Purchase/_create/1_1_3.yml +57 -0
- data/spec/cassettes/FatZebra_Purchase/_create/1_1_4.yml +57 -0
- data/spec/cassettes/FatZebra_Purchase/_create/1_1_5.yml +57 -0
- data/spec/cassettes/FatZebra_Purchase/_create/1_1_6.yml +57 -0
- data/spec/cassettes/FatZebra_Purchase/_create/1_1_7.yml +57 -0
- data/spec/cassettes/FatZebra_Purchase/_create/1_1_8.yml +57 -0
- data/spec/cassettes/FatZebra_Purchase/_create/1_1_9.yml +57 -0
- data/spec/cassettes/FatZebra_Purchase/_find/1_2_1.yml +109 -0
- data/spec/cassettes/FatZebra_Purchase/_find/1_2_2.yml +109 -0
- data/spec/cassettes/FatZebra_Purchase/_find/1_2_3.yml +109 -0
- data/spec/cassettes/FatZebra_Purchase/_find/1_4_1.yml +109 -0
- data/spec/cassettes/FatZebra_Purchase/_find/1_4_2.yml +109 -0
- data/spec/cassettes/FatZebra_Purchase/_find/1_4_3.yml +109 -0
- data/spec/cassettes/FatZebra_Purchase/_refund/1_4_1.yml +111 -0
- data/spec/cassettes/FatZebra_Purchase/_refund/1_4_2.yml +111 -0
- data/spec/cassettes/FatZebra_Purchase/_refund/1_5_1.yml +111 -0
- data/spec/cassettes/FatZebra_Purchase/_refund/1_5_2.yml +111 -0
- data/spec/cassettes/FatZebra_Purchase/_search/1_3_1.yml +170 -0
- data/spec/cassettes/FatZebra_Purchase/_search/1_3_2.yml +170 -0
- data/spec/cassettes/FatZebra_Purchase/_search/1_3_3.yml +170 -0
- data/spec/cassettes/FatZebra_Purchase/_search/with_data/1_3_2_1.yml +164 -0
- data/spec/cassettes/FatZebra_Purchase/_search/with_data/1_3_2_2.yml +165 -0
- data/spec/cassettes/FatZebra_Purchase/_search/with_data/1_3_2_3.yml +164 -0
- data/spec/cassettes/FatZebra_Purchase/_search/without_data/1_3_1_1.yml +54 -0
- data/spec/cassettes/FatZebra_Purchase/_search/without_data/1_3_1_2.yml +54 -0
- data/spec/cassettes/FatZebra_Purchase/_search/without_data/1_3_1_3.yml +54 -0
- data/spec/cassettes/FatZebra_Purchase/_settlement/1_8_1.yml +613 -0
- data/spec/cassettes/FatZebra_Purchase/_settlement/1_8_2.yml +615 -0
- data/spec/cassettes/FatZebra_Purchase/_settlement/1_8_3.yml +617 -0
- data/spec/cassettes/FatZebra_Purchase/_void/1_6_1.yml +111 -0
- data/spec/cassettes/FatZebra_Purchase/_void/1_6_2.yml +111 -0
- data/spec/cassettes/FatZebra_Purchase/_void/1_6_3.yml +111 -0
- data/spec/cassettes/FatZebra_Purchase/_void/1_7_1.yml +111 -0
- data/spec/cassettes/FatZebra_Purchase/_void/1_7_2.yml +111 -0
- data/spec/cassettes/FatZebra_Purchase/_void/1_7_3.yml +111 -0
- data/spec/cassettes/FatZebra_Refund/_create/1_1_1.yml +111 -0
- data/spec/cassettes/FatZebra_Refund/_create/1_1_2.yml +111 -0
- data/spec/cassettes/FatZebra_Refund/_create/1_1_3.yml +111 -0
- data/spec/cassettes/FatZebra_Refund/_create/1_1_4.yml +111 -0
- data/spec/cassettes/FatZebra_Refund/_create/1_1_5.yml +111 -0
- data/spec/cassettes/FatZebra_Refund/_create/1_1_6.yml +111 -0
- data/spec/cassettes/FatZebra_Refund/_create/1_1_7.yml +111 -0
- data/spec/cassettes/FatZebra_Refund/_create/1_1_8.yml +111 -0
- data/spec/cassettes/FatZebra_Refund/_create/1_1_9.yml +111 -0
- data/spec/cassettes/FatZebra_Refund/_find/1_2_1.yml +163 -0
- data/spec/cassettes/FatZebra_Refund/_find/1_2_2.yml +163 -0
- data/spec/cassettes/FatZebra_Refund/_search/1_3_1.yml +281 -0
- data/spec/cassettes/FatZebra_Refund/_search/1_3_2.yml +281 -0
- data/spec/cassettes/FatZebra_Refund/_void/1_4_1.yml +165 -0
- data/spec/cassettes/FatZebra_Refund/_void/1_4_2.yml +165 -0
- data/spec/cassettes/FatZebra_Refund/_void/1_4_3.yml +165 -0
- data/spec/cassettes/FatZebra_WebHook/_create/1_1_1.yml +57 -0
- data/spec/cassettes/FatZebra_WebHook/_create/1_1_2.yml +57 -0
- data/spec/cassettes/FatZebra_WebHook/_create/1_1_3.yml +57 -0
- data/spec/cassettes/FatZebra_WebHook/_create/validations/1_1_4_1.yml +56 -0
- data/spec/cassettes/FatZebra_WebHook/_delete/1_4_1.yml +111 -0
- data/spec/cassettes/FatZebra_WebHook/_search/1_2_1.yml +222 -0
- data/spec/cassettes/FatZebra_WebHook/_search/1_2_2.yml +224 -0
- data/spec/cassettes/FatZebra_WebHook/_update/1_3_1.yml +112 -0
- data/spec/cassettes/FatZebra_WebHook/_update/1_3_2.yml +112 -0
- data/spec/fixtures/batch_test.csv +4 -0
- data/spec/lib/fat_zebra/bank_account_spec.rb +34 -0
- data/spec/lib/fat_zebra/batch_spec.rb +59 -0
- data/spec/lib/fat_zebra/card_spec.rb +41 -0
- data/spec/lib/fat_zebra/config_spec.rb +52 -0
- data/spec/lib/fat_zebra/customer_spec.rb +53 -0
- data/spec/lib/fat_zebra/direct_credit_spec.rb +53 -0
- data/spec/lib/fat_zebra/direct_debit_spec.rb +53 -0
- data/spec/lib/fat_zebra/fat_zebra_object_spec.rb +116 -0
- data/spec/lib/fat_zebra/information_spec.rb +13 -0
- data/spec/lib/fat_zebra/payment_plan_spec.rb +94 -0
- data/spec/lib/fat_zebra/purchase_spec.rb +92 -0
- data/spec/lib/fat_zebra/refund_spec.rb +72 -0
- data/spec/lib/fat_zebra/util_spec.rb +24 -0
- data/spec/lib/fat_zebra/validation_spec.rb +22 -0
- data/spec/lib/fat_zebra/web_hook_spec.rb +50 -0
- data/spec/spec_helper.rb +49 -3
- data/spec/support/payloads.rb +43 -0
- metadata +238 -65
- data/FatZebra.gemspec +0 -31
- data/lib/fat_zebra/constants.rb +0 -2
- data/lib/fat_zebra/gateway.rb +0 -292
- data/lib/fat_zebra/models/base.rb +0 -33
- data/lib/fat_zebra/models/card.rb +0 -49
- data/lib/fat_zebra/models/purchase.rb +0 -185
- data/lib/fat_zebra/models/refund.rb +0 -46
- data/lib/fat_zebra/models/response.rb +0 -33
- data/lib/rest-client/request_ext.rb +0 -15
- data/spec/config_spec.rb +0 -37
- data/spec/gateway_spec.rb +0 -120
- data/spec/models/purchase_spec.rb +0 -55
- data/spec/models/refund_spec.rb +0 -9
- data/spec/models/response_spec.rb +0 -25
@@ -0,0 +1,224 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://gateway.sandbox.fatzebra.com.au/v1.0/web_hooks
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"events":"*","mode":"Test","name":"test hook","address":"http://stage.example.com.au/v1/api/hook_listener","test":true}'
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
Content-Length:
|
17
|
+
- '120'
|
18
|
+
User-Agent:
|
19
|
+
- Ruby
|
20
|
+
Authorization:
|
21
|
+
- Basic VEVTVDpURVNU
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Date:
|
28
|
+
- Tue, 27 Jun 2017 06:22:38 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Status:
|
36
|
+
- 200 OK
|
37
|
+
X-Rack-Cache:
|
38
|
+
- invalidate, pass
|
39
|
+
Cache-Control:
|
40
|
+
- no-store
|
41
|
+
X-Request-Version:
|
42
|
+
- 1.19.41
|
43
|
+
X-Runtime:
|
44
|
+
- '0.034285'
|
45
|
+
Pragma:
|
46
|
+
- no-cache
|
47
|
+
X-Request-Id:
|
48
|
+
- 38ff81cd21827cc487b4fcdb7e8fd175
|
49
|
+
X-Backend:
|
50
|
+
- sbox-priv-gateway-a
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
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
|
54
|
+
hook","id":"071-WH-GKC8HMJA"},"errors":[],"test":true}'
|
55
|
+
http_version:
|
56
|
+
recorded_at: Tue, 27 Jun 2017 06:22:38 GMT
|
57
|
+
- request:
|
58
|
+
method: post
|
59
|
+
uri: https://gateway.sandbox.fatzebra.com.au/v1.0/web_hooks
|
60
|
+
body:
|
61
|
+
encoding: UTF-8
|
62
|
+
string: '{"events":"*","mode":"Test","name":"test hook","address":"http://stage.example.com.au/v1/api/hook_listener","test":true}'
|
63
|
+
headers:
|
64
|
+
Accept:
|
65
|
+
- application/json
|
66
|
+
Accept-Encoding:
|
67
|
+
- gzip, deflate
|
68
|
+
Content-Type:
|
69
|
+
- application/json
|
70
|
+
Content-Length:
|
71
|
+
- '120'
|
72
|
+
User-Agent:
|
73
|
+
- Ruby
|
74
|
+
Authorization:
|
75
|
+
- Basic VEVTVDpURVNU
|
76
|
+
response:
|
77
|
+
status:
|
78
|
+
code: 200
|
79
|
+
message: OK
|
80
|
+
headers:
|
81
|
+
Date:
|
82
|
+
- Tue, 27 Jun 2017 06:22:38 GMT
|
83
|
+
Content-Type:
|
84
|
+
- application/json; charset=utf-8
|
85
|
+
Transfer-Encoding:
|
86
|
+
- chunked
|
87
|
+
Connection:
|
88
|
+
- keep-alive
|
89
|
+
Status:
|
90
|
+
- 200 OK
|
91
|
+
Cache-Control:
|
92
|
+
- no-store
|
93
|
+
X-Request-Version:
|
94
|
+
- 1.19.41
|
95
|
+
Pragma:
|
96
|
+
- no-cache
|
97
|
+
X-Request-Id:
|
98
|
+
- c836e5a2e1ad6f848b3932181f46af2a
|
99
|
+
X-Runtime:
|
100
|
+
- '0.031932'
|
101
|
+
X-Rack-Cache:
|
102
|
+
- invalidate, pass
|
103
|
+
X-Backend:
|
104
|
+
- sbox-priv-gateway-a
|
105
|
+
body:
|
106
|
+
encoding: UTF-8
|
107
|
+
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
|
108
|
+
hook","id":"071-WH-Y0S1ZXBK"},"errors":[],"test":true}'
|
109
|
+
http_version:
|
110
|
+
recorded_at: Tue, 27 Jun 2017 06:22:38 GMT
|
111
|
+
- request:
|
112
|
+
method: get
|
113
|
+
uri: https://gateway.sandbox.fatzebra.com.au/v1.0/web_hooks?limit=10&offets=0&test=true
|
114
|
+
body:
|
115
|
+
encoding: US-ASCII
|
116
|
+
string: ''
|
117
|
+
headers:
|
118
|
+
Accept:
|
119
|
+
- application/json
|
120
|
+
Accept-Encoding:
|
121
|
+
- gzip, deflate
|
122
|
+
Content-Type:
|
123
|
+
- application/json
|
124
|
+
User-Agent:
|
125
|
+
- Ruby
|
126
|
+
Authorization:
|
127
|
+
- Basic VEVTVDpURVNU
|
128
|
+
response:
|
129
|
+
status:
|
130
|
+
code: 200
|
131
|
+
message: OK
|
132
|
+
headers:
|
133
|
+
Date:
|
134
|
+
- Tue, 27 Jun 2017 06:22:38 GMT
|
135
|
+
Content-Type:
|
136
|
+
- application/json; charset=utf-8
|
137
|
+
Transfer-Encoding:
|
138
|
+
- chunked
|
139
|
+
Connection:
|
140
|
+
- keep-alive
|
141
|
+
Status:
|
142
|
+
- 200 OK
|
143
|
+
X-Rack-Cache:
|
144
|
+
- miss
|
145
|
+
Cache-Control:
|
146
|
+
- no-store, private
|
147
|
+
X-Request-Version:
|
148
|
+
- 1.19.41
|
149
|
+
X-Runtime:
|
150
|
+
- '0.034821'
|
151
|
+
Pragma:
|
152
|
+
- no-cache
|
153
|
+
X-Request-Id:
|
154
|
+
- 55a9520dd353acb331fcdd1b73019a22
|
155
|
+
X-Backend:
|
156
|
+
- sbox-priv-gateway-a
|
157
|
+
body:
|
158
|
+
encoding: UTF-8
|
159
|
+
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://uat.enoahprojects.com/liresearchdemo/cron/direct-debit-hook-update","events":"*","mode":"Test","authentication_username":"null","authentication_password":"****","is_active":null,"name":"Direct
|
160
|
+
Debit Hook","id":"071-WH-J4G33MYG"},{"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-Y8I1QHVQ"},{"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-BZBI81OH"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
163
|
+
hook","id":"071-WH-BXWU3DBU"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
164
|
+
hook","id":"071-WH-QXLSMD5R"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
165
|
+
hook","id":"071-WH-2SUA282T"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
166
|
+
hook","id":"071-WH-6GQJLONY"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
167
|
+
hook","id":"071-WH-QGEPYZGZ"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
|
168
|
+
Test hook","id":"071-WH-AI1FSKC3"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
|
169
|
+
Test hook","id":"071-WH-Z9NM18Q"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
170
|
+
hook","id":"071-WH-H2MYQ4VD"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
171
|
+
hook","id":"071-WH-MQUPD96G"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
172
|
+
hook","id":"071-WH-AWEOFCEM"},{"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-UE6K5NIV"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
174
|
+
hook","id":"071-WH-K0CD9DRD"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
175
|
+
hook","id":"071-WH-IPG4JZXV"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
176
|
+
hook","id":"071-WH-6K30PDYN"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
|
177
|
+
Test hook","id":"071-WH-ATXL7633"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
|
178
|
+
Test hook","id":"071-WH-I4E0UFFG"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
179
|
+
hook","id":"071-WH-XHHFRVKZ"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
180
|
+
hook","id":"071-WH-XCXIWWKO"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
181
|
+
hook","id":"071-WH-24BZWC87"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
182
|
+
hook","id":"071-WH-B124NSTI"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
183
|
+
hook","id":"071-WH-ZQXX1VXV"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
184
|
+
hook","id":"071-WH-KCZB1293"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
185
|
+
hook","id":"071-WH-RXALO1VA"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
|
186
|
+
Test hook","id":"071-WH-ZI7W4X9B"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
|
187
|
+
Test hook","id":"071-WH-ND86EP93"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
188
|
+
hook","id":"071-WH-7PUI7P3R"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
189
|
+
hook","id":"071-WH-GTM8HXKX"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
190
|
+
hook","id":"071-WH-G25VW8TJ"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
191
|
+
hook","id":"071-WH-IOL97DYK"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
192
|
+
hook","id":"071-WH-LIRP3625"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
193
|
+
hook","id":"071-WH-USE4X72S"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
194
|
+
hook","id":"071-WH-3CKJ8ZMF"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
|
195
|
+
Test hook","id":"071-WH-HP2Q8T0"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
|
196
|
+
Test hook","id":"071-WH-C89JEPMN"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
197
|
+
hook","id":"071-WH-99TVKK0M"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
198
|
+
hook","id":"071-WH-CZ6GOJB7"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
199
|
+
hook","id":"071-WH-ETR36VQG"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
200
|
+
hook","id":"071-WH-2W9J7530"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
201
|
+
hook","id":"071-WH-ESAWUVEE"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
202
|
+
hook","id":"071-WH-RQBOY87X"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
203
|
+
hook","id":"071-WH-584PDXG8"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
|
204
|
+
Test hook","id":"071-WH-RHW3J2VE"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
|
205
|
+
Test hook","id":"071-WH-FFS11K56"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
206
|
+
hook","id":"071-WH-J4GNXACW"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
207
|
+
hook","id":"071-WH-WEUKU525"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
208
|
+
hook","id":"071-WH-N47D3H56"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
209
|
+
hook","id":"071-WH-SJ33SKWN"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
210
|
+
hook","id":"071-WH-3PN0HRZN"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
211
|
+
hook","id":"071-WH-1L7KCIGX"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
212
|
+
hook","id":"071-WH-L3OQ2T4Z"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
|
213
|
+
Test hook","id":"071-WH-5MNPSQMN"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"New
|
214
|
+
Test hook","id":"071-WH-A53E6QPY"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
215
|
+
hook","id":"071-WH-CF230O8U"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
216
|
+
hook","id":"071-WH-C9E7VID0"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
217
|
+
hook","id":"071-WH-GB6XTWXV"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
218
|
+
hook","id":"071-WH-SCGDLAI6"},{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
219
|
+
hook","id":"071-WH-8PHUB38P"},{"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-GKC8HMJA"},{"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-Y0S1ZXBK"}],"errors":[],"test":true,"records":63,"total_records":63,"page":1,"total_pages":1}'
|
222
|
+
http_version:
|
223
|
+
recorded_at: Tue, 27 Jun 2017 06:22:38 GMT
|
224
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,112 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://gateway.sandbox.fatzebra.com.au/v1.0/web_hooks
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"events":"*","mode":"Test","name":"test hook","address":"http://stage.example.com.au/v1/api/hook_listener","test":true}'
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
Content-Length:
|
17
|
+
- '120'
|
18
|
+
User-Agent:
|
19
|
+
- Ruby
|
20
|
+
Authorization:
|
21
|
+
- Basic VEVTVDpURVNU
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Date:
|
28
|
+
- Tue, 27 Jun 2017 06:22:38 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Status:
|
36
|
+
- 200 OK
|
37
|
+
X-Rack-Cache:
|
38
|
+
- invalidate, pass
|
39
|
+
Cache-Control:
|
40
|
+
- no-store
|
41
|
+
X-Request-Version:
|
42
|
+
- 1.19.41
|
43
|
+
X-Runtime:
|
44
|
+
- '0.032663'
|
45
|
+
Pragma:
|
46
|
+
- no-cache
|
47
|
+
X-Request-Id:
|
48
|
+
- 71ef8fd1ad9f753536df7fd9e7840858
|
49
|
+
X-Backend:
|
50
|
+
- sbox-priv-gateway-a
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
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
|
54
|
+
hook","id":"071-WH-JLZBTF1H"},"errors":[],"test":true}'
|
55
|
+
http_version:
|
56
|
+
recorded_at: Tue, 27 Jun 2017 06:22:38 GMT
|
57
|
+
- request:
|
58
|
+
method: put
|
59
|
+
uri: https://gateway.sandbox.fatzebra.com.au/v1.0/web_hooks/071-WH-JLZBTF1H
|
60
|
+
body:
|
61
|
+
encoding: UTF-8
|
62
|
+
string: '{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
63
|
+
hook","id":"071-WH-JLZBTF1H","name":"New Test hook","test":true}'
|
64
|
+
headers:
|
65
|
+
Accept:
|
66
|
+
- application/json
|
67
|
+
Accept-Encoding:
|
68
|
+
- gzip, deflate
|
69
|
+
Content-Type:
|
70
|
+
- application/json
|
71
|
+
Content-Length:
|
72
|
+
- '243'
|
73
|
+
User-Agent:
|
74
|
+
- Ruby
|
75
|
+
Authorization:
|
76
|
+
- Basic VEVTVDpURVNU
|
77
|
+
response:
|
78
|
+
status:
|
79
|
+
code: 200
|
80
|
+
message: OK
|
81
|
+
headers:
|
82
|
+
Date:
|
83
|
+
- Tue, 27 Jun 2017 06:22:38 GMT
|
84
|
+
Content-Type:
|
85
|
+
- application/json; charset=utf-8
|
86
|
+
Transfer-Encoding:
|
87
|
+
- chunked
|
88
|
+
Connection:
|
89
|
+
- keep-alive
|
90
|
+
Status:
|
91
|
+
- 200 OK
|
92
|
+
Cache-Control:
|
93
|
+
- no-store
|
94
|
+
X-Request-Version:
|
95
|
+
- 1.19.41
|
96
|
+
Pragma:
|
97
|
+
- no-cache
|
98
|
+
X-Request-Id:
|
99
|
+
- 8878471ad8b314722306f9e24f39b33a
|
100
|
+
X-Runtime:
|
101
|
+
- '0.032630'
|
102
|
+
X-Rack-Cache:
|
103
|
+
- invalidate, pass
|
104
|
+
X-Backend:
|
105
|
+
- sbox-priv-gateway-a
|
106
|
+
body:
|
107
|
+
encoding: UTF-8
|
108
|
+
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
|
109
|
+
Test hook","id":"071-WH-JLZBTF1H"},"errors":[],"test":true}'
|
110
|
+
http_version:
|
111
|
+
recorded_at: Tue, 27 Jun 2017 06:22:38 GMT
|
112
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,112 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://gateway.sandbox.fatzebra.com.au/v1.0/web_hooks
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"events":"*","mode":"Test","name":"test hook","address":"http://stage.example.com.au/v1/api/hook_listener","test":true}'
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
Content-Length:
|
17
|
+
- '120'
|
18
|
+
User-Agent:
|
19
|
+
- Ruby
|
20
|
+
Authorization:
|
21
|
+
- Basic VEVTVDpURVNU
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Date:
|
28
|
+
- Tue, 27 Jun 2017 06:22:39 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Status:
|
36
|
+
- 200 OK
|
37
|
+
X-Rack-Cache:
|
38
|
+
- invalidate, pass
|
39
|
+
Cache-Control:
|
40
|
+
- no-store
|
41
|
+
X-Request-Version:
|
42
|
+
- 1.19.41
|
43
|
+
X-Runtime:
|
44
|
+
- '0.030733'
|
45
|
+
Pragma:
|
46
|
+
- no-cache
|
47
|
+
X-Request-Id:
|
48
|
+
- c4e47caa1978c88ff19e4b80dfb4b264
|
49
|
+
X-Backend:
|
50
|
+
- sbox-priv-gateway-a
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
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
|
54
|
+
hook","id":"071-WH-1KC8EX00"},"errors":[],"test":true}'
|
55
|
+
http_version:
|
56
|
+
recorded_at: Tue, 27 Jun 2017 06:22:39 GMT
|
57
|
+
- request:
|
58
|
+
method: put
|
59
|
+
uri: https://gateway.sandbox.fatzebra.com.au/v1.0/web_hooks/071-WH-1KC8EX00
|
60
|
+
body:
|
61
|
+
encoding: UTF-8
|
62
|
+
string: '{"address":"http://stage.example.com.au/v1/api/hook_listener","events":"*","mode":"Test","authentication_username":null,"authentication_password":"","is_active":null,"name":"test
|
63
|
+
hook","id":"071-WH-1KC8EX00","name":"New Test hook","test":true}'
|
64
|
+
headers:
|
65
|
+
Accept:
|
66
|
+
- application/json
|
67
|
+
Accept-Encoding:
|
68
|
+
- gzip, deflate
|
69
|
+
Content-Type:
|
70
|
+
- application/json
|
71
|
+
Content-Length:
|
72
|
+
- '243'
|
73
|
+
User-Agent:
|
74
|
+
- Ruby
|
75
|
+
Authorization:
|
76
|
+
- Basic VEVTVDpURVNU
|
77
|
+
response:
|
78
|
+
status:
|
79
|
+
code: 200
|
80
|
+
message: OK
|
81
|
+
headers:
|
82
|
+
Date:
|
83
|
+
- Tue, 27 Jun 2017 06:22:39 GMT
|
84
|
+
Content-Type:
|
85
|
+
- application/json; charset=utf-8
|
86
|
+
Transfer-Encoding:
|
87
|
+
- chunked
|
88
|
+
Connection:
|
89
|
+
- keep-alive
|
90
|
+
Status:
|
91
|
+
- 200 OK
|
92
|
+
Cache-Control:
|
93
|
+
- no-store
|
94
|
+
X-Request-Version:
|
95
|
+
- 1.19.41
|
96
|
+
Pragma:
|
97
|
+
- no-cache
|
98
|
+
X-Request-Id:
|
99
|
+
- 48851615762711161eed5540214c5ec4
|
100
|
+
X-Runtime:
|
101
|
+
- '0.037188'
|
102
|
+
X-Rack-Cache:
|
103
|
+
- invalidate, pass
|
104
|
+
X-Backend:
|
105
|
+
- sbox-priv-gateway-a
|
106
|
+
body:
|
107
|
+
encoding: UTF-8
|
108
|
+
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
|
109
|
+
Test hook","id":"071-WH-1KC8EX00"},"errors":[],"test":true}'
|
110
|
+
http_version:
|
111
|
+
recorded_at: Tue, 27 Jun 2017 06:22:39 GMT
|
112
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,4 @@
|
|
1
|
+
1000,AUD,Order12345,John Doe 1,4444333322221111,12/2020,,Gizmo ABC 1
|
2
|
+
2051,AUD,Order22345,John Doe 2,4444333322221111,12/2020,,Gizmo ABC 2
|
3
|
+
3000,AUD,Order32345,John Doe 3,4444333322221111,12/2020,,Gizmo ABC 3
|
4
|
+
4000,AUD,Order42345,John Doe 4,4444333322221111,12/2020,,Gizmo ABC 4
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe FatZebra::BankAccount do
|
4
|
+
|
5
|
+
let(:valid_bank_account_payload) {{
|
6
|
+
bsb: '123-123',
|
7
|
+
account_name: 'Test name',
|
8
|
+
account_number: '012345678'
|
9
|
+
}}
|
10
|
+
|
11
|
+
describe '.create', :vcr do
|
12
|
+
subject(:bank_account) { FatZebra::BankAccount.create(valid_bank_account_payload) }
|
13
|
+
|
14
|
+
it { is_expected.to be_successful }
|
15
|
+
it { expect(bank_account.id).to_not be_empty }
|
16
|
+
|
17
|
+
context 'validations' do
|
18
|
+
let(:valid_bank_account_payload) {{}}
|
19
|
+
|
20
|
+
it { expect{ bank_account }.to raise_error(FatZebra::RequestValidationError) }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '.search', :vcr do
|
25
|
+
subject(:bank_accounts) { FatZebra::BankAccount.search }
|
26
|
+
|
27
|
+
before { 2.times { |i| FatZebra::BankAccount.create(valid_bank_account_payload) } }
|
28
|
+
|
29
|
+
it { is_expected.to be_successful }
|
30
|
+
it { expect(bank_accounts.data.count).to be >= 2 }
|
31
|
+
it { expect(bank_accounts.data.first).to be_a(FatZebra::BankAccount) }
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe FatZebra::Batch do
|
4
|
+
let(:batch_path) { "#{File.dirname(__FILE__)}/../../fixtures/batch_test.csv" }
|
5
|
+
|
6
|
+
let(:valid_batch_payload) {{
|
7
|
+
file: File.new(batch_path),
|
8
|
+
filename: "BATCH-v1-PURCHASE-TEST-#{Time.now.strftime('%Y%m%d')}-#{SecureRandom.hex}.csv"
|
9
|
+
}}
|
10
|
+
|
11
|
+
describe '.create', :vcr do
|
12
|
+
subject(:batch) { FatZebra::Batch.create(valid_batch_payload) }
|
13
|
+
|
14
|
+
context 'with file' do
|
15
|
+
it { is_expected.to be_successful }
|
16
|
+
it { expect(batch.reference).to_not be_empty }
|
17
|
+
end
|
18
|
+
|
19
|
+
context 'with path' do
|
20
|
+
let(:valid_batch_payload) {{
|
21
|
+
path: batch_path,
|
22
|
+
filename: "BATCH-v1-PURCHASE-TEST-#{Time.now.strftime('%Y%m%d')}-#{SecureRandom.hex}.csv"
|
23
|
+
}}
|
24
|
+
|
25
|
+
it { is_expected.to be_successful }
|
26
|
+
it { expect(batch.reference).to_not be_empty }
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'validations' do
|
30
|
+
let(:valid_batch_payload) {{}}
|
31
|
+
|
32
|
+
it { expect{ batch }.to raise_error(FatZebra::RequestValidationError) }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe '.find', :vcr do
|
37
|
+
let(:create) { FatZebra::Batch.create(valid_batch_payload) }
|
38
|
+
subject(:batch) { FatZebra::Batch.find(create.reference) }
|
39
|
+
|
40
|
+
it { is_expected.to be_successful }
|
41
|
+
it { expect(batch.reference).to eq(create.reference) }
|
42
|
+
end
|
43
|
+
|
44
|
+
describe '.search', :vcr do
|
45
|
+
subject(:batches) { FatZebra::Batch.search }
|
46
|
+
|
47
|
+
it { is_expected.to be_successful }
|
48
|
+
it { expect(batches.data.count).to be >= 2 }
|
49
|
+
it { expect(batches.data.first).to be_a(FatZebra::Batch) }
|
50
|
+
end
|
51
|
+
|
52
|
+
describe '#result', :vcr do
|
53
|
+
let(:create) { FatZebra::Batch.create(valid_batch_payload) }
|
54
|
+
let(:batch) { FatZebra::Batch.find(create.reference) }
|
55
|
+
|
56
|
+
it { expect(batch.result).to eq("Batch is not yet completed") }
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe FatZebra::Card do
|
4
|
+
|
5
|
+
describe '.create', :vcr do
|
6
|
+
subject(:credit_card) { FatZebra::Card.create(valid_credit_card_payload) }
|
7
|
+
|
8
|
+
it { is_expected.to be_successful }
|
9
|
+
it { expect(credit_card.token).to_not be_empty }
|
10
|
+
it { expect(credit_card.card_holder).to eq('Matthew Savage') }
|
11
|
+
it { expect(credit_card.card_number).to_not be_empty }
|
12
|
+
it { expect(credit_card.card_type).to eq('MasterCard') }
|
13
|
+
it { expect(credit_card.authorized?).to be_truthy }
|
14
|
+
|
15
|
+
context 'validations' do
|
16
|
+
let(:valid_credit_card_payload) {{}}
|
17
|
+
|
18
|
+
it { expect{ credit_card }.to raise_error(FatZebra::RequestValidationError) }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe '.update', :vcr do
|
23
|
+
let(:valid_credit_card_update_payload) {{
|
24
|
+
card_expiry: DateTime.new(2050, 2, 3).strftime('%m/%Y'),
|
25
|
+
}}
|
26
|
+
|
27
|
+
let(:create) { FatZebra::Card.create(valid_credit_card_payload) }
|
28
|
+
subject(:credit_card) { FatZebra::Card.update(create.token, valid_credit_card_update_payload) }
|
29
|
+
|
30
|
+
it { is_expected.to be_successful }
|
31
|
+
it { expect(credit_card.token).to eq(create.token) }
|
32
|
+
it { expect(credit_card.card_expiry).to_not eq(create.card_expiry) }
|
33
|
+
|
34
|
+
context 'validations' do
|
35
|
+
let(:valid_credit_card_update_payload) {{}}
|
36
|
+
|
37
|
+
it { expect{ credit_card }.to raise_error(FatZebra::RequestValidationError) }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe FatZebra::Config do
|
4
|
+
let(:params) {{
|
5
|
+
token: 'my-token',
|
6
|
+
username: 'my-username'
|
7
|
+
}}
|
8
|
+
|
9
|
+
subject(:config) { FatZebra::Config.new(params) }
|
10
|
+
|
11
|
+
describe '#initialize' do
|
12
|
+
it { expect(config.valid!).to be_truthy }
|
13
|
+
it { expect(config.token).to eq(params[:token]) }
|
14
|
+
it { expect(config.username).to eq(params[:username]) }
|
15
|
+
it { expect(config.gateway).to eq('gateway.fatzebra.com.au') }
|
16
|
+
it { expect(config.test_mode).to be_falsey }
|
17
|
+
it { expect(config.http_secure).to be_truthy }
|
18
|
+
it { expect(config.api_version).to eq('v1.0') }
|
19
|
+
|
20
|
+
context 'with all params' do
|
21
|
+
let(:params) {{
|
22
|
+
token: 'my-token',
|
23
|
+
username: 'my-username',
|
24
|
+
gateway: 'my-gateway',
|
25
|
+
test_mode: 'my-test_mode',
|
26
|
+
http_secure: 'my-http_secure',
|
27
|
+
api_version: 'my-api_version',
|
28
|
+
sandbox: 'my-sandbox',
|
29
|
+
options: 'my-options',
|
30
|
+
proxy: 'my-proxy'
|
31
|
+
}}
|
32
|
+
|
33
|
+
it { expect(config.valid!).to be_truthy }
|
34
|
+
it { expect(config.gateway).to eq(params[:gateway]) }
|
35
|
+
it { expect(config.test_mode).to eq(params[:test_mode]) }
|
36
|
+
it { expect(config.http_secure).to eq(params[:http_secure]) }
|
37
|
+
it { expect(config.api_version).to eq(params[:api_version]) }
|
38
|
+
it { expect(config.sandbox).to eq(params[:sandbox]) }
|
39
|
+
it { expect(config.options).to eq(params[:options]) }
|
40
|
+
it { expect(config.proxy).to eq(params[:proxy]) }
|
41
|
+
end
|
42
|
+
|
43
|
+
%i[username token].each do |field|
|
44
|
+
context "validate #{field}" do
|
45
|
+
let(:params) {{ token: 'my-token', username: 'my-username' }.merge(field => '')}
|
46
|
+
|
47
|
+
it { expect { config.valid! }.to raise_error(FatZebra::ConfigurationError, "#{field} can't be blank") }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|