balanced 0.7.5 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -1
  3. data/.rbenv-version +1 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile +1 -0
  6. data/balanced.gemspec +2 -2
  7. data/examples/bank_account_debits.rb +2 -1
  8. data/examples/customers.rb +8 -4
  9. data/examples/events_and_callbacks.rb +2 -1
  10. data/examples/examples.rb +6 -5
  11. data/examples/exception_handling.rb +2 -1
  12. data/lib/balanced/client.rb +3 -3
  13. data/lib/balanced/resources/account.rb +5 -3
  14. data/lib/balanced/resources/card.rb +3 -1
  15. data/lib/balanced/resources/credit.rb +12 -13
  16. data/lib/balanced/resources/customer.rb +1 -1
  17. data/lib/balanced/resources/debit.rb +1 -1
  18. data/lib/balanced/resources/resource.rb +83 -93
  19. data/lib/balanced/utils.rb +13 -4
  20. data/lib/balanced/version.rb +1 -1
  21. data/scenario.cache +299 -380
  22. data/scenarios/account_add_card/ruby.mako +3 -3
  23. data/scenarios/account_capture_hold/request.rb +1 -1
  24. data/scenarios/account_capture_hold/ruby.mako +1 -1
  25. data/scenarios/account_create/ruby.mako +1 -1
  26. data/scenarios/account_create_buyer/ruby.mako +2 -2
  27. data/scenarios/account_create_debit/request.rb +1 -1
  28. data/scenarios/account_create_debit/ruby.mako +1 -1
  29. data/scenarios/account_create_hold/request.rb +1 -1
  30. data/scenarios/account_create_hold/ruby.mako +1 -1
  31. data/scenarios/account_create_merchant/ruby.mako +3 -3
  32. data/scenarios/account_underwrite_business/ruby.mako +1 -1
  33. data/scenarios/account_underwrite_person/request.rb +1 -1
  34. data/scenarios/account_underwrite_person/ruby.mako +7 -7
  35. data/scenarios/bank_account_create/request.rb +1 -1
  36. data/scenarios/bank_account_create/ruby.mako +5 -5
  37. data/scenarios/bank_account_delete/ruby.mako +2 -2
  38. data/scenarios/bank_account_invalid_routing_number/ruby.mako +2 -8
  39. data/scenarios/bank_account_list/ruby.mako +1 -1
  40. data/scenarios/bank_account_show/ruby.mako +2 -2
  41. data/scenarios/bank_account_verification_create/ruby.mako +2 -2
  42. data/scenarios/bank_account_verification_show/ruby.mako +2 -2
  43. data/scenarios/bank_account_verification_update/ruby.mako +2 -2
  44. data/scenarios/callback_create/definition.rb +1 -1
  45. data/scenarios/callback_create/request.rb +1 -1
  46. data/scenarios/callback_create/ruby.mako +0 -11
  47. data/scenarios/callback_delete/definition.rb +1 -1
  48. data/scenarios/callback_delete/request.rb +1 -1
  49. data/scenarios/callback_delete/ruby.mako +0 -10
  50. data/scenarios/callback_list/definition.rb +1 -1
  51. data/scenarios/callback_list/ruby.mako +0 -10
  52. data/scenarios/callback_show/definition.rb +1 -1
  53. data/scenarios/callback_show/ruby.mako +0 -9
  54. data/scenarios/card_create/request.rb +2 -1
  55. data/scenarios/card_create/ruby.mako +6 -5
  56. data/scenarios/card_delete/ruby.mako +2 -2
  57. data/scenarios/card_invalidate/ruby.mako +2 -2
  58. data/scenarios/card_list/ruby.mako +1 -1
  59. data/scenarios/card_show/ruby.mako +2 -2
  60. data/scenarios/card_update/ruby.mako +2 -2
  61. data/scenarios/credit_bank_account_list/ruby.mako +2 -2
  62. data/scenarios/credit_create_existing_bank_account/ruby.mako +3 -3
  63. data/scenarios/credit_customer_list/ruby.mako +2 -2
  64. data/scenarios/credit_failed_state/request.rb +2 -2
  65. data/scenarios/credit_failed_state/ruby.mako +2 -5
  66. data/scenarios/credit_list/ruby.mako +1 -1
  67. data/scenarios/credit_paid_state/request.rb +2 -2
  68. data/scenarios/credit_paid_state/ruby.mako +2 -5
  69. data/scenarios/credit_pending_state/request.rb +2 -2
  70. data/scenarios/credit_pending_state/ruby.mako +2 -5
  71. data/scenarios/credit_show/ruby.mako +2 -2
  72. data/scenarios/customer_add_bank_account/ruby.mako +3 -3
  73. data/scenarios/customer_add_card/ruby.mako +3 -3
  74. data/scenarios/customer_capture_hold/request.rb +1 -1
  75. data/scenarios/customer_create/ruby.mako +1 -1
  76. data/scenarios/customer_create_debit/request.rb +1 -1
  77. data/scenarios/customer_create_debit/ruby.mako +3 -3
  78. data/scenarios/customer_create_hold/request.rb +1 -1
  79. data/scenarios/customer_create_hold/ruby.mako +1 -1
  80. data/scenarios/customer_credit/request.rb +1 -1
  81. data/scenarios/customer_credit/ruby.mako +2 -2
  82. data/scenarios/customer_delete/ruby.mako +1 -1
  83. data/scenarios/debit_create/ruby.mako +3 -3
  84. data/scenarios/debit_customer_list/ruby.mako +2 -2
  85. data/scenarios/debit_list/ruby.mako +1 -1
  86. data/scenarios/debit_refund/ruby.mako +2 -2
  87. data/scenarios/debit_show/ruby.mako +2 -2
  88. data/scenarios/debit_update/ruby.mako +2 -2
  89. data/scenarios/event_list/ruby.mako +1 -1
  90. data/scenarios/event_show/ruby.mako +2 -2
  91. data/scenarios/helpers.rb +1 -5
  92. data/scenarios/hold_capture/ruby.mako +4 -3
  93. data/scenarios/hold_create/request.rb +2 -2
  94. data/scenarios/hold_create/ruby.mako +6 -6
  95. data/scenarios/hold_customer_list/ruby.mako +2 -2
  96. data/scenarios/hold_list/ruby.mako +1 -1
  97. data/scenarios/hold_show/ruby.mako +2 -2
  98. data/scenarios/hold_update/ruby.mako +2 -2
  99. data/scenarios/hold_void/ruby.mako +2 -2
  100. data/scenarios/refund_create/ruby.mako +2 -2
  101. data/scenarios/refund_customer_list/ruby.mako +2 -2
  102. data/scenarios/refund_list/ruby.mako +1 -1
  103. data/scenarios/refund_show/ruby.mako +2 -2
  104. data/scenarios/refund_update/ruby.mako +2 -2
  105. data/scenarios/render.rb +1 -1
  106. data/scenarios/render_mako.rb +0 -1
  107. data/spec/balanced/error_spec.rb +4 -4
  108. data/spec/balanced/pager_spec.rb +7 -7
  109. data/spec/balanced/resources/account_spec.rb +51 -30
  110. data/spec/balanced/resources/bank_account_spec.rb +2 -2
  111. data/spec/balanced/resources/card_spec.rb +8 -8
  112. data/spec/balanced/resources/customer_spec.rb +11 -11
  113. data/spec/balanced/resources/hold_spec.rb +1 -1
  114. data/spec/balanced/resources/marketplace_spec.rb +12 -10
  115. data/spec/balanced/resources/resource_spec.rb +1 -1
  116. data/spec/scenarios_spec.rb +1 -1
  117. data/spec/spec_helper.rb +1 -1
  118. metadata +16 -15
  119. data/examples/customers-with-meta-example.rb +0 -141
