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
@@ -2,48 +2,51 @@
2
2
  Balanced::Order.debit_from
3
3
  % elif mode == 'request':
4
4
  require 'balanced'
5
- Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
5
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
6
6
 
7
- order = Balanced::Order.fetch('/orders/OR4R53c8wdUiVEUiegSHpwaN')
8
- card = Balanced::Card.fetch('/cards/CC4xXVOyMBDdk7FtzG9HwtBv')
7
+ order = Balanced::Order.fetch('/orders/OR6c6n11zKSFfjE6kGNKtsE8')
8
+ card = Balanced::Card.fetch('/cards/CC73IyzxPUu2z89NH8GrJhLn')
9
9
  order.debit_from(
10
10
  :source => card,
11
11
  :amount => 5000
12
12
  )
13
13
 
14
14
  % elif mode == 'response':
15
- #<Balanced::Debit:0x007fa7d40fd6a0
15
+ #<Balanced::Debit:0x007fcde12d05d0
16
16
  @attributes=
17
17
  {"amount"=>5000,
18
18
  "appears_on_statement_as"=>"BAL*example.com",
19
- "created_at"=>"2014-05-15T00:41:37.159166Z",
19
+ "created_at"=>"2014-12-17T21:25:04.086780Z",
20
20
  "currency"=>"USD",
21
21
  "description"=>"Order #12341234",
22
22
  "failure_reason"=>nil,
23
23
  "failure_reason_code"=>nil,
24
- "href"=>"/debits/WD5ewolo9HEVQkv8dcyx87gd",
25
- "id"=>"WD5ewolo9HEVQkv8dcyx87gd",
24
+ "href"=>"/debits/WD7dRwgfkmvirShpxn7JA8JL",
25
+ "id"=>"WD7dRwgfkmvirShpxn7JA8JL",
26
26
  "links"=>
27
- {"customer"=>"CU2L981m9AtPY8pjpGpjnjnf",
27
+ {"card_hold"=>"HL7dQKkSsFJpaZppKe2pB4TX",
28
+ "customer"=>nil,
28
29
  "dispute"=>nil,
29
- "order"=>"OR4R53c8wdUiVEUiegSHpwaN",
30
- "source"=>"CC4xXVOyMBDdk7FtzG9HwtBv"},
30
+ "order"=>"OR6c6n11zKSFfjE6kGNKtsE8",
31
+ "source"=>"CC73IyzxPUu2z89NH8GrJhLn"},
31
32
  "meta"=>{},
32
33
  "status"=>"succeeded",
33
- "transaction_number"=>"W941-130-0831",
34
- "updated_at"=>"2014-05-15T00:41:40.522871Z"},
34
+ "transaction_number"=>"WG9L-4UP-ZQQN",
35
+ "updated_at"=>"2014-12-17T21:25:04.922248Z"},
35
36
  @hyperlinks=
