balanced 1.1.1 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +10 -6
  4. data/CHANGELOG.md +4 -0
  5. data/README.md +1 -1
  6. data/lib/balanced/resources.rb +2 -0
  7. data/lib/balanced/resources/account.rb +33 -0
  8. data/lib/balanced/resources/card.rb +1 -1
  9. data/lib/balanced/resources/customer.rb +8 -0
  10. data/lib/balanced/resources/resource.rb +4 -6
  11. data/lib/balanced/resources/settlement.rb +12 -0
  12. data/lib/balanced/response/balanced_exception_middleware.rb +1 -1
  13. data/lib/balanced/utils.rb +1 -1
  14. data/lib/balanced/version.rb +1 -1
  15. data/scenarios/account_credit/definition.rb +1 -0
  16. data/scenarios/account_credit/request.rb +5 -0
  17. data/scenarios/account_credit/ruby.mako +49 -0
  18. data/scenarios/account_list/definition.rb +1 -0
  19. data/scenarios/account_list/request.rb +2 -0
  20. data/scenarios/account_list/ruby.mako +64 -0
  21. data/scenarios/account_list_customer/definition.rb +1 -0
  22. data/scenarios/account_list_customer/request.rb +3 -0
  23. data/scenarios/account_list_customer/ruby.mako +38 -0
  24. data/scenarios/account_show/definition.rb +1 -0
  25. data/scenarios/account_show/request.rb +2 -0
  26. data/scenarios/account_show/ruby.mako +37 -0
  27. data/scenarios/api_key_create/ruby.mako +6 -6
  28. data/scenarios/api_key_delete/ruby.mako +2 -2
  29. data/scenarios/api_key_list/ruby.mako +10 -10
  30. data/scenarios/api_key_show/ruby.mako +6 -6
  31. data/scenarios/bank_account_associate_to_customer/ruby.mako +16 -14
  32. data/scenarios/bank_account_create/ruby.mako +13 -11
  33. data/scenarios/bank_account_credit/ruby.mako +16 -16
  34. data/scenarios/bank_account_debit/ruby.mako +21 -18
  35. data/scenarios/bank_account_debit_order/definition.rb +1 -0
  36. data/scenarios/bank_account_debit_order/request.rb +7 -0
  37. data/scenarios/bank_account_debit_order/ruby.mako +52 -0
  38. data/scenarios/bank_account_delete/ruby.mako +2 -2
  39. data/scenarios/bank_account_list/ruby.mako +26 -22
  40. data/scenarios/bank_account_show/ruby.mako +14 -12
  41. data/scenarios/bank_account_update/ruby.mako +14 -12
  42. data/scenarios/bank_account_verification_create/ruby.mako +10 -10
  43. data/scenarios/bank_account_verification_show/ruby.mako +10 -10
  44. data/scenarios/bank_account_verification_update/ruby.mako +9 -9
  45. data/scenarios/callback_create/ruby.mako +4 -4
  46. data/scenarios/callback_delete/ruby.mako +2 -2
  47. data/scenarios/callback_list/ruby.mako +4 -4
  48. data/scenarios/callback_show/ruby.mako +5 -5
  49. data/scenarios/card_associate_to_customer/ruby.mako +26 -26
  50. data/scenarios/card_create/ruby.mako +13 -15
  51. data/scenarios/card_create_creditable/ruby.mako +11 -11
  52. data/scenarios/card_create_dispute/ruby.mako +13 -13
  53. data/scenarios/card_credit/ruby.mako +16 -14
  54. data/scenarios/card_credit_order/definition.rb +1 -0
  55. data/scenarios/card_credit_order/request.rb +7 -0
  56. data/scenarios/card_credit_order/ruby.mako +45 -0
  57. data/scenarios/card_debit/ruby.mako +20 -17
  58. data/scenarios/card_debit_dispute/ruby.mako +20 -17
  59. data/scenarios/card_delete/ruby.mako +2 -2
  60. data/scenarios/card_hold_capture/ruby.mako +20 -17
  61. data/scenarios/card_hold_create/ruby.mako +16 -14
  62. data/scenarios/card_hold_list/ruby.mako +33 -27
  63. data/scenarios/card_hold_order/definition.rb +1 -0
  64. data/scenarios/card_hold_order/request.rb +6 -0
  65. data/scenarios/card_hold_order/ruby.mako +45 -0
  66. data/scenarios/card_hold_show/ruby.mako +16 -14
  67. data/scenarios/card_hold_update/ruby.mako +16 -14
  68. data/scenarios/card_hold_void/ruby.mako +17 -15
  69. data/scenarios/card_list/ruby.mako +25 -29
  70. data/scenarios/card_show/ruby.mako +14 -16
  71. data/scenarios/card_update/ruby.mako +14 -16
  72. data/scenarios/credit_list/ruby.mako +44 -14
  73. data/scenarios/credit_list_bank_account/ruby.mako +3 -3
  74. data/scenarios/credit_order/request.rb +2 -2
  75. data/scenarios/credit_order/ruby.mako +35 -14
  76. data/scenarios/credit_show/ruby.mako +16 -16
  77. data/scenarios/credit_update/ruby.mako +16 -16
  78. data/scenarios/customer_create/ruby.mako +22 -20
  79. data/scenarios/customer_delete/ruby.mako +1 -1
  80. data/scenarios/customer_list/ruby.mako +43 -39
  81. data/scenarios/customer_show/ruby.mako +23 -21
  82. data/scenarios/customer_update/ruby.mako +23 -21
  83. data/scenarios/debit_dispute_show/ruby.mako +12 -12
  84. data/scenarios/debit_list/ruby.mako +43 -37
  85. data/scenarios/debit_order/ruby.mako +22 -19
  86. data/scenarios/debit_show/ruby.mako +20 -17
  87. data/scenarios/debit_update/ruby.mako +20 -17
  88. data/scenarios/dispute_list/ruby.mako +11 -11
  89. data/scenarios/dispute_show/ruby.mako +12 -12
  90. data/scenarios/event_list/ruby.mako +55 -81
  91. data/scenarios/event_show/ruby.mako +35 -45
  92. data/scenarios/order_create/ruby.mako +16 -14
  93. data/scenarios/order_list/ruby.mako +33 -29
  94. data/scenarios/order_show/ruby.mako +16 -14
  95. data/scenarios/order_update/ruby.mako +16 -14
  96. data/scenarios/refund_create/ruby.mako +13 -13
  97. data/scenarios/refund_list/ruby.mako +12 -12
  98. data/scenarios/refund_show/ruby.mako +13 -13
  99. data/scenarios/refund_update/ruby.mako +13 -13
  100. data/scenarios/reversal_create/ruby.mako +13 -13
  101. data/scenarios/reversal_list/ruby.mako +12 -12
  102. data/scenarios/reversal_show/ruby.mako +13 -13
  103. data/scenarios/reversal_update/ruby.mako +13 -13
  104. data/scenarios/settlement_create/definition.rb +1 -0
  105. data/scenarios/settlement_create/request.rb +5 -0
  106. data/scenarios/settlement_create/ruby.mako +48 -0
  107. data/scenarios/settlement_list/definition.rb +1 -0
  108. data/scenarios/settlement_list/request.rb +2 -0
  109. data/scenarios/settlement_list/ruby.mako +40 -0
  110. data/scenarios/settlement_list_account/definition.rb +1 -0
  111. data/scenarios/settlement_list_account/request.rb +3 -0
  112. data/scenarios/settlement_list_account/ruby.mako +41 -0
  113. data/scenarios/settlement_show/definition.rb +1 -0
  114. data/scenarios/settlement_show/request.rb +2 -0
  115. data/scenarios/settlement_show/ruby.mako +40 -0
  116. data/snippets/account-balance.rb +1 -0
  117. data/snippets/bank-account-create.rb +6 -0
  118. data/snippets/bank-account-debit.rb +9 -0
  119. data/snippets/bank-account-verification-confirm.rb +5 -0
  120. data/snippets/bank-account-verification-create.rb +1 -0
  121. data/snippets/callback-create.rb +4 -0
  122. data/snippets/card-associate-to-customer.rb +2 -0
  123. data/snippets/card-create-dispute.rb +6 -0
  124. data/snippets/card-create.rb +7 -0
  125. data/snippets/card-credit.rb +9 -0
  126. data/snippets/card-debit.rb +9 -0
  127. data/snippets/card-hold-capture.rb +6 -0
  128. data/snippets/card-hold-create.rb +6 -0
  129. data/snippets/card-hold-void.rb +3 -0
  130. data/snippets/create-buyer-and-card.rb +13 -0
  131. data/snippets/credit-create.rb +8 -0
  132. data/snippets/credit-fetch.rb +1 -0
  133. data/snippets/credit-marketplace-escrow.rb +4 -0
  134. data/snippets/credit-reverse.rb +1 -0
  135. data/snippets/credit-soft-descriptor.rb +9 -0
  136. data/snippets/credit-split.rb +13 -0
  137. data/snippets/customer-create.rb +8 -0
  138. data/snippets/debit-dispute-show.rb +3 -0
  139. data/snippets/debit-fetch.rb +1 -0
  140. data/snippets/debit-marketplace-escrow.rb +4 -0
  141. data/snippets/debit-refund.rb +1 -0
  142. data/snippets/dispute-list.rb +1 -0
  143. data/snippets/dispute-show.rb +2 -0
  144. data/snippets/examine-order-after-refund.rb +3 -0
  145. data/snippets/examine-order-after-reversal.rb +3 -0
  146. data/snippets/example.rb +1 -0
  147. data/snippets/marketplace-in-escrow.rb +1 -0
  148. data/snippets/merchant-payable-account-fetch.rb +2 -0
  149. data/snippets/order-amount-escrowed.rb +3 -0
  150. data/snippets/order-bank-account-create.rb +8 -0
  151. data/snippets/order-create.rb +1 -0
  152. data/snippets/order-credit-marketplace.rb +5 -0
  153. data/snippets/order-credit-merchant-payable-account.rb +4 -0
  154. data/snippets/order-credit.rb +4 -0
  155. data/snippets/order-credits-fetch.rb +1 -0
  156. data/snippets/order-debit.rb +4 -0
  157. data/snippets/order-debits-fetch.rb +1 -0
  158. data/snippets/order-fetch.rb +1 -0
  159. data/snippets/order-update.rb +5 -0
  160. data/snippets/refund-create.rb +13 -0
  161. data/snippets/reversal-create.rb +13 -0
  162. data/snippets/settlement-create.rb +5 -0
  163. data/spec/balanced/resources/account_spec.rb +265 -0
  164. data/spec/balanced/resources/card_spec.rb +6 -6
  165. metadata +86 -2
