balanced 0.7.4 → 0.7.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/.ruby-version +1 -1
  4. data/balanced.gemspec +2 -2
  5. data/examples/customers-with-meta-example.rb +141 -0
  6. data/examples/customers.rb +1 -6
  7. data/examples/examples.rb +1 -1
  8. data/lib/balanced/resources/marketplace.rb +1 -1
  9. data/lib/balanced/version.rb +1 -1
  10. data/scenario.cache +396 -383
  11. data/scenarios/account_add_card/ruby.mako +3 -3
  12. data/scenarios/account_capture_hold/request.rb +1 -1
  13. data/scenarios/account_capture_hold/ruby.mako +1 -1
  14. data/scenarios/account_create/ruby.mako +1 -1
  15. data/scenarios/account_create_buyer/request.rb +2 -1
  16. data/scenarios/account_create_buyer/ruby.mako +3 -2
  17. data/scenarios/account_create_debit/request.rb +1 -1
  18. data/scenarios/account_create_debit/ruby.mako +1 -1
  19. data/scenarios/account_create_hold/request.rb +1 -1
  20. data/scenarios/account_create_hold/ruby.mako +1 -1
  21. data/scenarios/account_create_merchant/ruby.mako +3 -3
  22. data/scenarios/account_underwrite_business/request.rb +2 -4
  23. data/scenarios/account_underwrite_business/ruby.mako +14 -4
  24. data/scenarios/account_underwrite_person/request.rb +1 -1
  25. data/scenarios/account_underwrite_person/ruby.mako +7 -2
  26. data/scenarios/bank_account_create/request.rb +1 -1
  27. data/scenarios/bank_account_create/ruby.mako +5 -2
  28. data/scenarios/bank_account_delete/ruby.mako +2 -2
  29. data/scenarios/bank_account_invalid_routing_number/request.rb +4 -1
  30. data/scenarios/bank_account_invalid_routing_number/ruby.mako +8 -2
  31. data/scenarios/bank_account_list/ruby.mako +1 -1
  32. data/scenarios/bank_account_show/ruby.mako +2 -2
  33. data/scenarios/bank_account_verification_create/ruby.mako +2 -2
  34. data/scenarios/bank_account_verification_show/ruby.mako +2 -2
  35. data/scenarios/bank_account_verification_update/request.rb +1 -2
  36. data/scenarios/bank_account_verification_update/ruby.mako +4 -5
  37. data/scenarios/callback_create/definition.rb +1 -1
  38. data/scenarios/callback_create/request.rb +1 -1
  39. data/scenarios/callback_create/ruby.mako +11 -0
  40. data/scenarios/callback_delete/definition.rb +1 -1
  41. data/scenarios/callback_delete/request.rb +1 -1
  42. data/scenarios/callback_delete/ruby.mako +10 -0
  43. data/scenarios/callback_list/definition.rb +1 -1
  44. data/scenarios/callback_list/ruby.mako +10 -0
  45. data/scenarios/callback_show/definition.rb +1 -1
  46. data/scenarios/callback_show/ruby.mako +9 -0
  47. data/scenarios/card_create/request.rb +1 -2
  48. data/scenarios/card_create/ruby.mako +5 -3
  49. data/scenarios/card_delete/ruby.mako +2 -2
  50. data/scenarios/card_invalidate/ruby.mako +2 -2
  51. data/scenarios/card_list/ruby.mako +1 -1
  52. data/scenarios/card_show/ruby.mako +2 -2
  53. data/scenarios/card_update/request.rb +1 -1
  54. data/scenarios/card_update/ruby.mako +5 -3
  55. data/scenarios/credit_account_merchant_create/request.rb +1 -1
  56. data/scenarios/credit_bank_account_list/ruby.mako +2 -2
  57. data/scenarios/credit_create_existing_bank_account/request.rb +1 -1
  58. data/scenarios/credit_create_existing_bank_account/ruby.mako +3 -3
  59. data/scenarios/credit_create_new_bank_account/request.rb +1 -1
  60. data/scenarios/credit_create_new_bank_account/ruby.mako +5 -2
  61. data/scenarios/credit_customer_list/ruby.mako +2 -2
  62. data/scenarios/credit_failed_state/request.rb +2 -2
  63. data/scenarios/credit_failed_state/ruby.mako +5 -2
  64. data/scenarios/credit_list/ruby.mako +1 -1
  65. data/scenarios/credit_paid_state/request.rb +2 -2
  66. data/scenarios/credit_paid_state/ruby.mako +5 -2
  67. data/scenarios/credit_pending_state/request.rb +2 -2
  68. data/scenarios/credit_pending_state/ruby.mako +5 -2
  69. data/scenarios/credit_show/ruby.mako +2 -2
  70. data/scenarios/customer_add_bank_account/ruby.mako +3 -3
  71. data/scenarios/customer_add_card/ruby.mako +3 -3
  72. data/scenarios/customer_capture_hold/request.rb +1 -1
  73. data/scenarios/customer_create/ruby.mako +1 -1
  74. data/scenarios/customer_create_debit/request.rb +1 -1
  75. data/scenarios/customer_create_debit/ruby.mako +3 -3
  76. data/scenarios/customer_create_hold/request.rb +1 -1
  77. data/scenarios/customer_create_hold/ruby.mako +1 -1
  78. data/scenarios/customer_credit/request.rb +1 -1
  79. data/scenarios/customer_credit/ruby.mako +2 -2
  80. data/scenarios/customer_delete/definition.rb +1 -0
  81. data/scenarios/customer_delete/request.rb +2 -0
  82. data/scenarios/customer_delete/ruby.mako +8 -0
  83. data/scenarios/debit_create/request.rb +3 -1
  84. data/scenarios/debit_create/ruby.mako +7 -3
  85. data/scenarios/debit_customer_list/ruby.mako +2 -2
  86. data/scenarios/debit_list/ruby.mako +1 -1
  87. data/scenarios/debit_refund/ruby.mako +2 -2
  88. data/scenarios/debit_show/ruby.mako +2 -2
  89. data/scenarios/debit_update/request.rb +3 -1
  90. data/scenarios/debit_update/ruby.mako +6 -3
  91. data/scenarios/event_list/ruby.mako +1 -1
  92. data/scenarios/event_show/ruby.mako +2 -2
  93. data/scenarios/helpers.rb +40 -7
  94. data/scenarios/hold_capture/request.rb +1 -1
  95. data/scenarios/hold_capture/ruby.mako +4 -3
  96. data/scenarios/hold_create/definition.rb +1 -1
  97. data/scenarios/hold_create/request.rb +3 -3
  98. data/scenarios/hold_create/ruby.mako +7 -6
  99. data/scenarios/hold_customer_list/ruby.mako +2 -2
  100. data/scenarios/hold_list/ruby.mako +1 -1
  101. data/scenarios/hold_show/ruby.mako +2 -2
  102. data/scenarios/hold_update/request.rb +3 -1
  103. data/scenarios/hold_update/ruby.mako +6 -3
  104. data/scenarios/hold_void/ruby.mako +2 -2
  105. data/scenarios/refund_account_list/ruby.mako +2 -2
  106. data/scenarios/refund_create/request.rb +4 -2
  107. data/scenarios/refund_create/ruby.mako +8 -4
  108. data/scenarios/refund_customer_list/ruby.mako +11 -0
  109. data/scenarios/refund_list/ruby.mako +1 -1
  110. data/scenarios/refund_show/ruby.mako +2 -2
  111. data/scenarios/refund_update/request.rb +3 -1
  112. data/scenarios/refund_update/ruby.mako +7 -3
  113. data/scenarios/render_mako.rb +1 -1
  114. metadata +23 -25
  115. data/.rbenv-version +0 -1
