balanced-ach 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. data/.idea/.name +1 -0
  2. data/.idea/.rakeTasks +7 -0
  3. data/.idea/balanced-ach.iml +9 -0
  4. data/.idea/encodings.xml +5 -0
  5. data/.idea/misc.xml +5 -0
  6. data/.idea/modules.xml +9 -0
  7. data/.idea/scopes/scope_settings.xml +5 -0
  8. data/.idea/vcs.xml +7 -0
  9. data/.idea/workspace.xml +561 -0
  10. data/CONTRIBUTORS +1 -0
  11. data/Gemfile +19 -0
  12. data/Gemfile.lock +64 -0
  13. data/Guardfile +7 -0
  14. data/LICENSE +22 -0
  15. data/README.md +64 -0
  16. data/Rakefile +12 -0
  17. data/balanced.gemspec +22 -0
  18. data/lib/balanced.rb +84 -0
  19. data/lib/balanced/client.rb +82 -0
  20. data/lib/balanced/error.rb +85 -0
  21. data/lib/balanced/pager.rb +201 -0
  22. data/lib/balanced/resources.rb +5 -0
  23. data/lib/balanced/resources/bank_account.rb +36 -0
  24. data/lib/balanced/resources/credit.rb +20 -0
  25. data/lib/balanced/resources/debit.rb +27 -0
  26. data/lib/balanced/resources/resource.rb +158 -0
  27. data/lib/balanced/response/balanced_exception_middleware.rb +33 -0
  28. data/lib/balanced/utils.rb +62 -0
  29. data/lib/balanced/version.rb +3 -0
  30. data/spec/balanced/pager_spec.rb +42 -0
  31. data/spec/balanced/resources/account_spec.rb +571 -0
  32. data/spec/balanced/resources/api_key_spec.rb +55 -0
  33. data/spec/balanced/resources/hold_spec.rb +55 -0
  34. data/spec/balanced/resources/marketplace_spec.rb +97 -0
  35. data/spec/balanced/resources/transactions_spec.rb +72 -0
  36. data/spec/balanced/response/balanced_exception_middleware_spec.rb +47 -0
  37. data/spec/balanced_spec.rb +77 -0
  38. data/spec/cassettes/Balanced/configure.yml +48 -0
  39. data/spec/cassettes/Balanced/configure/reconfigure_with_new_api_key.yml +48 -0
  40. data/spec/cassettes/Balanced_Account.yml +110 -0
  41. data/spec/cassettes/Balanced_Account/Account_uri/when_ApiKey_is_configured.yml +240 -0
  42. data/spec/cassettes/Balanced_Account/Account_uri/when_ApiKey_is_not_configured.yml +44 -0
  43. data/spec/cassettes/Balanced_Account/_find.yml +400 -0
  44. data/spec/cassettes/Balanced_Account/_find/_all_some_field_op_.yml +186 -0
  45. data/spec/cassettes/Balanced_Account/_find/_first_some_field_op_.yml +186 -0
  46. data/spec/cassettes/Balanced_Account/_find_by_email.yml +400 -0
  47. data/spec/cassettes/Balanced_Account/_find_by_email/email_address_does_not_exist.yml +175 -0
  48. data/spec/cassettes/Balanced_Account/_find_by_email/email_address_is_in_system.yml +186 -0
  49. data/spec/cassettes/Balanced_Account/buyer/_add_card/after_executing.yml +530 -0
  50. data/spec/cassettes/Balanced_Account/buyer/_add_card/when_executing.yml +455 -0
  51. data/spec/cassettes/Balanced_Account/buyer/_debit.yml +363 -0
  52. data/spec/cassettes/Balanced_Account/buyer/_promote_to_merchant/after_executing.yml +281 -0
  53. data/spec/cassettes/Balanced_Account/buyer/_promote_to_merchant/when_executing.yml +281 -0
  54. data/spec/cassettes/Balanced_Account/buyer/_save/after_save/attributes.yml +1013 -0
  55. data/spec/cassettes/Balanced_Account/buyer/_save/when_creating.yml +229 -0
  56. data/spec/cassettes/Balanced_Account/merchant/_add_bank_account/after_executing.yml +536 -0
  57. data/spec/cassettes/Balanced_Account/merchant/_add_bank_account/when_executing.yml +460 -0
  58. data/spec/cassettes/Balanced_Account/merchant/_save/after_save/attributes.yml +232 -0
  59. data/spec/cassettes/Balanced_Account/merchant/_save/when_creating.yml +232 -0
  60. data/spec/cassettes/Balanced_Account/merchant/new.yml +179 -0
  61. data/spec/cassettes/Balanced_ApiKey/attributes.yml +48 -0
  62. data/spec/cassettes/Balanced_ApiKey/new_key/after_configure.yml +93 -0
  63. data/spec/cassettes/Balanced_ApiKey/new_key/before_configure.yml +48 -0
  64. data/spec/cassettes/Balanced_Hold.yml +335 -0
  65. data/spec/cassettes/Balanced_Hold/_void.yml +62 -0
  66. data/spec/cassettes/Balanced_Hold/_void/after.yml +62 -0
  67. data/spec/cassettes/Balanced_Hold/_void/when_exception_is_thrown.yml +306 -0
  68. data/spec/cassettes/Balanced_Marketplace.yml +339 -0
  69. data/spec/cassettes/Balanced_Transaction.yml +1261 -0
  70. data/spec/cassettes/Balanced_Transaction/Transaction.yml +634 -0
  71. data/spec/cassettes/Balanced_Transaction/Transaction_paginate.yml +634 -0
  72. data/spec/client_spec.rb +12 -0
  73. data/spec/spec_helper.rb +31 -0
  74. data/spec/utils_spec.rb +8 -0
  75. data/upload_docs.rb +39 -0
  76. data/x.rb +22 -0
  77. metadata +199 -0