@@ -64,7 +64,7 @@ describe Balanced::Card, :vcr do
64
64
  its(:can_debit) { should eql true }
65
65
  its(:bank_name) { should eql 'WELLS FARGO BANK, N.A.' }
66
66
  its(:category) { should eql 'other' }
67
- its(:type) { should eql 'debit'}
67
+ its(:class) { should eql Balanced::Card }
68
68
  end
69
69
 
70
70
  describe '#credit' do
@@ -80,13 +80,13 @@ describe Balanced::Card, :vcr do
80
80
  end
81
81
 
82
82
  describe 'attributes', :vcr do
83
- let(:credit) { @credit }
83
+ let(:the_credit) { @credit }
84
84
 
85
85
  it 'should have valid attributes' do
86
- expect(credit.href).to eq("/credits/#{@credit.id}")
87
- expect(credit.amount).to eq(1234)
88
- expect(credit.meta).to eq(@meta)
89
- expect(credit.status).to eq('succeeded')
86
+ expect(the_credit.href).to eq("/credits/#{@credit.id}")
87
+ expect(the_credit.amount).to eq(1234)
88
+ expect(the_credit.meta).to eq(@meta)
89
+ expect(the_credit.status).to eq('succeeded')
90
90
  end
91
91
  end
92
92
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: balanced
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Balanced
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-02 00:00:00.000000000 Z
11
+ date: 2014-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -93,6 +93,7 @@ files:
93
93
  - lib/balanced/error.rb