@@ -3,10 +3,10 @@ Balanced::BankAccount.credit
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
  marketplace = Balanced::Marketplace.my_marketplace
9
9
 
10
- bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5A8YcoSCEPQyCaPCTvmFnW')
11
- bank_account.credit(:amount => 10000)
10
+ bank_account = Balanced::BankAccount.find('/v1/bank_accounts/BA5S3reJdyJBbAYKepbneBe2')
11
+ bank_account.credit(:amount => '10000')
12
12
  % endif
@@ -3,10 +3,10 @@ Balanced::Customer.credits
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
 
9
- customer = Balanced::Customer.find('/v1/customers/CU5f64LhFMO8cf7N1sQSRVOo')
9
+ customer = Balanced::Customer.find('')
10
10
  credits = customer.credits
11
11
 
12
12
  % endif
@@ -2,9 +2,9 @@
2
2
  marketplace = Balanced::Marketplace.my_marketplace
3
3
 
4
4
  bank_account_info = {
5
- <%= params_to_hash.call(request['payload']['bank_account']).indent(2) %>
5
+ <%= params_to_hash.call(request['bank_account']).indent(2) %>
6
6
  }
7
7
  credit = Balanced::Credit.new(
8
- :amount => <%= request['payload']['amount'] %>,
8
+ :amount => <%= request['amount'] %>,
9
9
  :bank_account => bank_account_info
10
10
  ).save