@@ -3,8 +3,8 @@ Balanced::Debit.find()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
7
 
8
- debit = Balanced::Debit.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/debits/WD51Ol3hw58fAlNvC3V0qLg3')
8
+ debit = Balanced::Debit.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/debits/WD6Ca1z3nrRRCdiYT1evN19S')
9
9
 
10
10
  % endif
@@ -1,5 +1,7 @@
1
1
  <%= boiler_plate %>
2
2
  debit = Balanced::Debit.find('<%= request['uri'] %>')
3
3
  debit.description = '<%= payload['description'] %>'
4
- debit.meta = <%= params_to_hash_for_args.call(payload['meta']) %>
4
+ debit.meta = {
5
+ <%= params_to_hash_for_args.call(payload['meta']).indent(2) %>
6
+ }
5
7
  debit.save
@@ -3,11 +3,14 @@ Balanced::Debit.save()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
7
 
8
- debit = Balanced::Debit.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/debits/WD51Ol3hw58fAlNvC3V0qLg3')
8
+ debit = Balanced::Debit.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/debits/WD6Ca1z3nrRRCdiYT1evN19S')
9
9
  debit.description = 'New description for debit'
10
- debit.meta = {:anykey=>"valuegoeshere", :"facebook.id"=>"1234567890"}
10
+ debit.meta = {
11
+ 'anykey' => 'valuegoeshere',
12
+ 'facebook.id' => '1234567890'
13
+ }
11
14
  debit.save