94
94
  - lib/balanced/pager.rb
95
95
  - lib/balanced/resources.rb
96
+ - lib/balanced/resources/account.rb
96
97
  - lib/balanced/resources/api_key.rb
97
98
  - lib/balanced/resources/bank_account.rb
98
99
  - lib/balanced/resources/callback.rb
@@ -110,10 +111,23 @@ files:
110
111
  - lib/balanced/resources/refund.rb
111
112
  - lib/balanced/resources/resource.rb
112
113
  - lib/balanced/resources/reversal.rb
114
+ - lib/balanced/resources/settlement.rb
113
115
  - lib/balanced/resources/transfer.rb
114
116
  - lib/balanced/response/balanced_exception_middleware.rb
115
117
  - lib/balanced/utils.rb
116
118
  - lib/balanced/version.rb
119
+ - scenarios/account_credit/definition.rb
120
+ - scenarios/account_credit/request.rb
121
+ - scenarios/account_credit/ruby.mako
122
+ - scenarios/account_list/definition.rb
123
+ - scenarios/account_list/request.rb
124
+ - scenarios/account_list/ruby.mako
125
+ - scenarios/account_list_customer/definition.rb
126
+ - scenarios/account_list_customer/request.rb
127
+ - scenarios/account_list_customer/ruby.mako
128
+ - scenarios/account_show/definition.rb
129
+ - scenarios/account_show/request.rb
130
+ - scenarios/account_show/ruby.mako
117
131
  - scenarios/api_key_create/definition.rb