@@ -3,15 +3,12 @@ Balanced::Credit.save
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-1p1Tsac7gHeMQowL2seB7ieliuAJAufyq')
6
+ Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
7
7
 
8
8
  marketplace = Balanced::Marketplace.my_marketplace
9
9
 
10
10
  bank_account_info = {
11
- :account_number => '9900000005',
12
- :name => 'Johann Bernoulli',
13
- :routing_number => '121000358',
14
- :type => 'checking'
11
+ :account_number => '9900000004',:name => 'Johann Bernoulli',:routing_number => '121000358',:type => 'checking',
15
12
  }
16
13
  credit = Balanced::Credit.new(
17
14
  :amount => 10000,
@@ -3,7 +3,7 @@ Balanced::Credit.all
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
  marketplace = Balanced::Marketplace.my_marketplace
9
9
 
@@ -2,10 +2,10 @@
2
2
  marketplace = Balanced::Marketplace.my_marketplace
3
3
 
4
4
  bank_account_info = {
5
- <%= params_to_hash.call(request['payload']['bank_account']).indent(2) %>
5
+ <%= params_to_hash.call(request['bank_account']).indent(2) %>
6
6
  }
7
7
 
8
8
  credit = Balanced::Credit.new(
9
- :amount => <%= request['payload']['amount'] %>,
9
+ :amount => <%= request['amount'] %>,
10
10
  :bank_account => bank_account_info
11
11
  ).save
@@ -3,15 +3,12 @@ Balanced::Credit.save
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-1p1Tsac7gHeMQowL2seB7ieliuAJAufyq')
6
+ Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
7
7
 
8
8
  marketplace = Balanced::Marketplace.my_marketplace
9
9
 
10
10
  bank_account_info = {
11
- :account_number => '9900000002',
12
- :name => 'Johann Bernoulli',
13
- :routing_number => '121000358',
14
- :type => 'checking'
11
+ :account_number => '9900000003',:name => 'Johann Bernoulli',:routing_number => '121000358',:type => 'checking',
15
12
  }
16
13
 
17
14
  credit = Balanced::Credit.new(
@@ -1,9 +1,9 @@
1
1
  <%= boiler_plate %>
2
2
  bank_account_info = {
3
- <%= params_to_hash.call(request['payload']['bank_account']).indent(2) %>
3
+ <%= params_to_hash.call(request['bank_account']).indent(2) %>
4
4
  }
5
5
 
6
6
  credit = Balanced::Credit.new(
7
- :amount => <%= request['payload']['amount'] %>,
7
+ :amount => <%= request['amount'] %>,
8
8
  :bank_account => bank_account_info
9
9
  ).save
@@ -3,13 +3,10 @@ Balanced::Credit.save
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-1p1Tsac7gHeMQowL2seB7ieliuAJAufyq')
6
+ Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
7
7
 
8
8
  bank_account_info = {
9
- :account_number => '9900000001',
10
- :name => 'Johann Bernoulli',
11
- :routing_number => '121000358',
12
- :type => 'checking'
9
+ :account_number => '9900000001',:name => 'Johann Bernoulli',:routing_number => '121000358',:type => 'checking',
13
10
  }
14
11
 
15
12
  credit = Balanced::Credit.new(
@@ -3,9 +3,9 @@ Balanced::Credit.find
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
  marketplace = Balanced::Marketplace.my_marketplace
9
9
 
10
- credit = Balanced::Credit.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/credits/CR5YK26rTyl5vlFK928nhxUI')
10
+ credit = Balanced::Credit.find('/v1/credits/CR6lEmXFHCW9aNOoLQk9XjfG')
11
11
  % endif
@@ -3,9 +3,9 @@ Balanced::Customer.add_bank_account
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- customer = Balanced::Customer.find('/v1/customers/CU6n0viWQoT86ttbkCsPgV0Y')
9
- customer.add_bank_account("/v1/bank_accounts/BA6oxYWJXxeM63vMorgtSIhI")
8
+ customer = Balanced::Customer.find('/v1/customers/AC6TepGAIZ5HUdhfTZKOoUhh')
9
+ customer.add_bank_account("/v1/bank_accounts/BA6V90Tau7B5YTGPFjC0PlzA")
10
10
 
11
11
  % endif
@@ -3,9 +3,9 @@ Balanced::Customer.add_card
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- customer = Balanced::Customer.find('/v1/customers/CU7gMTGKh2yGHYn1lUxH9STS')
9
- response = customer.add_card('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC7iFRCb5AvLuZ9qzIF0VMmA')
8
+ customer = Balanced::Customer.find('/v1/customers/ACO702cHD2tPiOCRSKYzVf1')
9
+ response = customer.add_card('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/cards/CCQv8XnGsBHF9afrEdc0um3')
10
10
 
11
11
  % endif
@@ -1,3 +1,3 @@
1
1
  <%= boiler_plate %>
2
2
  customer = Balanced::Customer.find('<%=request['uri']%>')
3
- customer.debit(:amount => <%=payload['amount']%>, :hold_uri => '<%=payload['hold_uri']%>')
3
+ customer.debit(:amount => '<%=payload['amount']%>', :hold_uri => '<%=payload['hold_uri']%>')
@@ -3,7 +3,7 @@ Balanced::Customer.new
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
  customer = Balanced::Customer.new.save
9
9
 
@@ -1,3 +1,3 @@
1
1
  <%= boiler_plate %>
2
2
  customer = Balanced::Customer.find('<%=request['customer_uri']%>')
3
- customer.debit(:amount => <%=payload['amount']%>)
3
+ customer.debit(:amount => '<%=payload['amount']%>')
@@ -3,9 +3,9 @@ Balanced::Customer.debit
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- customer = Balanced::Customer.find('/v1/customers/CU6vs1tjxBtifgTuzKjCGtVS')
9
- customer.debit(:amount => 5000)
8
+ customer = Balanced::Customer.find('/v1/customers/AC73sGhakFEQQFbLDX6WSq9y')
9
+ customer.debit(:amount => '5000')
10
10
 
11
11
  % endif
@@ -1,3 +1,3 @@
1
1
  <%= boiler_plate %>
2
2
  customer = Balanced::Customer.find('<%=request['customer_uri']%>')
3
- customer.hold(:amount => <%=payload['amount']%>)
3
+ customer.hold(:amount => '<%=payload['amount']%>')
@@ -6,6 +6,6 @@ require 'balanced'
6
6
  Balanced.configure('c72cb360d3ae11e29593026ba7d31e6f')
7
7
 
8
8
  customer = Balanced::Customer.find('/v1/customers/CU7GuPv9Y2F8ySwJHuHL0YWq')
9
- customer.hold(:amount => 1000)
9
+ customer.hold(:amount => '1000')
10
10
 
11
11
  % endif
@@ -1,2 +1,2 @@
1
1
  customer = Balanced::Customer.find('<%=request['customer_uri']%>')
2
- customer.credit(:amount => <%=payload['amount']%>)
2
+ customer.credit(:amount => '<%=payload['amount']%>')
@@ -2,7 +2,7 @@
2
2
  Balanced::Customer.credit
3
3
 
4
4
  % else:
5
- customer = Balanced::Customer.find('/v1/customers/CU5f64LhFMO8cf7N1sQSRVOo')
6
- customer.credit(:amount => 100)
5
+ customer = Balanced::Customer.find('/v1/customers/AC6xddA9naLGxrOBkAig9b4a')
6
+ customer.credit(:amount => '100')
7
7
 
8
8
  % endif
@@ -2,7 +2,7 @@
2
2
  Balanced::Customer.unstore
3
3
 
4
4
  % else:
5
- customer = Balanced::Customer.find('/v1/customers/CU6sqf8CB3M3l6VeSsBqVHhC')
5
+ customer = Balanced::Customer.find('/v1/customers/AC6YytlZWy1ECh6PGUXxqeFy')
6
6
  customer.unstore
7
7
 
8
8
  % endif
@@ -3,11 +3,11 @@ Balanced::Customer.debit()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- customer = Balanced::Customer.find('/v1/customers/CU7gMTGKh2yGHYn1lUxH9STS')
8
+ customer = Balanced::Customer.find('/v1/customers/ACO702cHD2tPiOCRSKYzVf1')
9
9
  customer.debit(
10
- :amount => 5000,
10
+ :amount => '5000',
11
11
  :appears_on_statement_as => 'Statement text',
12
12
  :description => 'Some descriptive text for the debit in the dashboard'
13
13
  )
@@ -3,10 +3,10 @@ Balanced::Customer.debits
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
 
9
- customer = Balanced::Customer.find('/v1/customers/CU6vs1tjxBtifgTuzKjCGtVS')
9
+ customer = Balanced::Customer.find('/v1/customers/AC73sGhakFEQQFbLDX6WSq9y')
10
10
  debits = customer.debits
11
11
 
12
12
  % endif
@@ -3,7 +3,7 @@ Balanced::Debit.all
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
  marketplace = Balanced::Marketplace.my_marketplace
9
9
 
@@ -3,8 +3,8 @@ Balanced::Debit.refund()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- debit = Balanced::Debit.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/debits/WD6MTAHor9FhO4G2nvZwaXvi')
8
+ debit = Balanced::Debit.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/debits/WD7HfOnPU0KhbO9WUEGw0qJq')
9
9
  debit.refund
10
10
  % endif
@@ -3,8 +3,8 @@ Balanced::Debit.find()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- debit = Balanced::Debit.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/debits/WD6Ca1z3nrRRCdiYT1evN19S')
8
+ debit = Balanced::Debit.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/debits/WD7vMDuOPWwViP0L8mniBOJF')
9
9
 
10
10
  % endif
@@ -3,9 +3,9 @@ Balanced::Debit.save()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- debit = Balanced::Debit.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/debits/WD6Ca1z3nrRRCdiYT1evN19S')
8
+ debit = Balanced::Debit.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/debits/WD7vMDuOPWwViP0L8mniBOJF')
9
9
  debit.description = 'New description for debit'
10
10
  debit.meta = {
11
11
  'anykey' => 'valuegoeshere',
@@ -3,7 +3,7 @@
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
  marketplace = Balanced::Marketplace.my_marketplace
9
9
  events = Balanced::Event.all(:limit => 2)
@@ -3,8 +3,8 @@
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- event = Balanced::Event.find('/v1/events/EV9be5771e4d4811e38afd026ba7d31e6f')
8
+ event = Balanced::Event.find('/v1/events/EV8c8e419e0e9e11e39281026ba7d31e6f')
9
9
 
10
10
  % endif
data/scenarios/helpers.rb CHANGED
@@ -7,11 +7,7 @@ params_to_hash = lambda { |params|
7
7
  s << "#{params_to_hash.call(v)}".indent(2)
8
8
  s << "\n}"
9
9
  else
10
- if v.is_a? String
11
- s << ":#{k} => '#{v}'"
12
- else
13
- s << ":#{k} => #{v}"
14
- end
10
+ s << ":#{k} => '#{v}'"
15
11
  end
16
12
  if i != params.length - 1
17
13
  s << ",\n"
@@ -3,12 +3,13 @@ Balanced::Hold.capture(...)
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- hold = Balanced::Hold.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/holds/HL74dRg2HWc5vQwX0kQ9XQfM')
8
+ hold = Balanced::Hold.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/holds/HLKvFGAzFm4LqiLblBvyCzm')
9
9
  debit = hold.capture(
10
10
  :appears_on_statement_as => 'ShowsUpOnStmt',
11
- :description => 'Some descriptive text for the debit in the dashboard'
11
+ :description => 'Some descriptive text for the debit in the dashboard',
12
+ :hold_uri => '/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/holds/HLKvFGAzFm4LqiLblBvyCzm'
12
13
  )
13
14
 
14
15
  % endif
@@ -1,5 +1,5 @@
1
1
  <%= boiler_plate %>
2
- hold = Balanced::Hold.new(
2
+ customer = Balanced::Customer.find('<%= request['customer_uri'] %>')
3
+ customer.hold(
3
4
  <%= params_to_hash.call(payload).indent(2) %>
4
5
  )
5
- hold.save
@@ -3,12 +3,12 @@ Balanced::Customer.hold(...)
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- hold = Balanced::Hold.new(
9
- :amount => 5000,
10
- :description => 'Some descriptive text for the debit in the dashboard',
11
- :source_uri => '/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/cards/CC7iFRCb5AvLuZ9qzIF0VMmA'
8
+ customer = Balanced::Customer.find('/v1/customers/ACO702cHD2tPiOCRSKYzVf1')
9
+ customer.hold(
10
+ :amount => '5000',
11
+ :description => 'Some descriptive text for the debit in the dashboard'
12
12
  )
13
- hold.save
13
+
14
14
  % endif
@@ -3,9 +3,9 @@ Balanced::Customer.holds
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- customer = Balanced::Customer.find('/v1/customers/CU6ZO6HM8Hf8NMQRMm3ZlCAe')
8
+ customer = Balanced::Customer.find('/v1/customers/AC8REMQqvuj8Kz8Yc3tpOPg')
9
9
  holds = customer.holds
10
10
 
11
11
  % endif
@@ -3,7 +3,7 @@ Balanced::Hold.all
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
8
  marketplace = Balanced::Marketplace.my_marketplace
9
9
 
@@ -3,8 +3,8 @@ Balanced::Hold.find()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- hold = Balanced::Hold.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/holds/HL74dRg2HWc5vQwX0kQ9XQfM')
8
+ hold = Balanced::Hold.find('/v1/marketplaces/TEST-MP4h8BxozeLxe7VAllP6b5gj/holds/HLoRDe8mOJ3arKOC95Yd0k0')
9
9
 
10
10
  % endif