12
15
 
13
16
  % endif
@@ -3,7 +3,7 @@
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
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('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
7
 
8
- event = Balanced::Event.find('/v1/events/EV8b1a77a6d54611e2bbc4026ba7f8ec28')
8
+ event = Balanced::Event.find('/v1/events/EV9be5771e4d4811e38afd026ba7d31e6f')
9
9
 
10
10
  % endif
data/scenarios/helpers.rb CHANGED
@@ -1,15 +1,48 @@
1
1
  # stabby lambdas "= ->"" is same as lambda { |params ... }
2
- params_to_hash = ->(params) do
2
+ params_to_hash = lambda { |params|
3
3
  "".tap do |s|
4
- params.each do |k, v|
5
- s << ":#{k} => '#{v}',"
4
+ params.each_with_index do |(k, v), i|
5
+ if v.is_a? Hash
6
+ s << ":#{k} => {\n"
7
+ s << "#{params_to_hash.call(v)}".indent(2)
8
+ s << "\n}"
9
+ else
10
+ if v.is_a? String
11
+ s << ":#{k} => '#{v}'"
12
+ else
13
+ s << ":#{k} => #{v}"
14
+ end
15
+ end
16
+ if i != params.length - 1
17
+ s << ",\n"
18
+ end
6
19
  end
7
20
  end
8
- end
21
+ }
9
22
 
10
- params_to_hash_for_args = ->(payload) do
11
- payload.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
12
- end
23
+ params_to_hash_for_args = lambda { |payload|
24
+ "".tap do |s|
25
+ payload.each_with_index do |(k, v), i|
26
+ s << "'#{k.to_sym}' => '#{v}'".indent(2)
27
+ if i != payload.length - 1
28
+ s << ",\n"
29
+ end
30
+ end
31
+ end
32
+ }
13
33
 
14
34
  @helpers = {:params_to_hash => params_to_hash,
15
35
  :params_to_hash_for_args => params_to_hash_for_args}
36
+
37
+ String.class_eval do
38
+ def indent(count, char = ' ')
39
+ gsub(/([^\n]*)(\n|$)/) do |match|
40
+ last_iteration = ($1 == "" && $2 == "")
41
+ line = ""
42
+ line << (char * count) unless last_iteration
43
+ line << $1
44
+ line << $2
45
+ line
46
+ end
47
+ end
48
+ end
@@ -1,5 +1,5 @@
1
1
  <%= boiler_plate %>
2
2
  hold = Balanced::Hold.find('<%= request['hold_uri'] %>')
3
3
  debit = hold.capture(
4
- <%= params_to_hash_for_args.call(payload) %>
4
+ <%= params_to_hash.call(payload).indent(2) %>
5
5
  )
@@ -3,11 +3,12 @@ Balanced::Hold.capture(...)
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
7
 
8
- hold = Balanced::Hold.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/holds/HL5m1WNF0ste8ap24cZ5bVU4')
8
+ hold = Balanced::Hold.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/holds/HL74dRg2HWc5vQwX0kQ9XQfM')
9
9
  debit = hold.capture(
10
- {:appears_on_statement_as=>"ShowsUpOnStmt", :description=>"Some descriptive text for the debit in the dashboard", :hold_uri=>"/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/holds/HL5m1WNF0ste8ap24cZ5bVU4"}
10
+ :appears_on_statement_as => 'ShowsUpOnStmt',
11
+ :description => 'Some descriptive text for the debit in the dashboard'
11
12
  )
12
13
 
13
14
  % endif
@@ -1 +1 @@
1
- Balanced::Account.hold(...)
1
+ Balanced::Customer.hold(...)
@@ -1,5 +1,5 @@
1
1
  <%= boiler_plate %>
2
- buyer = Balanced::Account.find('<%= request['account_uri'] %>')
3
- buyer.hold(
4
- <%= params_to_hash_for_args.call(payload) %>
2
+ hold = Balanced::Hold.new(
3
+ <%= params_to_hash.call(payload).indent(2) %>
5
4
  )
5
+ hold.save
@@ -1,13 +1,14 @@
1
1
  % if mode == 'definition':
2
- Balanced::Account.hold(...)
2
+ Balanced::Customer.hold(...)
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
7
 
8
- buyer = Balanced::Account.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/accounts/AC4FqqEyFyTcd3eHhh2YXL4c')
9
- buyer.hold(
10
- {:amount=>5000, :description=>"Some descriptive text for the debit in the dashboard"}
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'
11
12
  )
12
-
13
+ hold.save
13
14
  % endif
@@ -3,9 +3,9 @@ Balanced::Customer.holds
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('c72cb360d3ae11e29593026ba7d31e6f')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
7
 
8
- customer = Balanced::Customer.find('/v1/customers/CU6W5pSk2CUXQxhENqyGRvQe')
8
+ customer = Balanced::Customer.find('/v1/customers/CU6ZO6HM8Hf8NMQRMm3ZlCAe')
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('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
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('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
7
 
8
- hold = Balanced::Hold.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/holds/HL5egN71JHX28fjIq5BbeR0s')
8
+ hold = Balanced::Hold.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/holds/HL74dRg2HWc5vQwX0kQ9XQfM')
9
9
 
10
10
  % endif
@@ -1,5 +1,7 @@
1
1
  <%= boiler_plate %>
2
2
  hold = Balanced::Hold.find('<%= request['uri'] %>')
3
3
  hold.description = '<%= payload['description'] %>'
4
- hold.meta = <%= params_to_hash_for_args.call(payload['meta']) %>
4
+ hold.meta = {
5
+ <%= params_to_hash_for_args.call(payload['meta']).indent(2) %>
6
+ }
5
7
  hold.save
@@ -3,11 +3,14 @@ Balanced::Hold.save()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
7
 
8
- hold = Balanced::Hold.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/holds/HL5egN71JHX28fjIq5BbeR0s')
8
+ hold = Balanced::Hold.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/holds/HL74dRg2HWc5vQwX0kQ9XQfM')
9
9
  hold.description = 'update this description'
10
- hold.meta = {:"holding.for"=>"user1", :"meaningful.key"=>"some.value"}
10
+ hold.meta = {
11
+ 'holding.for' => 'user1',
12
+ 'meaningful.key' => 'some.value'
13
+ }
11
14
  hold.save
12
15
 
13
16
  % endif
@@ -3,8 +3,8 @@ Balanced::Hold.void()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
7
 
8
- hold = Balanced::Hold.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/holds/HL5ptvs6CKB2jsZOhuNNmGOA')
8
+ hold = Balanced::Hold.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/holds/HL7kzlIJiVvhAmp8xFTMmMPB')
9
9
  hold.void
10
10
  % endif
@@ -3,8 +3,8 @@ Balanced::Account.refunds
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('8c3aeeb80e9e11e38901026ba7f8ec28')
7
7
 
8
- buyer = Balanced::Account.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/accounts/AC4FqqEyFyTcd3eHhh2YXL4c')
8
+ buyer = Balanced::Account.find('')
9
9
  refunds = buyer.refunds
10
10
  % endif
@@ -1,6 +1,8 @@
1
1
  <%= boiler_plate %>
2
2
  debit = Balanced::Debit.find('<%= request['debit_uri'] %>')
3
3
  debit.refund(
4
- :description => '<%= payload['description'] %>',
5
- :meta => <%= params_to_hash_for_args.call(payload['meta']) %>
4
+ :description => '<%= payload['description'] %>',
5
+ :meta => {
6
+ <%= params_to_hash_for_args.call(payload['meta']).indent(2) %>
7
+ }
6
8
  )
@@ -3,12 +3,16 @@ Balanced::Debit.refund()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
7
 
8
- debit = Balanced::Debit.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/debits/WD5uAv4hcfWPmB37xbtHkOTg')
8
+ debit = Balanced::Debit.find('/v1/marketplaces/TEST-MP4K6K0PWGyPtXL4LZ42sQSb/debits/WD7omMnm45N2JcPZ6fcaRRgY')
9
9
  debit.refund(
10
- :description => 'Refund for Order #1111',
11
- :meta => {:"fulfillment.item.condition"=>"OK", :"merchant.feedback"=>"positive", :"user.refund_reason"=>"not happy with product"}
10
+ :description => 'Refund for Order #1111',
11
+ :meta => {
12
+ 'fulfillment.item.condition' => 'OK',
13
+ 'merchant.feedback' => 'positive',
14
+ 'user.refund_reason' => 'not happy with product'
15
+ }
12
16
  )
13
17
 
14
18
  % endif
@@ -0,0 +1,11 @@
1
+ % if mode == 'definition':
2
+ Balanced::Customer.refunds
3
+
4
+ % else:
5
+ require 'balanced'
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
+
8
+ customer = Balanced::Customer.find('/v1/customers/CU7gMTGKh2yGHYn1lUxH9STS')
9
+ refunds = customer.refunds
10
+
11
+ % endif
@@ -3,7 +3,7 @@ Balanced::Refund.all
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
7
 
8
8
  marketplace = Balanced::Marketplace.my_marketplace
9
9
 
@@ -3,8 +3,8 @@ Balanced::Refund.find()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
7
 
8
- refund = Balanced::Refund.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/refunds/RF5vCZH6cVJzfoyqPDLVjBvU')
8
+ refund = Balanced::Refund.find('/v1/customers/CU7gMTGKh2yGHYn1lUxH9STS/refunds/RF7qwuLxprQJuVGf7sTAdwKc')
9
9
 
10
10
  % endif
@@ -1,5 +1,7 @@
1
1
  <%= boiler_plate %>
2
2
  refund = Balanced::Refund.find('<%= request['uri'] %>')
3
3
  refund.description = '<%= payload['description'] %>'
4
- refund.meta = <%= params_to_hash_for_args.call(payload['meta']) %>
4
+ refund.meta = {
5
+ <%= params_to_hash_for_args.call(payload['meta']).indent(2) %>
6
+ }
5
7
  refund.save
@@ -3,11 +3,15 @@ Balanced::Refund.save()
3
3
 
4
4
  % else:
5
5
  require 'balanced'
6
- Balanced.configure('8af725c6d54611e2bf5e026ba7f8ec28')
6
+ Balanced.configure('ak-test-2KZfoLyijij3Y6OyhDAvFRF9tXzelBLpD')
7
7
 
8
- refund = Balanced::Refund.find('/v1/marketplaces/TEST-MP4erLnXCYoaeyr3tx95WSKc/refunds/RF5vCZH6cVJzfoyqPDLVjBvU')
8
+ refund = Balanced::Refund.find('/v1/customers/CU7gMTGKh2yGHYn1lUxH9STS/refunds/RF7qwuLxprQJuVGf7sTAdwKc')
9
9
  refund.description = 'update this description'
10
- refund.meta = {:"refund.reason"=>"user not happy with product", :"user.notes"=>"very polite on the phone", :"user.refund.count"=>"3"}
10
+ refund.meta = {
11
+ 'refund.reason' => 'user not happy with product',
12
+ 'user.notes' => 'very polite on the phone',
13
+ 'user.refund.count' => '3'
14
+ }
11
15
  refund.save
12
16
 
13
17
  % endif
@@ -37,7 +37,7 @@ subdir_list.each do |scenario|
37
37
  f.write("\n")
38
38
  end
39
39
  rescue Exception => e
40
- puts "Error rendering #{scenario}'s mako"
41
40
  puts e
41
+ puts "Error rendering #{scenario}'s mako"
42
42
  end
43
43
  end
metadata CHANGED
@@ -1,50 +1,45 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: balanced
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
5
- prerelease:
4
+ version: 0.7.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mahmoud Abdelkader
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-06 00:00:00.000000000 Z
11
+ date: 2014-02-17 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: faraday
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.8.6
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: 0.8.6
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: faraday_middleware
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
33
  version: 0.9.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
40
  version: 0.9.0
46
- description: ! "Balanced is the payments platform for marketplaces.\n Integrate
47
- a payments experience just like Amazon for your marketplace.\n Forget about dealing
41
+ description: "Balanced is the payments platform for marketplaces.\n Integrate a
42
+ payments experience just like Amazon for your marketplace.\n Forget about dealing
48
43
  with banking systems, compliance, fraud, and security.\n "
49
44
  email:
50
45
  - mahmoud@poundpay.com
@@ -52,12 +47,11 @@ executables: []
52
47
  extensions: []
53
48
  extra_rdoc_files: []
54
49
  files:
55
- - .gitignore
56
- - .rbenv-version
57
- - .rspec
58
- - .ruby-gemset
59
- - .ruby-version
60
- - .travis.yml
50
+ - ".gitignore"
51
+ - ".rspec"
52
+ - ".ruby-gemset"
53
+ - ".ruby-version"
54
+ - ".travis.yml"
61
55
  - CONTRIBUTORS
62
56
  - Gemfile
63
57
  - Guardfile
@@ -76,6 +70,7 @@ files:
76
70
  - doc/balanced_templates/default/onefile/html/setup.rb
77
71
  - doc/balanced_templates/default/tags/html/index.erb
78
72
  - examples/bank_account_debits.rb
73
+ - examples/customers-with-meta-example.rb
79
74
  - examples/customers.rb
80
75
  - examples/events_and_callbacks.rb
81
76
  - examples/examples.rb
@@ -247,6 +242,9 @@ files:
247
242
  - scenarios/customer_credit/definition.rb
248
243
  - scenarios/customer_credit/request.rb
249
244
  - scenarios/customer_credit/ruby.mako
245
+ - scenarios/customer_delete/definition.rb
246
+ - scenarios/customer_delete/request.rb
247
+ - scenarios/customer_delete/ruby.mako
250
248
  - scenarios/debit_account_list/definition.rb
251
249
  - scenarios/debit_account_list/request.rb
252
250
  - scenarios/debit_account_list/ruby.mako
@@ -312,6 +310,7 @@ files:
312
310
  - scenarios/refund_create/ruby.mako
313
311
  - scenarios/refund_customer_list/definition.rb
314
312
  - scenarios/refund_customer_list/request.rb
313
+ - scenarios/refund_customer_list/ruby.mako
315
314
  - scenarios/refund_list/definition.rb
316
315
  - scenarios/refund_list/request.rb
317
316
  - scenarios/refund_list/ruby.mako
@@ -346,27 +345,26 @@ files:
346
345
  - upload_docs.rb
347
346
  homepage: https://balancedpayments.com
348
347
  licenses: []
348
+ metadata: {}
349
349
  post_install_message:
350
350
  rdoc_options: []
351
351
  require_paths:
352
352
  - lib
353
353
  required_ruby_version: !ruby/object:Gem::Requirement
354
- none: false
355
354
  requirements:
356
- - - ! '>='
355
+ - - ">="
357
356
  - !ruby/object:Gem::Version
358
357
  version: '0'
359
358
  required_rubygems_version: !ruby/object:Gem::Requirement
360
- none: false
361
359
  requirements:
362
- - - ! '>='
360
+ - - ">="
363
361
  - !ruby/object:Gem::Version
364
362
  version: '0'
365
363
  requirements: []
366
364
  rubyforge_project:
367
- rubygems_version: 1.8.25
365
+ rubygems_version: 2.2.2
368
366
  signing_key:
369
- specification_version: 3
367
+ specification_version: 4
370
368
  summary: Sign up on https://balancedpayments.com/
371
369
  test_files:
372
370
  - spec/balanced/error_spec.rb