118
132
  - scenarios/api_key_create/request.rb
119
133
  - scenarios/api_key_create/ruby.mako
@@ -138,6 +152,9 @@ files:
138
152
  - scenarios/bank_account_debit/definition.rb
139
153
  - scenarios/bank_account_debit/request.rb
140
154
  - scenarios/bank_account_debit/ruby.mako
155
+ - scenarios/bank_account_debit_order/definition.rb
156
+ - scenarios/bank_account_debit_order/request.rb
157
+ - scenarios/bank_account_debit_order/ruby.mako
141
158
  - scenarios/bank_account_delete/definition.rb
142
159
  - scenarios/bank_account_delete/request.rb
143
160
  - scenarios/bank_account_delete/ruby.mako
@@ -186,6 +203,9 @@ files:
186
203
  - scenarios/card_credit/definition.rb
187
204
  - scenarios/card_credit/request.rb
188
205
  - scenarios/card_credit/ruby.mako
206
+ - scenarios/card_credit_order/definition.rb
207
+ - scenarios/card_credit_order/request.rb
208
+ - scenarios/card_credit_order/ruby.mako
189
209
  - scenarios/card_debit/definition.rb
190
210
  - scenarios/card_debit/request.rb
191
211
  - scenarios/card_debit/ruby.mako
@@ -204,6 +224,9 @@ files:
204
224
  - scenarios/card_hold_list/definition.rb
205
225
  - scenarios/card_hold_list/request.rb
206
226
  - scenarios/card_hold_list/ruby.mako
227
+ - scenarios/card_hold_order/definition.rb
228
+ - scenarios/card_hold_order/request.rb
229
+ - scenarios/card_hold_order/ruby.mako
207
230
  - scenarios/card_hold_show/definition.rb
208
231
  - scenarios/card_hold_show/request.rb
209
232
  - scenarios/card_hold_show/ruby.mako
@@ -317,8 +340,68 @@ files:
317
340
  - scenarios/reversal_update/definition.rb