36
- {"customer"=>
37
- #<Proc:0x007fa7d4187b48/lib/balanced/resources/resource.rb:60 (lambda)>,
37
+ {"card_hold"=>
38
+ #<Proc:0x007fcde12daa58/lib/balanced/resources/resource.rb:56 (lambda)>,
39
+ "customer"=>
40
+ #<Proc:0x007fcde12da0d0/lib/balanced/utils.rb:6 (lambda)>,
38
41
  "dispute"=>
39
- #<Proc:0x007fa7d41871c0/lib/balanced/utils.rb:6 (lambda)>,
42
+ #<Proc:0x007fcde12d9748/lib/balanced/utils.rb:6 (lambda)>,
40
43
  "events"=>
41
- #<Proc:0x007fa7d4185370/lib/balanced/utils.rb:6 (lambda)>,
44
+ #<Proc:0x007fcde12e3888/lib/balanced/utils.rb:6 (lambda)>,
42
45
  "order"=>
43
- #<Proc:0x007fa7d418f988/lib/balanced/resources/resource.rb:60 (lambda)>,
46
+ #<Proc:0x007fcde12e1ee8/lib/balanced/resources/resource.rb:56 (lambda)>,
44
47
  "refunds"=>
45
- #<Proc:0x007fa7d418db38/lib/balanced/utils.rb:6 (lambda)>,
48
+ #<Proc:0x007fcde12e0098/lib/balanced/utils.rb:6 (lambda)>,
46
49
  "source"=>
47
- #<Proc:0x007fa7d418c1c0/lib/balanced/resources/resource.rb:60 (lambda)>}>
50
+ #<Proc:0x007fcde12ea6d8/lib/balanced/resources/resource.rb:56 (lambda)>}>
48
51
 
49
52
  % endif
@@ -3,43 +3,46 @@ Balanced::Debit.fetch
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
7
7
 
8
- debit = Balanced::Debit.fetch('/debits/WD4GV5z2pEIRZ9cBSuyuykQx')
8
+ debit = Balanced::Debit.fetch('/debits/WD7AAkAyeN6YTeHJTn1ThPYA')
9
9
 
10
10
  % elif mode == 'response':
11
- #<Balanced::Debit:0x007fa7d4196bc0
11
+ #<Balanced::Debit:0x007fcde1312d68
12
12
  @attributes=
13
13
  {"amount"=>5000,
14
14
  "appears_on_statement_as"=>"BAL*Statement text",
15
- "created_at"=>"2014-05-15T00:41:07.283881Z",
15
+ "created_at"=>"2014-12-17T21:25:24.286272Z",
16
16
  "currency"=>"USD",
17
17
  "description"=>"Some descriptive text for the debit in the dashboard",
18
18
  "failure_reason"=>nil,
19
19
  "failure_reason_code"=>nil,
20
- "href"=>"/debits/WD4GV5z2pEIRZ9cBSuyuykQx",
21
- "id"=>"WD4GV5z2pEIRZ9cBSuyuykQx",
20
+ "href"=>"/debits/WD7AAkAyeN6YTeHJTn1ThPYA",
21
+ "id"=>"WD7AAkAyeN6YTeHJTn1ThPYA",
22
22
  "links"=>
23
- {"customer"=>"CU2L981m9AtPY8pjpGpjnjnf",
23
+ {"card_hold"=>"HL7Az4UI0XU8rHAqmNY0Snp6",
24
+ "customer"=>nil,
24
25
  "dispute"=>nil,
25
26
  "order"=>nil,
26
- "source"=>"CC4xXVOyMBDdk7FtzG9HwtBv"},
27
+ "source"=>"CC73IyzxPUu2z89NH8GrJhLn"},
27
28
  "meta"=>{},
28
29
  "status"=>"succeeded",
29
- "transaction_number"=>"W235-372-7348",
30
- "updated_at"=>"2014-05-15T00:41:11.755100Z"},
30
+ "transaction_number"=>"WDQN-HJW-1YIP",
31
+ "updated_at"=>"2014-12-17T21:25:25.027834Z"},
31
32
  @hyperlinks=
32
- {"customer"=>
33
- #<Proc:0x007fa7d4195068/lib/balanced/resources/resource.rb:60 (lambda)>,
33
+ {"card_hold"=>
34
+ #<Proc:0x007fcde1311238/lib/balanced/resources/resource.rb:56 (lambda)>,
35
+ "customer"=>
36
+ #<Proc:0x007fcde13108b0/lib/balanced/utils.rb:6 (lambda)>,
34
37
  "dispute"=>
35
- #<Proc:0x007fa7d4194460/lib/balanced/utils.rb:6 (lambda)>,
38
+ #<Proc:0x007fcde1323f50/lib/balanced/utils.rb:6 (lambda)>,
36
39
  "events"=>
37
- #<Proc:0x007fa7d40a65d0/lib/balanced/utils.rb:6 (lambda)>,
40
+ #<Proc:0x007fcde1322100/lib/balanced/utils.rb:6 (lambda)>,
38
41
  "order"=>
39
- #<Proc:0x007fa7d40a5bd0/lib/balanced/utils.rb:6 (lambda)>,
42
+ #<Proc:0x007fcde13216d8/lib/balanced/utils.rb:6 (lambda)>,
40
43
  "refunds"=>
41
- #<Proc:0x007fa7d4043d40/lib/balanced/utils.rb:6 (lambda)>,
44
+ #<Proc:0x007fcde1333810/lib/balanced/utils.rb:6 (lambda)>,
42
45
  "source"=>
43
- #<Proc:0x007fa7d40423c8/lib/balanced/resources/resource.rb:60 (lambda)>}>
46
+ #<Proc:0x007fcde1331e98/lib/balanced/resources/resource.rb:56 (lambda)>}>
44
47
 
45
48
  % endif
@@ -3,9 +3,9 @@ Balanced::Debit.save
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
7
7
 
8
- debit = Balanced::Debit.fetch('/debits/WD4GV5z2pEIRZ9cBSuyuykQx')
8
+ debit = Balanced::Debit.fetch('/debits/WD7AAkAyeN6YTeHJTn1ThPYA')
9
9
  debit.description = 'New description for debit'
10
10
  debit.meta = {
11
11
  'anykey' => 'valuegoeshere',
@@ -14,38 +14,41 @@ debit.meta = {
14
14
  debit.save
15
15
 
16
16
  % elif mode == 'response':
17
- #<Balanced::Debit:0x007fa7d3452d38
17
+ #<Balanced::Debit:0x007fcde1362728
18
18
  @attributes=
19
19
  {"amount"=>5000,
20
20
  "appears_on_statement_as"=>"BAL*Statement text",
21
- "created_at"=>"2014-05-15T00:41:07.283881Z",
21
+ "created_at"=>"2014-12-17T21:25:24.286272Z",
22
22
  "currency"=>"USD",
23
23
  "description"=>"New description for debit",
24
24
  "failure_reason"=>nil,
25
25
  "failure_reason_code"=>nil,
26
- "href"=>"/debits/WD4GV5z2pEIRZ9cBSuyuykQx",
27
- "id"=>"WD4GV5z2pEIRZ9cBSuyuykQx",
26
+ "href"=>"/debits/WD7AAkAyeN6YTeHJTn1ThPYA",
27
+ "id"=>"WD7AAkAyeN6YTeHJTn1ThPYA",
28
28
  "links"=>
29
- {"customer"=>"CU2L981m9AtPY8pjpGpjnjnf",
29
+ {"card_hold"=>"HL7Az4UI0XU8rHAqmNY0Snp6",
30
+ "customer"=>nil,
30
31
  "dispute"=>nil,
31
32
  "order"=>nil,
32
- "source"=>"CC4xXVOyMBDdk7FtzG9HwtBv"},
33
+ "source"=>"CC73IyzxPUu2z89NH8GrJhLn"},
33
34
  "meta"=>{"anykey"=>"valuegoeshere", "facebook.id"=>"1234567890"},
34
35
  "status"=>"succeeded",
35
- "transaction_number"=>"W235-372-7348",
36
- "updated_at"=>"2014-05-15T00:41:44.238176Z"},
36
+ "transaction_number"=>"WDQN-HJW-1YIP",
37
+ "updated_at"=>"2014-12-17T21:25:28.573676Z"},
37
38
  @hyperlinks=
38
- {"customer"=>
39
- #<Proc:0x007fa7d3451078/lib/balanced/resources/resource.rb:60 (lambda)>,
39
+ {"card_hold"=>
40
+ #<Proc:0x007fcde1360bf8/lib/balanced/resources/resource.rb:56 (lambda)>,
41
+ "customer"=>
42
+ #<Proc:0x007fcde1360270/lib/balanced/utils.rb:6 (lambda)>,
40
43
  "dispute"=>
41
- #<Proc:0x007fa7d3450560/lib/balanced/utils.rb:6 (lambda)>,
44
+ #<Proc:0x007fcde136b8a0/lib/balanced/utils.rb:6 (lambda)>,
42
45
  "events"=>
43
- #<Proc:0x007fa7d310a5b8/lib/balanced/utils.rb:6 (lambda)>,
46
+ #<Proc:0x007fcde1369a50/lib/balanced/utils.rb:6 (lambda)>,
44
47
  "order"=>
45
- #<Proc:0x007fa7d3109b68/lib/balanced/utils.rb:6 (lambda)>,
48
+ #<Proc:0x007fcde1369078/lib/balanced/utils.rb:6 (lambda)>,
46
49
  "refunds"=>
47
- #<Proc:0x007fa7d3103c40/lib/balanced/utils.rb:6 (lambda)>,
50
+ #<Proc:0x007fcde137b1d8/lib/balanced/utils.rb:6 (lambda)>,
48
51
  "source"=>
49
- #<Proc:0x007fa7d3102070/lib/balanced/resources/resource.rb:60 (lambda)>}>
52
+ #<Proc:0x007fcde1379860/lib/balanced/resources/resource.rb:56 (lambda)>}>
50
53
 
51
54
  % endif
@@ -2,28 +2,28 @@
2
2
  Balanced::Dispute.all
3
3
  % elif mode == 'request':
4
4
  require 'balanced'
5
- Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
5
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
6
6
 
7
7
  disputes = Balanced::Dispute.all
8
8
  % elif mode == 'response':
9
- [#<Balanced::Dispute:0x007fa7d30e1230
9
+ [#<Balanced::Dispute:0x007fcde190c9f8
10
10
  @attributes=
11
11
  {"amount"=>5000,
12
- "created_at"=>"2014-05-15T00:42:52.610582Z",
12
+ "created_at"=>"2014-12-17T21:25:45.321785Z",
13
13
  "currency"=>"USD",
14
- "href"=>"/disputes/DT6BoisMcacTIu3QWX32JVtl",
15
- "id"=>"DT6BoisMcacTIu3QWX32JVtl",
16
- "initiated_at"=>"2014-05-15T00:42:41.973330Z",
17
- "links"=>{"transaction"=>"WD6mairBakAx5t8ETjMYFu7T"},
14
+ "href"=>"/disputes/DTbbQLxrNf790FmaKsgqRPa",
15
+ "id"=>"DTbbQLxrNf790FmaKsgqRPa",
16
+ "initiated_at"=>"2014-12-17T21:23:52.616968Z",
17
+ "links"=>{"transaction"=>"WD7M75BRYlRsQTImIHFf8O9W"},
18
18
  "meta"=>{},
19
19
  "reason"=>"fraud",
20
- "respond_by"=>"2014-06-14T00:42:41.973334Z",
20
+ "respond_by"=>"2015-01-16T21:23:52.616970Z",
21
21
  "status"=>"pending",
22
- "updated_at"=>"2014-05-15T00:42:52.610592Z"},
22
+ "updated_at"=>"2014-12-17T21:25:45.321787Z"},
23
23
  @hyperlinks=
24
24
  {"events"=>
25
- #<Proc:0x007fa7d30daef8/lib/balanced/utils.rb:6 (lambda)>,
25
+ #<Proc:0x007fcde1916a48/lib/balanced/utils.rb:6 (lambda)>,
26
26
  "transaction"=>
27
- #<Proc:0x007fa7d30d93a0/lib/balanced/resources/resource.rb:60 (lambda)>}>]
27
+ #<Proc:0x007fcde19150a8/lib/balanced/resources/resource.rb:56 (lambda)>}>]
28
28
 
29
29
  % endif
@@ -3,29 +3,29 @@ Balanced::Dispute.fetch
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
7
7
 
8
- dispute = Balanced::Dispute.fetch('/disputes/DT6BoisMcacTIu3QWX32JVtl')
8
+ dispute = Balanced::Dispute.fetch('/disputes/DTbbQLxrNf790FmaKsgqRPa')
9
9
 
10
10
  % elif mode == 'response':
11
- #<Balanced::Dispute:0x007fa7d30c2740
11
+ #<Balanced::Dispute:0x007fcde196f148
12
12
  @attributes=
13
13
  {"amount"=>5000,
14
- "created_at"=>"2014-05-15T00:42:52.610582Z",
14
+ "created_at"=>"2014-12-17T21:25:45.321785Z",
15
15
  "currency"=>"USD",
16
- "href"=>"/disputes/DT6BoisMcacTIu3QWX32JVtl",
17
- "id"=>"DT6BoisMcacTIu3QWX32JVtl",
18
- "initiated_at"=>"2014-05-15T00:42:41.973330Z",
19
- "links"=>{"transaction"=>"WD6mairBakAx5t8ETjMYFu7T"},
16
+ "href"=>"/disputes/DTbbQLxrNf790FmaKsgqRPa",
17
+ "id"=>"DTbbQLxrNf790FmaKsgqRPa",
18
+ "initiated_at"=>"2014-12-17T21:23:52.616968Z",
19
+ "links"=>{"transaction"=>"WD7M75BRYlRsQTImIHFf8O9W"},
20
20
  "meta"=>{},
21
21
  "reason"=>"fraud",
22
- "respond_by"=>"2014-06-14T00:42:41.973334Z",
22
+ "respond_by"=>"2015-01-16T21:23:52.616970Z",
23
23
  "status"=>"pending",
24
- "updated_at"=>"2014-05-15T00:42:52.610592Z"},
24
+ "updated_at"=>"2014-12-17T21:25:45.321787Z"},
25
25
  @hyperlinks=
26
26
  {"events"=>
27
- #<Proc:0x007fa7d30c0558/lib/balanced/utils.rb:6 (lambda)>,
27
+ #<Proc:0x007fcde196d1e0/lib/balanced/utils.rb:6 (lambda)>,
28
28
  "transaction"=>
29
- #<Proc:0x007fa7d30be898/lib/balanced/resources/resource.rb:60 (lambda)>}>
29
+ #<Proc:0x007fcde196ed88/lib/balanced/resources/resource.rb:56 (lambda)>}>
30
30
 
31
31
  % endif
@@ -3,105 +3,79 @@ Balanced::Event.all
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
7
7
 
8
8
  events = Balanced::Event.all
9
9
  % elif mode == 'response':
10
- [#<Balanced::Event:0x007fa7d31b0cd8
10
+ [#<Balanced::Event:0x007fcde12d3230
11
11
  @attributes=
12
12
  {"callback_statuses"=>
13
- {"failed"=>0, "pending"=>0, "retrying"=>0, "succeeded"=>0},
13
+ {"failed"=>0, "pending"=>1, "retrying"=>0, "succeeded"=>0},
14
14
  "entity"=>
15
- {"customers"=>
16
- [{"address"=>
17
- {"city"=>"Nowhere",
18
- "country_code"=>"USA",
19
- "line1"=>nil,
20
- "line2"=>nil,
21
- "postal_code"=>"90210",
22
- "state"=>nil},
23
- "business_name"=>nil,
24
- "created_at"=>"2014-05-15T00:38:03.617262Z",
25
- "dob_month"=>2,
26
- "dob_year"=>1947,
27
- "ein"=>nil,
28
- "email"=>"whc@example.org",
29
- "href"=>"/customers/CU1mlBGw9Cybp1cbj3Lltvcp",
30
- "id"=>"CU1mlBGw9Cybp1cbj3Lltvcp",
31
- "links"=>{"destination"=>nil, "source"=>nil},
32
- "merchant_status"=>"underwritten",
15
+ {"debits"=>
16
+ [{"amount"=>5000,
17
+ "appears_on_statement_as"=>"BAL*Statement text",
18
+ "created_at"=>"2014-12-17T21:25:34.550152Z",
19
+ "currency"=>"USD",
20
+ "description"=>"Some descriptive text for the debit in the dashboard",
21
+ "failure_reason"=>nil,
22
+ "failure_reason_code"=>nil,
23
+ "href"=>"/debits/WD7M75BRYlRsQTImIHFf8O9W",
24
+ "id"=>"WD7M75BRYlRsQTImIHFf8O9W",
25
+ "links"=>
26
+ {"card_hold"=>"HL7M4ZNQjlJRZhhMJGPBVCUM",
27
+ "customer"=>nil,
28
+ "dispute"=>"DTbbQLxrNf790FmaKsgqRPa",
29
+ "order"=>nil,
30
+ "source"=>"CC7Lwi6mzKkqwXrIg5UY1BE9"},
33
31
  "meta"=>{},
34
- "name"=>"William Henry Cavendish III",
35
- "phone"=>"+16505551212",
36
- "ssn_last4"=>"xxxx",
37
- "updated_at"=>"2014-05-15T00:38:03.766910Z"}],
32
+ "status"=>"succeeded",
33
+ "transaction_number"=>"WMWY-ZDJ-0RIZ",
34
+ "updated_at"=>"2014-12-17T21:25:35.221519Z"}],
38
35
  "links"=>
39
- {"customers.bank_accounts"=>"/customers/{customers.id}/bank_accounts",
40
- "customers.card_holds"=>"/customers/{customers.id}/card_holds",
41
- "customers.cards"=>"/customers/{customers.id}/cards",
42
- "customers.credits"=>"/customers/{customers.id}/credits",
43
- "customers.debits"=>"/customers/{customers.id}/debits",
44
- "customers.destination"=>"/resources/{customers.destination}",
45
- "customers.disputes"=>"/customers/{customers.id}/disputes",
46
- "customers.external_accounts"=>
47
- "/customers/{customers.id}/external_accounts",
48
- "customers.orders"=>"/customers/{customers.id}/orders",
49
- "customers.refunds"=>"/customers/{customers.id}/refunds",
50
- "customers.reversals"=>"/customers/{customers.id}/reversals",
51
- "customers.source"=>"/resources/{customers.source}",
52
- "customers.transactions"=>"/customers/{customers.id}/transactions"}},
53
- "href"=>"/events/EV2cc035eedbc911e38d4f061e5f402045",
54
- "id"=>"EV2cc035eedbc911e38d4f061e5f402045",
36
+ {"debits.card_hold"=>"/holds/{debits.card_hold}",
37
+ "debits.customer"=>"/customers/{debits.customer}",
38
+ "debits.dispute"=>"/disputes/{debits.dispute}",
39
+ "debits.events"=>"/debits/{debits.id}/events",
40
+ "debits.order"=>"/orders/{debits.order}",
41
+ "debits.refunds"=>"/debits/{debits.id}/refunds",
42
+ "debits.source"=>"/resources/{debits.source}"}},
43
+ "href"=>"/events/EV061a4b86863311e4ab84020fe4ae3568",
44
+ "id"=>"EV061a4b86863311e4ab84020fe4ae3568",
55
45
  "links"=>{},
56
- "occurred_at"=>"2014-05-15T00:38:03.766000Z",
57
- "type"=>"account.created"},
46
+ "occurred_at"=>"2014-12-17T21:25:35.221519Z",
47
+ "type"=>"debit.succeeded"},
58
48
  @hyperlinks=
59
49
  {"callbacks"=>
60
- #<Proc:0x007fa7d31ab968/lib/balanced/utils.rb:6 (lambda)>}>,
61
- #<Balanced::Event:0x007fa7d31ab918
50
+ #<Proc:0x007fcde12d1ed0/lib/balanced/utils.rb:6 (lambda)>}>,
51
+ #<Balanced::Event:0x007fcde12d1e80
62
52
  @attributes=
63
53
  {"callback_statuses"=>
64
- {"failed"=>0, "pending"=>0, "retrying"=>0, "succeeded"=>0},
54
+ {"failed"=>0, "pending"=>1, "retrying"=>0, "succeeded"=>0},
65
55
  "entity"=>
66
- {"bank_accounts"=>
67
- [{"account_number"=>"xxxxxxxxxxx5555",
68
- "account_type"=>"checking",
69
- "address"=>
70
- {"city"=>nil,
71
- "country_code"=>nil,
72
- "line1"=>nil,
73
- "line2"=>nil,
74
- "postal_code"=>nil,
75
- "state"=>nil},
76
- "bank_name"=>"WELLS FARGO BANK NA",
77
- "can_credit"=>true,
78
- "can_debit"=>true,
79
- "created_at"=>"2014-05-15T00:38:04.313775Z",
80
- "fingerprint"=>"6ybvaLUrJy07phK2EQ7pVk",
81
- "href"=>"/bank_accounts/BA1mL1iIV0OiaTD4IHw51jkp",
82
- "id"=>"BA1mL1iIV0OiaTD4IHw51jkp",
83
- "links"=>
84
- {"bank_account_verification"=>nil,
85
- "customer"=>"CU1mlBGw9Cybp1cbj3Lltvcp"},
56
+ {"disputes"=>
57
+ [{"amount"=>5000,
58
+ "created_at"=>"2014-12-17T21:25:45.321785Z",
59
+ "currency"=>"USD",
60
+ "href"=>"/disputes/DTbbQLxrNf790FmaKsgqRPa",
61
+ "id"=>"DTbbQLxrNf790FmaKsgqRPa",
62
+ "initiated_at"=>"2014-12-17T21:23:52.616968Z",
63
+ "links"=>{"transaction"=>"WD7M75BRYlRsQTImIHFf8O9W"},
86
64
  "meta"=>{},
87
- "name"=>"TEST-MERCHANT-BANK-ACCOUNT",
88
- "routing_number"=>"121042882",
89
- "updated_at"=>"2014-05-15T00:38:04.313777Z"}],
65
+ "reason"=>"fraud",
66
+ "respond_by"=>"2015-01-16T21:23:52.616970Z",
67
+ "status"=>"pending",
68
+ "updated_at"=>"2014-12-17T21:25:45.321787Z"}],
90
69
  "links"=>
91
- {"bank_accounts.bank_account_verification"=>
92
- "/verifications/{bank_accounts.bank_account_verification}",
93
- "bank_accounts.bank_account_verifications"=>
94
- "/bank_accounts/{bank_accounts.id}/verifications",
95
- "bank_accounts.credits"=>"/bank_accounts/{bank_accounts.id}/credits",
96
- "bank_accounts.customer"=>"/customers/{bank_accounts.customer}",
97
- "bank_accounts.debits"=>"/bank_accounts/{bank_accounts.id}/debits"}},
98
- "href"=>"/events/EV2d2b4e42dbc911e38d4f061e5f402045",
99
- "id"=>"EV2d2b4e42dbc911e38d4f061e5f402045",
70
+ {"disputes.events"=>"/disputes/{disputes.id}/events",
71
+ "disputes.transaction"=>"/resources/{disputes.transaction}"}},
72
+ "href"=>"/events/EV05ef6aec863311e4a61d020fe4ae3568",
73
+ "id"=>"EV05ef6aec863311e4a61d020fe4ae3568",
100
74
  "links"=>{},
101
- "occurred_at"=>"2014-05-15T00:38:04.313000Z",
102
- "type"=>"bank_account.created"},
75
+ "occurred_at"=>"2014-12-17T21:25:45.321787Z",
76
+ "type"=>"dispute.created"},
103
77
  @hyperlinks=
104
78
  {"callbacks"=>
105
- #<Proc:0x007fa7d31aa608/lib/balanced/utils.rb:6 (lambda)>}>]
79
+ #<Proc:0x007fcde12d0bc0/lib/balanced/utils.rb:6 (lambda)>}>]
106
80
 
107
81
  % endif
@@ -3,61 +3,51 @@ Balanced::Event.fetch
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2q80HU8DISm2atgm0iRKRVIePzDb34qYp')
6
+ Balanced.configure('ak-test-YoVGJWMjOpkCPo6dWMfuiYbBYIB8q2JX')
7
7
 
8
- event = Balanced::Event.fetch('/events/EV2cc035eedbc911e38d4f061e5f402045')
8
+ event = Balanced::Event.fetch('/events/EV061a4b86863311e4ab84020fe4ae3568')
9
9
 
10
10
  % elif mode == 'response':
11
- #<Balanced::Event:0x007fa7d3155a68
11
+ #<Balanced::Event:0x007fcde135ac30
12
12
  @attributes=
13
13
  {"callback_statuses"=>
14
- {"failed"=>0, "pending"=>0, "retrying"=>0, "succeeded"=>0},
14
+ {"failed"=>0, "pending"=>1, "retrying"=>0, "succeeded"=>0},
15
15
  "entity"=>
16
- {"customers"=>
17
- [{"address"=>
18
- {"city"=>"Nowhere",
19
- "country_code"=>"USA",
20
- "line1"=>nil,
21
- "line2"=>nil,
22
- "postal_code"=>"90210",
23
- "state"=>nil},
24
- "business_name"=>nil,
25
- "created_at"=>"2014-05-15T00:38:03.617262Z",
26
- "dob_month"=>2,
27
- "dob_year"=>1947,
28
- "ein"=>nil,
29
- "email"=>"whc@example.org",
30
- "href"=>"/customers/CU1mlBGw9Cybp1cbj3Lltvcp",
31
- "id"=>"CU1mlBGw9Cybp1cbj3Lltvcp",
32
- "links"=>{"destination"=>nil, "source"=>nil},
33
- "merchant_status"=>"underwritten",
16
+ {"debits"=>
17
+ [{"amount"=>5000,
18
+ "appears_on_statement_as"=>"BAL*Statement text",
19
+ "created_at"=>"2014-12-17T21:25:34.550152Z",
20
+ "currency"=>"USD",
21
+ "description"=>"Some descriptive text for the debit in the dashboard",
22
+ "failure_reason"=>nil,
23
+ "failure_reason_code"=>nil,
24
+ "href"=>"/debits/WD7M75BRYlRsQTImIHFf8O9W",
25
+ "id"=>"WD7M75BRYlRsQTImIHFf8O9W",
26
+ "links"=>
27
+ {"card_hold"=>"HL7M4ZNQjlJRZhhMJGPBVCUM",
28
+ "customer"=>nil,
29
+ "dispute"=>"DTbbQLxrNf790FmaKsgqRPa",
30
+ "order"=>nil,
31
+ "source"=>"CC7Lwi6mzKkqwXrIg5UY1BE9"},
34
32
  "meta"=>{},
35
- "name"=>"William Henry Cavendish III",
36
- "phone"=>"+16505551212",
37
- "ssn_last4"=>"xxxx",
38
- "updated_at"=>"2014-05-15T00:38:03.766910Z"}],
33
+ "status"=>"succeeded",
34
+ "transaction_number"=>"WMWY-ZDJ-0RIZ",
35
+ "updated_at"=>"2014-12-17T21:25:35.221519Z"}],
39
36
  "links"=>
40
- {"customers.bank_accounts"=>"/customers/{customers.id}/bank_accounts",
41
- "customers.card_holds"=>"/customers/{customers.id}/card_holds",
42
- "customers.cards"=>"/customers/{customers.id}/cards",
43
- "customers.credits"=>"/customers/{customers.id}/credits",
44
- "customers.debits"=>"/customers/{customers.id}/debits",
45
- "customers.destination"=>"/resources/{customers.destination}",
46
- "customers.disputes"=>"/customers/{customers.id}/disputes",
47
- "customers.external_accounts"=>
48
- "/customers/{customers.id}/external_accounts",
49
- "customers.orders"=>"/customers/{customers.id}/orders",
50
- "customers.refunds"=>"/customers/{customers.id}/refunds",
51
- "customers.reversals"=>"/customers/{customers.id}/reversals",
52
- "customers.source"=>"/resources/{customers.source}",
53
- "customers.transactions"=>"/customers/{customers.id}/transactions"}},
54
- "href"=>"/events/EV2cc035eedbc911e38d4f061e5f402045",
55
- "id"=>"EV2cc035eedbc911e38d4f061e5f402045",
37
+ {"debits.card_hold"=>"/holds/{debits.card_hold}",
38
+ "debits.customer"=>"/customers/{debits.customer}",
39
+ "debits.dispute"=>"/disputes/{debits.dispute}",
40
+ "debits.events"=>"/debits/{debits.id}/events",
41
+ "debits.order"=>"/orders/{debits.order}",
42
+ "debits.refunds"=>"/debits/{debits.id}/refunds",
43
+ "debits.source"=>"/resources/{debits.source}"}},
44
+ "href"=>"/events/EV061a4b86863311e4ab84020fe4ae3568",
45
+ "id"=>"EV061a4b86863311e4ab84020fe4ae3568",
56
46
  "links"=>{},
57
- "occurred_at"=>"2014-05-15T00:38:03.766000Z",
58
- "type"=>"account.created"},
47
+ "occurred_at"=>"2014-12-17T21:25:35.221519Z",
48
+ "type"=>"debit.succeeded"},
59
49
  @hyperlinks=
60
50
  {"callbacks"=>
61
- #<Proc:0x007fa7d31546b8/lib/balanced/utils.rb:6 (lambda)>}>
51
+ #<Proc:0x007fcde1359948/lib/balanced/utils.rb:6 (lambda)>}>
62
52
 
63
53
  % endif