@@ -0,0 +1,232 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.balancedpayments.com/v1/merchants
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - balanced-ruby/0.3.5
12
+ Authorization:
13
+ - Basic M2RkZGE5MDBjNzIyMTFlMWEyOWMwMjZiYTdlNWU3MmU6
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: !!null
18
+ headers:
19
+ content-type:
20
+ - application/json
21
+ date:
22
+ - Fri, 06 Jul 2012 04:22:58 GMT
23
+ server:
24
+ - nginx/1.0.14
25
+ x-balanced-guru:
26
+ - OHM4438d8b0c72211e1a29c026ba7e5e72e
27
+ x-balanced-marketplace:
28
+ - TEST-MP1TeztGGOGLPPCo2cLKo6SZ
29
+ x-balanced-merchant:
30
+ - TEST-MR1StaiKg1wIPZi4BqZBFKgK
31
+ x-balanced-version:
32
+ - ''
33
+ content-length:
34
+ - '2062'
35
+ connection:
36
+ - Close
37
+ body:
38
+ encoding: US-ASCII
39
+ string: ! "{\n \"first_uri\": \"/v1/merchants?limit=10&offset=0\", \n \"items\":
40
+ [\n {\n \"phone_number\": \"+16505551212\", \n \"city\": \"Nowhere\",
41
+ \n \"marketplace\": {\n \"in_escrow\": 0, \n \"domain_url\":
42
+ \"example.com\", \n \"name\": \"Test Marketplace\", \n \"owner_account_uri\":
43
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC1TCUdnBEr1KwYUyKqb91wZ\",
44
+ \n \"support_email_address\": \"support@example.com\", \n \"uri\":
45
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ\", \n \"bank_accounts_uri\":
46
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/bank_accounts\", \n \"support_phone_number\":
47
+ \"+16505551234\", \n \"refunds_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/refunds\",
48
+ \n \"meta\": {}, \n \"debits_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/debits\",
49
+ \n \"holds_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/holds\",
50
+ \n \"transactions_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/transactions\",
51
+ \n \"accounts_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts\",
52
+ \n \"id\": \"TEST-MP1TeztGGOGLPPCo2cLKo6SZ\", \n \"credits_uri\":
53
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/credits\", \n \"cards_uri\":
54
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/cards\"\n }, \n \"name\":
55
+ \"William Henry Cavendish III\", \n \"email_address\": \"whc@example.org\",
56
+ \n \"created_at\": \"2012-07-06T04:22:47.628360Z\", \n \"uri\":
57
+ \"/v1/merchants/TEST-MR1StaiKg1wIPZi4BqZBFKgK\", \n \"accounts_uri\":
58
+ \"/v1/merchants/TEST-MR1StaiKg1wIPZi4BqZBFKgK/accounts\", \n \"meta\":
59
+ {}, \n \"postal_code\": \"90210\", \n \"country_code\": \"USA\",
60
+ \n \"type\": \"person\", \n \"balance\": 0, \n \"api_keys_uri\":
61
+ \"/v1/merchants/TEST-MR1StaiKg1wIPZi4BqZBFKgK/api_keys\", \n \"id\":
62
+ \"TEST-MR1StaiKg1wIPZi4BqZBFKgK\", \n \"street_address\": \"123 Fake
63
+ St\"\n }\n ], \n \"previous_uri\": null, \n \"uri\": \"/v1/merchants?limit=10&offset=0\",
64
+ \n \"limit\": 10, \n \"offset\": 0, \n \"total\": 1, \n \"next_uri\":
65
+ null, \n \"last_uri\": \"/v1/merchants?limit=10&offset=0\"\n}"
66
+ http_version: !!null
67
+ recorded_at: Fri, 06 Jul 2012 04:22:58 GMT
68
+ - request:
69
+ method: get
70
+ uri: https://api.balancedpayments.com/v1/merchants
71
+ body:
72
+ encoding: US-ASCII
73
+ string: ''
74
+ headers:
75
+ User-Agent:
76
+ - balanced-ruby/0.3.5
77
+ Authorization:
78
+ - Basic M2RkZGE5MDBjNzIyMTFlMWEyOWMwMjZiYTdlNWU3MmU6
79
+ response:
80
+ status:
81
+ code: 200
82
+ message: !!null
83
+ headers:
84
+ content-type:
85
+ - application/json
86
+ date:
87
+ - Fri, 06 Jul 2012 04:22:58 GMT
88
+ server:
89
+ - nginx/1.0.14
90
+ x-balanced-guru:
91
+ - OHM44801ebec72211e1a977026ba7e239a9
92
+ x-balanced-marketplace:
93
+ - TEST-MP1TeztGGOGLPPCo2cLKo6SZ
94
+ x-balanced-merchant:
95
+ - TEST-MR1StaiKg1wIPZi4BqZBFKgK
96
+ x-balanced-version:
97
+ - ''
98
+ content-length:
99
+ - '2062'
100
+ connection:
101
+ - Close
102
+ body:
103
+ encoding: US-ASCII
104
+ string: ! "{\n \"first_uri\": \"/v1/merchants?limit=10&offset=0\", \n \"items\":
105
+ [\n {\n \"phone_number\": \"+16505551212\", \n \"city\": \"Nowhere\",
106
+ \n \"marketplace\": {\n \"in_escrow\": 0, \n \"domain_url\":
107
+ \"example.com\", \n \"name\": \"Test Marketplace\", \n \"owner_account_uri\":
108
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC1TCUdnBEr1KwYUyKqb91wZ\",
109
+ \n \"support_email_address\": \"support@example.com\", \n \"uri\":
110
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ\", \n \"bank_accounts_uri\":
111
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/bank_accounts\", \n \"support_phone_number\":
112
+ \"+16505551234\", \n \"refunds_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/refunds\",
113
+ \n \"meta\": {}, \n \"debits_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/debits\",
114
+ \n \"holds_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/holds\",
115
+ \n \"transactions_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/transactions\",
116
+ \n \"accounts_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts\",
117
+ \n \"id\": \"TEST-MP1TeztGGOGLPPCo2cLKo6SZ\", \n \"credits_uri\":
118
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/credits\", \n \"cards_uri\":
119
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/cards\"\n }, \n \"name\":
120
+ \"William Henry Cavendish III\", \n \"email_address\": \"whc@example.org\",
121
+ \n \"created_at\": \"2012-07-06T04:22:47.628360Z\", \n \"uri\":
122
+ \"/v1/merchants/TEST-MR1StaiKg1wIPZi4BqZBFKgK\", \n \"accounts_uri\":
123
+ \"/v1/merchants/TEST-MR1StaiKg1wIPZi4BqZBFKgK/accounts\", \n \"meta\":
124
+ {}, \n \"postal_code\": \"90210\", \n \"country_code\": \"USA\",
125
+ \n \"type\": \"person\", \n \"balance\": 0, \n \"api_keys_uri\":
126
+ \"/v1/merchants/TEST-MR1StaiKg1wIPZi4BqZBFKgK/api_keys\", \n \"id\":
127
+ \"TEST-MR1StaiKg1wIPZi4BqZBFKgK\", \n \"street_address\": \"123 Fake
128
+ St\"\n }\n ], \n \"previous_uri\": null, \n \"uri\": \"/v1/merchants?limit=10&offset=0\",
129
+ \n \"limit\": 10, \n \"offset\": 0, \n \"total\": 1, \n \"next_uri\":
130
+ null, \n \"last_uri\": \"/v1/merchants?limit=10&offset=0\"\n}"
131
+ http_version: !!null
132
+ recorded_at: Fri, 06 Jul 2012 04:22:59 GMT
133
+ - request:
134
+ method: post
135
+ uri: https://api.balancedpayments.com/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/bank_accounts
136
+ body:
137
+ encoding: UTF-8
138
+ string: ! '{"account_number":"1234567890","bank_code":"321174851","name":"Jack
139
+ Q Merchant"}'
140
+ headers:
141
+ User-Agent:
142
+ - balanced-ruby/0.3.5
143
+ Authorization:
144
+ - Basic M2RkZGE5MDBjNzIyMTFlMWEyOWMwMjZiYTdlNWU3MmU6
145
+ Content-Type:
146
+ - application/json
147
+ response:
148
+ status:
149
+ code: 201
150
+ message: !!null
151
+ headers:
152
+ content-type:
153
+ - application/json
154
+ date:
155
+ - Fri, 06 Jul 2012 04:22:59 GMT
156
+ server:
157
+ - nginx/1.0.14
158
+ x-balanced-guru:
159
+ - OHM44c18192c72211e19eae026ba7e5e72e
160
+ x-balanced-marketplace:
161
+ - TEST-MP1TeztGGOGLPPCo2cLKo6SZ
162
+ x-balanced-merchant:
163
+ - TEST-MR1StaiKg1wIPZi4BqZBFKgK
164
+ x-balanced-version:
165
+ - ''
166
+ content-length:
167
+ - '366'
168
+ connection:
169
+ - Close
170
+ body:
171
+ encoding: US-ASCII
172
+ string: ! "{\n \"bank_name\": \"SAN MATEO CREDIT UNION\", \n \"account\":
173
+ null, \n \"name\": \"Jack Q Merchant\", \n \"bank_code\": \"321174851\",
174
+ \n \"created_at\": \"2012-07-06T04:22:59.502677Z\", \n \"uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/bank_accounts/BA25PdUZKqxNT8Dq4AITkqiq\",
175
+ \n \"is_valid\": true, \n \"meta\": {}, \n \"last_four\": \"7890\", \n
176
+ \ \"id\": \"BA25PdUZKqxNT8Dq4AITkqiq\"\n}"
177
+ http_version: !!null
178
+ recorded_at: Fri, 06 Jul 2012 04:22:59 GMT
179
+ - request:
180
+ method: post
181
+ uri: https://api.balancedpayments.com/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts
182
+ body:
183
+ encoding: UTF-8
184
+ string: ! '{"email_address":"merchant2@example.org","merchant":{"type":"person","name":"Billy
185
+ Jones","street_address":"801 High St.","postal_code":"94301","country":"USA","dob":"1842-01","phone_number":"+16505551234"},"bank_account_uri":"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/bank_accounts/BA25PdUZKqxNT8Dq4AITkqiq","name":"Jack
186
+ Q Merchant"}'
187
+ headers:
188
+ User-Agent:
189
+ - balanced-ruby/0.3.5
190
+ Authorization:
191
+ - Basic M2RkZGE5MDBjNzIyMTFlMWEyOWMwMjZiYTdlNWU3MmU6
192
+ Content-Type:
193
+ - application/json
194
+ response:
195
+ status:
196
+ code: 201
197
+ message: !!null
198
+ headers:
199
+ content-type:
200
+ - application/json
201
+ date:
202
+ - Fri, 06 Jul 2012 04:23:00 GMT
203
+ server:
204
+ - nginx/1.0.14
205
+ x-balanced-guru:
206
+ - OHM451030a8c72211e1a977026ba7e239a9
207
+ x-balanced-marketplace:
208
+ - TEST-MP1TeztGGOGLPPCo2cLKo6SZ
209
+ x-balanced-merchant:
210
+ - TEST-MR1StaiKg1wIPZi4BqZBFKgK
211
+ x-balanced-version:
212
+ - ''
213
+ content-length:
214
+ - '1100'
215
+ connection:
216
+ - Close
217
+ body:
218
+ encoding: US-ASCII
219
+ string: ! "{\n \"holds_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC26udPlb8QUuciIxpfH8LUd/holds\",
220
+ \n \"name\": \"Jack Q Merchant\", \n \"roles\": [\n \"merchant\", \n
221
+ \ \"buyer\"\n ], \n \"created_at\": \"2012-07-06T04:23:00.084903Z\", \n
222
+ \ \"uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC26udPlb8QUuciIxpfH8LUd\",
223
+ \n \"bank_accounts_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC26udPlb8QUuciIxpfH8LUd/bank_accounts\",
224
+ \n \"refunds_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC26udPlb8QUuciIxpfH8LUd/refunds\",
225
+ \n \"meta\": {}, \n \"debits_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC26udPlb8QUuciIxpfH8LUd/debits\",
226
+ \n \"transactions_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC26udPlb8QUuciIxpfH8LUd/transactions\",
227
+ \n \"email_address\": \"merchant2@example.org\", \n \"id\": \"AC26udPlb8QUuciIxpfH8LUd\",
228
+ \n \"credits_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC26udPlb8QUuciIxpfH8LUd/credits\",
229
+ \n \"cards_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC26udPlb8QUuciIxpfH8LUd/cards\"\n}"
230
+ http_version: !!null
231
+ recorded_at: Fri, 06 Jul 2012 04:23:00 GMT
232
+ recorded_with: VCR 2.2.2
@@ -0,0 +1,232 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.balancedpayments.com/v1/merchants
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - balanced-ruby/0.3.5
12
+ Authorization:
13
+ - Basic M2RkZGE5MDBjNzIyMTFlMWEyOWMwMjZiYTdlNWU3MmU6
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: !!null
18
+ headers:
19
+ content-type:
20
+ - application/json
21
+ date:
22
+ - Fri, 06 Jul 2012 04:22:55 GMT
23
+ server:
24
+ - nginx/1.0.14
25
+ x-balanced-guru:
26
+ - OHM4278dab6c72211e19eae026ba7e5e72e
27
+ x-balanced-marketplace:
28
+ - TEST-MP1TeztGGOGLPPCo2cLKo6SZ
29
+ x-balanced-merchant:
30
+ - TEST-MR1StaiKg1wIPZi4BqZBFKgK
31
+ x-balanced-version:
32
+ - ''
33
+ content-length:
34
+ - '2062'
35
+ connection:
36
+ - Close
37
+ body:
38
+ encoding: US-ASCII
39
+ string: ! "{\n \"first_uri\": \"/v1/merchants?limit=10&offset=0\", \n \"items\":
40
+ [\n {\n \"phone_number\": \"+16505551212\", \n \"city\": \"Nowhere\",
41
+ \n \"marketplace\": {\n \"in_escrow\": 0, \n \"domain_url\":
42
+ \"example.com\", \n \"name\": \"Test Marketplace\", \n \"owner_account_uri\":
43
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC1TCUdnBEr1KwYUyKqb91wZ\",
44
+ \n \"support_email_address\": \"support@example.com\", \n \"uri\":
45
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ\", \n \"bank_accounts_uri\":
46
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/bank_accounts\", \n \"support_phone_number\":
47
+ \"+16505551234\", \n \"refunds_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/refunds\",
48
+ \n \"meta\": {}, \n \"debits_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/debits\",
49
+ \n \"holds_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/holds\",
50
+ \n \"transactions_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/transactions\",
51
+ \n \"accounts_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts\",
52
+ \n \"id\": \"TEST-MP1TeztGGOGLPPCo2cLKo6SZ\", \n \"credits_uri\":
53
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/credits\", \n \"cards_uri\":
54
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/cards\"\n }, \n \"name\":
55
+ \"William Henry Cavendish III\", \n \"email_address\": \"whc@example.org\",
56
+ \n \"created_at\": \"2012-07-06T04:22:47.628360Z\", \n \"uri\":
57
+ \"/v1/merchants/TEST-MR1StaiKg1wIPZi4BqZBFKgK\", \n \"accounts_uri\":
58
+ \"/v1/merchants/TEST-MR1StaiKg1wIPZi4BqZBFKgK/accounts\", \n \"meta\":
59
+ {}, \n \"postal_code\": \"90210\", \n \"country_code\": \"USA\",
60
+ \n \"type\": \"person\", \n \"balance\": 0, \n \"api_keys_uri\":
61
+ \"/v1/merchants/TEST-MR1StaiKg1wIPZi4BqZBFKgK/api_keys\", \n \"id\":
62
+ \"TEST-MR1StaiKg1wIPZi4BqZBFKgK\", \n \"street_address\": \"123 Fake
63
+ St\"\n }\n ], \n \"previous_uri\": null, \n \"uri\": \"/v1/merchants?limit=10&offset=0\",
64
+ \n \"limit\": 10, \n \"offset\": 0, \n \"total\": 1, \n \"next_uri\":
65
+ null, \n \"last_uri\": \"/v1/merchants?limit=10&offset=0\"\n}"
66
+ http_version: !!null
67
+ recorded_at: Fri, 06 Jul 2012 04:22:55 GMT
68
+ - request:
69
+ method: get
70
+ uri: https://api.balancedpayments.com/v1/merchants
71
+ body:
72
+ encoding: US-ASCII
73
+ string: ''
74
+ headers:
75
+ User-Agent:
76
+ - balanced-ruby/0.3.5
77
+ Authorization:
78
+ - Basic M2RkZGE5MDBjNzIyMTFlMWEyOWMwMjZiYTdlNWU3MmU6
79
+ response:
80
+ status:
81
+ code: 200
82
+ message: !!null
83
+ headers:
84
+ content-type:
85
+ - application/json
86
+ date:
87
+ - Fri, 06 Jul 2012 04:22:56 GMT
88
+ server:
89
+ - nginx/1.0.14
90
+ x-balanced-guru:
91
+ - OHM42c59fa4c72211e1a977026ba7e239a9
92
+ x-balanced-marketplace:
93
+ - TEST-MP1TeztGGOGLPPCo2cLKo6SZ
94
+ x-balanced-merchant:
95
+ - TEST-MR1StaiKg1wIPZi4BqZBFKgK
96
+ x-balanced-version:
97
+ - ''
98
+ content-length:
99
+ - '2062'
100
+ connection:
101
+ - Close
102
+ body:
103
+ encoding: US-ASCII
104
+ string: ! "{\n \"first_uri\": \"/v1/merchants?limit=10&offset=0\", \n \"items\":
105
+ [\n {\n \"phone_number\": \"+16505551212\", \n \"city\": \"Nowhere\",
106
+ \n \"marketplace\": {\n \"in_escrow\": 0, \n \"domain_url\":
107
+ \"example.com\", \n \"name\": \"Test Marketplace\", \n \"owner_account_uri\":
108
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC1TCUdnBEr1KwYUyKqb91wZ\",
109
+ \n \"support_email_address\": \"support@example.com\", \n \"uri\":
110
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ\", \n \"bank_accounts_uri\":
111
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/bank_accounts\", \n \"support_phone_number\":
112
+ \"+16505551234\", \n \"refunds_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/refunds\",
113
+ \n \"meta\": {}, \n \"debits_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/debits\",
114
+ \n \"holds_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/holds\",
115
+ \n \"transactions_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/transactions\",
116
+ \n \"accounts_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts\",
117
+ \n \"id\": \"TEST-MP1TeztGGOGLPPCo2cLKo6SZ\", \n \"credits_uri\":
118
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/credits\", \n \"cards_uri\":
119
+ \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/cards\"\n }, \n \"name\":
120
+ \"William Henry Cavendish III\", \n \"email_address\": \"whc@example.org\",
121
+ \n \"created_at\": \"2012-07-06T04:22:47.628360Z\", \n \"uri\":
122
+ \"/v1/merchants/TEST-MR1StaiKg1wIPZi4BqZBFKgK\", \n \"accounts_uri\":
123
+ \"/v1/merchants/TEST-MR1StaiKg1wIPZi4BqZBFKgK/accounts\", \n \"meta\":
124
+ {}, \n \"postal_code\": \"90210\", \n \"country_code\": \"USA\",
125
+ \n \"type\": \"person\", \n \"balance\": 0, \n \"api_keys_uri\":
126
+ \"/v1/merchants/TEST-MR1StaiKg1wIPZi4BqZBFKgK/api_keys\", \n \"id\":
127
+ \"TEST-MR1StaiKg1wIPZi4BqZBFKgK\", \n \"street_address\": \"123 Fake
128
+ St\"\n }\n ], \n \"previous_uri\": null, \n \"uri\": \"/v1/merchants?limit=10&offset=0\",
129
+ \n \"limit\": 10, \n \"offset\": 0, \n \"total\": 1, \n \"next_uri\":
130
+ null, \n \"last_uri\": \"/v1/merchants?limit=10&offset=0\"\n}"
131
+ http_version: !!null
132
+ recorded_at: Fri, 06 Jul 2012 04:22:56 GMT
133
+ - request:
134
+ method: post
135
+ uri: https://api.balancedpayments.com/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/bank_accounts
136
+ body:
137
+ encoding: UTF-8
138
+ string: ! '{"account_number":"1234567890","bank_code":"321174851","name":"Jack
139
+ Q Merchant"}'
140
+ headers:
141
+ User-Agent:
142
+ - balanced-ruby/0.3.5
143
+ Authorization:
144
+ - Basic M2RkZGE5MDBjNzIyMTFlMWEyOWMwMjZiYTdlNWU3MmU6
145
+ Content-Type:
146
+ - application/json
147
+ response:
148
+ status:
149
+ code: 201
150
+ message: !!null
151
+ headers:
152
+ content-type:
153
+ - application/json
154
+ date:
155
+ - Fri, 06 Jul 2012 04:22:56 GMT
156
+ server:
157
+ - nginx/1.0.14
158
+ x-balanced-guru:
159
+ - OHM4301826cc72211e1a29c026ba7e5e72e
160
+ x-balanced-marketplace:
161
+ - TEST-MP1TeztGGOGLPPCo2cLKo6SZ
162
+ x-balanced-merchant:
163
+ - TEST-MR1StaiKg1wIPZi4BqZBFKgK
164
+ x-balanced-version:
165
+ - ''
166
+ content-length:
167
+ - '366'
168
+ connection:
169
+ - Close
170
+ body:
171
+ encoding: US-ASCII
172
+ string: ! "{\n \"bank_name\": \"SAN MATEO CREDIT UNION\", \n \"account\":
173
+ null, \n \"name\": \"Jack Q Merchant\", \n \"bank_code\": \"321174851\",
174
+ \n \"created_at\": \"2012-07-06T04:22:56.569026Z\", \n \"uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/bank_accounts/BA22wEhYDzKaxQljawlxpFoi\",
175
+ \n \"is_valid\": true, \n \"meta\": {}, \n \"last_four\": \"7890\", \n
176
+ \ \"id\": \"BA22wEhYDzKaxQljawlxpFoi\"\n}"
177
+ http_version: !!null
178
+ recorded_at: Fri, 06 Jul 2012 04:22:57 GMT
179
+ - request:
180
+ method: post
181
+ uri: https://api.balancedpayments.com/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts
182
+ body:
183
+ encoding: UTF-8
184
+ string: ! '{"email_address":"merchant@example.org","merchant":{"type":"person","name":"Billy
185
+ Jones","street_address":"801 High St.","postal_code":"94301","country":"USA","dob":"1842-01","phone_number":"+16505551234"},"bank_account_uri":"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/bank_accounts/BA22wEhYDzKaxQljawlxpFoi","name":"Jack
186
+ Q Merchant"}'
187
+ headers:
188
+ User-Agent:
189
+ - balanced-ruby/0.3.5
190
+ Authorization:
191
+ - Basic M2RkZGE5MDBjNzIyMTFlMWEyOWMwMjZiYTdlNWU3MmU6
192
+ Content-Type:
193
+ - application/json
194
+ response:
195
+ status:
196
+ code: 201
197
+ message: !!null
198
+ headers:
199
+ content-type:
200
+ - application/json
201
+ date:
202
+ - Fri, 06 Jul 2012 04:22:57 GMT
203
+ server:
204
+ - nginx/1.0.14
205
+ x-balanced-guru:
206
+ - OHM4391c14cc72211e1b502026ba7e239a9
207
+ x-balanced-marketplace:
208
+ - TEST-MP1TeztGGOGLPPCo2cLKo6SZ
209
+ x-balanced-merchant:
210
+ - TEST-MR1StaiKg1wIPZi4BqZBFKgK
211
+ x-balanced-version:
212
+ - ''
213
+ content-length:
214
+ - '1099'
215
+ connection:
216
+ - Close
217
+ body:
218
+ encoding: US-ASCII
219
+ string: ! "{\n \"holds_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC23H99oTm6EQjiU9puo1cJr/holds\",
220
+ \n \"name\": \"Jack Q Merchant\", \n \"roles\": [\n \"merchant\", \n
221
+ \ \"buyer\"\n ], \n \"created_at\": \"2012-07-06T04:22:57.603007Z\", \n
222
+ \ \"uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC23H99oTm6EQjiU9puo1cJr\",
223
+ \n \"bank_accounts_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC23H99oTm6EQjiU9puo1cJr/bank_accounts\",
224
+ \n \"refunds_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC23H99oTm6EQjiU9puo1cJr/refunds\",
225
+ \n \"meta\": {}, \n \"debits_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC23H99oTm6EQjiU9puo1cJr/debits\",
226
+ \n \"transactions_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC23H99oTm6EQjiU9puo1cJr/transactions\",
227
+ \n \"email_address\": \"merchant@example.org\", \n \"id\": \"AC23H99oTm6EQjiU9puo1cJr\",
228
+ \n \"credits_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC23H99oTm6EQjiU9puo1cJr/credits\",
229
+ \n \"cards_uri\": \"/v1/marketplaces/TEST-MP1TeztGGOGLPPCo2cLKo6SZ/accounts/AC23H99oTm6EQjiU9puo1cJr/cards\"\n}"
230
+ http_version: !!null
231
+ recorded_at: Fri, 06 Jul 2012 04:22:58 GMT
232
+ recorded_with: VCR 2.2.2