318
341
  - scenarios/reversal_update/request.rb
319
342
  - scenarios/reversal_update/ruby.mako
343
+ - scenarios/settlement_create/definition.rb
344
+ - scenarios/settlement_create/request.rb
345
+ - scenarios/settlement_create/ruby.mako
346
+ - scenarios/settlement_list/definition.rb
347
+ - scenarios/settlement_list/request.rb
348
+ - scenarios/settlement_list/ruby.mako
349
+ - scenarios/settlement_list_account/definition.rb
350
+ - scenarios/settlement_list_account/request.rb
351
+ - scenarios/settlement_list_account/ruby.mako
352
+ - scenarios/settlement_show/definition.rb
353
+ - scenarios/settlement_show/request.rb
354
+ - scenarios/settlement_show/ruby.mako
355
+ - snippets/account-balance.rb
356
+ - snippets/bank-account-create.rb
357
+ - snippets/bank-account-debit.rb
358
+ - snippets/bank-account-verification-confirm.rb
359
+ - snippets/bank-account-verification-create.rb
360
+ - snippets/callback-create.rb
361
+ - snippets/card-associate-to-customer.rb
362
+ - snippets/card-create-dispute.rb
363
+ - snippets/card-create.rb
364
+ - snippets/card-credit.rb
365
+ - snippets/card-debit.rb
366
+ - snippets/card-hold-capture.rb
367
+ - snippets/card-hold-create.rb
368
+ - snippets/card-hold-void.rb
369
+ - snippets/create-buyer-and-card.rb
370
+ - snippets/credit-create.rb
371
+ - snippets/credit-fetch.rb
372
+ - snippets/credit-marketplace-escrow.rb
373
+ - snippets/credit-reverse.rb
374
+ - snippets/credit-soft-descriptor.rb
375
+ - snippets/credit-split.rb
376
+ - snippets/customer-create.rb
377
+ - snippets/debit-dispute-show.rb
378
+ - snippets/debit-fetch.rb
379
+ - snippets/debit-marketplace-escrow.rb
380
+ - snippets/debit-refund.rb
381
+ - snippets/dispute-list.rb
382
+ - snippets/dispute-show.rb
383
+ - snippets/examine-order-after-refund.rb
384
+ - snippets/examine-order-after-reversal.rb
385
+ - snippets/example.rb
386
+ - snippets/marketplace-in-escrow.rb
387
+ - snippets/merchant-payable-account-fetch.rb
388
+ - snippets/order-amount-escrowed.rb
389
+ - snippets/order-bank-account-create.rb
390
+ - snippets/order-create.rb
391
+ - snippets/order-credit-marketplace.rb
392
+ - snippets/order-credit-merchant-payable-account.rb
393
+ - snippets/order-credit.rb
394
+ - snippets/order-credits-fetch.rb
395
+ - snippets/order-debit.rb
396
+ - snippets/order-debits-fetch.rb
397
+ - snippets/order-fetch.rb
398
+ - snippets/order-update.rb
399
+ - snippets/refund-create.rb
400
+ - snippets/reversal-create.rb
401
+ - snippets/settlement-create.rb
320
402
  - spec/balanced/error_spec.rb
321
403
  - spec/balanced/pager_spec.rb
404
+ - spec/balanced/resources/account_spec.rb
322
405
  - spec/balanced/resources/api_key_spec.rb
323
406
  - spec/balanced/resources/bank_account_spec.rb
324
407
  - spec/balanced/resources/callback_spec.rb
@@ -363,6 +446,7 @@ summary: https://docs.balancedpayments.com/
363
446
  test_files:
364
447
  - spec/balanced/error_spec.rb
365
448
  - spec/balanced/pager_spec.rb
449
+ - spec/balanced/resources/account_spec.rb
366
450
  - spec/balanced/resources/api_key_spec.rb
367
451
  - spec/balanced/resources/bank_account_spec.rb
368
452
  - spec/balanced/resources/callback_spec.rb