balanced 1.0.beta1 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.ruby-version +1 -1
  4. data/LICENSE +2 -2
  5. data/balanced.gemspec +1 -1
  6. data/lib/balanced/resources.rb +1 -0
  7. data/lib/balanced/resources/customer.rb +0 -14
  8. data/lib/balanced/resources/dispute.rb +12 -0
  9. data/lib/balanced/version.rb +1 -1
  10. data/scenario.cache +142 -141
  11. data/scenarios/api_key_create/ruby.mako +6 -6
  12. data/scenarios/api_key_delete/ruby.mako +2 -2
  13. data/scenarios/api_key_list/ruby.mako +10 -10
  14. data/scenarios/api_key_show/ruby.mako +6 -6
  15. data/scenarios/bank_account_associate_to_customer/ruby.mako +13 -13
  16. data/scenarios/bank_account_create/ruby.mako +13 -13
  17. data/scenarios/bank_account_credit/ruby.mako +15 -15
  18. data/scenarios/bank_account_debit/ruby.mako +15 -15
  19. data/scenarios/bank_account_delete/ruby.mako +2 -2
  20. data/scenarios/bank_account_list/ruby.mako +22 -22
  21. data/scenarios/bank_account_show/ruby.mako +12 -12
  22. data/scenarios/bank_account_update/ruby.mako +12 -12
  23. data/scenarios/bank_account_verification_create/ruby.mako +9 -9
  24. data/scenarios/bank_account_verification_show/ruby.mako +9 -9
  25. data/scenarios/bank_account_verification_update/ruby.mako +9 -9
  26. data/scenarios/callback_create/ruby.mako +5 -4
  27. data/scenarios/callback_delete/ruby.mako +2 -2
  28. data/scenarios/callback_list/ruby.mako +4 -4
  29. data/scenarios/callback_show/ruby.mako +5 -5
  30. data/scenarios/card_associate_to_customer/ruby.mako +15 -15
  31. data/scenarios/card_create/ruby.mako +14 -14
  32. data/scenarios/card_debit/ruby.mako +16 -16
  33. data/scenarios/card_delete/ruby.mako +2 -2
  34. data/scenarios/card_hold_capture/ruby.mako +16 -16
  35. data/scenarios/card_hold_create/ruby.mako +16 -14
  36. data/scenarios/card_hold_list/ruby.mako +29 -25
  37. data/scenarios/card_hold_show/ruby.mako +16 -14
  38. data/scenarios/card_hold_update/ruby.mako +16 -14
  39. data/scenarios/card_hold_void/ruby.mako +16 -14
  40. data/scenarios/card_list/ruby.mako +24 -24
  41. data/scenarios/card_show/ruby.mako +13 -13
  42. data/scenarios/card_update/ruby.mako +13 -13
  43. data/scenarios/credit_list/ruby.mako +14 -14
  44. data/scenarios/credit_list_bank_account/ruby.mako +2 -2
  45. data/scenarios/credit_show/ruby.mako +15 -15
  46. data/scenarios/credit_update/ruby.mako +15 -15
  47. data/scenarios/customer_create/ruby.mako +19 -17
  48. data/scenarios/customer_delete/ruby.mako +1 -1
  49. data/scenarios/customer_list/ruby.mako +37 -33
  50. data/scenarios/customer_show/ruby.mako +20 -18
  51. data/scenarios/customer_update/ruby.mako +20 -18
  52. data/scenarios/debit_list/ruby.mako +28 -28
  53. data/scenarios/debit_show/ruby.mako +15 -15
  54. data/scenarios/debit_update/ruby.mako +15 -15
  55. data/scenarios/event_list/ruby.mako +67 -20
  56. data/scenarios/event_show/ruby.mako +23 -21
  57. data/scenarios/order_create/ruby.mako +14 -14
  58. data/scenarios/order_list/ruby.mako +13 -13
  59. data/scenarios/order_show/ruby.mako +14 -14
  60. data/scenarios/order_update/ruby.mako +14 -14
  61. data/scenarios/refund_create/ruby.mako +13 -13
  62. data/scenarios/refund_list/ruby.mako +12 -12
  63. data/scenarios/refund_show/ruby.mako +13 -13
  64. data/scenarios/refund_update/ruby.mako +13 -13
  65. data/scenarios/render_mako.rb +0 -1
  66. data/scenarios/reversal_create/ruby.mako +12 -12
  67. data/scenarios/reversal_list/ruby.mako +11 -11
  68. data/scenarios/reversal_show/ruby.mako +12 -12
  69. data/scenarios/reversal_update/ruby.mako +12 -12
  70. data/spec/balanced/resources/bank_account_spec.rb +0 -3
  71. data/spec/balanced/resources/debit_spec.rb +0 -13
  72. data/spec/balanced/resources/dispute_spec.rb +65 -0
  73. metadata +20 -18
  74. data/.rbenv-version +0 -1
@@ -3,9 +3,9 @@ Balanced::Refund.save
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-1kvvievk0Qqw5wQPsrlM9g7wQwNe62cyc')
6
+ Balanced.configure('ak-test-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
7
7
 
8
- refund = Balanced::Refund.fetch('/refunds/RF3RklPuFgsgI50UuYtr4g6I')
8
+ refund = Balanced::Refund.fetch('/refunds/RF6HsnqferSuES9VZEWrthG2')
9
9
  refund.description = 'update this description'
10
10
  refund.meta = {
11
11
  'refund.reason' => 'user not happy with product',
@@ -15,31 +15,31 @@ refund.meta = {
15
15
  refund.save
16
16
 
17
17
  % elif mode == 'response':
18
- #<Balanced::Refund:0x007fdc9c0149f8
18
+ #<Balanced::Refund:0x007ff2bd980668
19
19
  @attributes=
20
20
  {"amount"=>3000,
21
- "created_at"=>"2014-01-27T22:58:11.375665Z",
21
+ "created_at"=>"2014-03-06T19:23:46.176138Z",
22
22
  "currency"=>"USD",
23
23
  "description"=>"update this description",
24
- "href"=>"/refunds/RF3RklPuFgsgI50UuYtr4g6I",
25
- "id"=>"RF3RklPuFgsgI50UuYtr4g6I",
24
+ "href"=>"/refunds/RF6HsnqferSuES9VZEWrthG2",
25
+ "id"=>"RF6HsnqferSuES9VZEWrthG2",
26
26
  "links"=>
27
- {"debit"=>"WD3MKNxNTKBGgA7mX50yogiu", "dispute"=>nil, "order"=>nil},
27
+ {"debit"=>"WD6BKYhbRzlRhfKSE1DcpqS5", "dispute"=>nil, "order"=>nil},
28
28
  "meta"=>
29
29
  {"refund.reason"=>"user not happy with product",
30
30
  "user.notes"=>"very polite on the phone",
31
31
  "user.refund.count"=>"3"},
32
32
  "status"=>"succeeded",
33
- "transaction_number"=>"RF383-088-7077",
34
- "updated_at"=>"2014-01-27T22:58:17.950799Z"},
33
+ "transaction_number"=>"RF348-549-7723",
34
+ "updated_at"=>"2014-03-06T19:23:53.123358Z"},
35
35
  @hyperlinks=
36
36
  {"debit"=>
37
- #<Proc:0x007fdc9c00d838/lib/balanced/resources/resource.rb:60 (lambda)>,
37
+ #<Proc:0x007ff2bd97a8a8/lib/balanced/resources/resource.rb:60 (lambda)>,
38
38
  "dispute"=>
39
- #<Proc:0x007fdc9c00cb18/lib/balanced/utils.rb:6 (lambda)>,
39
+ #<Proc:0x007ff2bd97b398/lib/balanced/utils.rb:6 (lambda)>,
40
40
  "events"=>
41
- #<Proc:0x007fdc9b865018/lib/balanced/utils.rb:6 (lambda)>,
41
+ #<Proc:0x007ff2bd9788c8/lib/balanced/utils.rb:6 (lambda)>,
42
42
  "order"=>
43
- #<Proc:0x007fdc9b85ff78/lib/balanced/utils.rb:6 (lambda)>}>
43
+ #<Proc:0x007ff2bd973580/lib/balanced/utils.rb:6 (lambda)>}>
44
44
 
45
45
  % endif
@@ -41,7 +41,6 @@ def construct_from_response(payload)
41
41
  end
42
42
 
43
43
  def tidy_response(response)
44
- #@/Users/ben/Development/ruby/balanced-ruby/lib/balanced/utils.rb:6
45
44
  return if ! response
46
45
  return response.gsub(/@\S(.*?)\Sbalanced-ruby/, '')
47
46
  end
@@ -2,9 +2,9 @@
2
2
  Balanced::Credit.reverse
3
3
  % elif mode == 'request':
4
4
  require 'balanced'
5
- Balanced.configure('ak-test-1kvvievk0Qqw5wQPsrlM9g7wQwNe62cyc')
5
+ Balanced.configure('ak-test-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
6
6
 
7
- reversal = Balanced::Credit.fetch('/credits/CR40neytmVG2HDBp1opfF7sY')
7
+ reversal = Balanced::Credit.fetch('/credits/CR6NpuEtezCdLTYngDrSEODv')
8
8
  credit.reverse(
9
9
  :amount => 3000,
10
10
  :description => 'Reversal for Order #1111',
@@ -16,30 +16,30 @@ credit.reverse(
16
16
  )
17
17
 
18
18
  % elif mode == 'response':
19
- #<Balanced::Reversal:0x007fdc9b8048d0
19
+ #<Balanced::Reversal:0x007ff2bd951278
20
20
  @attributes=
21
21
  {"amount"=>3000,
22
- "created_at"=>"2014-01-27T22:58:21.214829Z",
22
+ "created_at"=>"2014-03-06T19:23:55.596399Z",
23
23
  "currency"=>"USD",
24
24
  "description"=>"Reversal for Order #1111",
25
25
  "failure_reason"=>nil,
26
26
  "failure_reason_code"=>nil,
27
- "href"=>"/reversals/RV42n8M9XZWna427oPDDi4RG",
28
- "id"=>"RV42n8M9XZWna427oPDDi4RG",
29
- "links"=>{"credit"=>"CR40neytmVG2HDBp1opfF7sY", "order"=>nil},
27
+ "href"=>"/reversals/RV6OCxJ1UhkG84is6H9PHjkZ",
28
+ "id"=>"RV6OCxJ1UhkG84is6H9PHjkZ",
29
+ "links"=>{"credit"=>"CR6NpuEtezCdLTYngDrSEODv", "order"=>nil},
30
30
  "meta"=>
31
31
  {"fulfillment.item.condition"=>"OK",
32
32
  "merchant.feedback"=>"positive",
33
33
  "user.refund_reason"=>"not happy with product"},
34
34
  "status"=>"succeeded",
35
- "transaction_number"=>"RV219-169-0008",
36
- "updated_at"=>"2014-01-27T22:58:22.190749Z"},
35
+ "transaction_number"=>"RV542-861-3670",
36
+ "updated_at"=>"2014-03-06T19:23:56.470321Z"},
37
37
  @hyperlinks=
38
38
  {"credit"=>
39
- #<Proc:0x007fdc9b190b20/lib/balanced/resources/resource.rb:60 (lambda)>,
39
+ #<Proc:0x007ff2bd94b350/lib/balanced/resources/resource.rb:60 (lambda)>,
40
40
  "events"=>
41
- #<Proc:0x007fdc9b188380/lib/balanced/utils.rb:6 (lambda)>,
41
+ #<Proc:0x007ff2bd948c90/lib/balanced/utils.rb:6 (lambda)>,
42
42
  "order"=>
43
- #<Proc:0x007fdc9b1818c8/lib/balanced/utils.rb:6 (lambda)>}>
43
+ #<Proc:0x007ff2bd9480b0/lib/balanced/utils.rb:6 (lambda)>}>
44
44
 
45
45
  % endif
@@ -3,34 +3,34 @@ Balanced::Reversal.all
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-1kvvievk0Qqw5wQPsrlM9g7wQwNe62cyc')
6
+ Balanced.configure('ak-test-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
7
7
 
8
8
  reversals = Balanced::Reversal.all
9
9
  % elif mode == 'response':
10
- [#<Balanced::Reversal:0x007fdc9b129420
10
+ [#<Balanced::Reversal:0x007ff2bd929200
11
11
  @attributes=
12
12
  {"amount"=>3000,
13
- "created_at"=>"2014-01-27T22:58:21.214829Z",
13
+ "created_at"=>"2014-03-06T19:23:55.596399Z",
14
14
  "currency"=>"USD",
15
15
  "description"=>"Reversal for Order #1111",
16
16
  "failure_reason"=>nil,
17
17
  "failure_reason_code"=>nil,
18
- "href"=>"/reversals/RV42n8M9XZWna427oPDDi4RG",
19
- "id"=>"RV42n8M9XZWna427oPDDi4RG",
20
- "links"=>{"credit"=>"CR40neytmVG2HDBp1opfF7sY", "order"=>nil},
18
+ "href"=>"/reversals/RV6OCxJ1UhkG84is6H9PHjkZ",
19
+ "id"=>"RV6OCxJ1UhkG84is6H9PHjkZ",
20
+ "links"=>{"credit"=>"CR6NpuEtezCdLTYngDrSEODv", "order"=>nil},
21
21
  "meta"=>
22
22
  {"fulfillment.item.condition"=>"OK",
23
23
  "merchant.feedback"=>"positive",
24
24
  "user.refund_reason"=>"not happy with product"},
25
25
  "status"=>"succeeded",
26
- "transaction_number"=>"RV219-169-0008",
27
- "updated_at"=>"2014-01-27T22:58:22.190749Z"},
26
+ "transaction_number"=>"RV542-861-3670",
27
+ "updated_at"=>"2014-03-06T19:23:56.470321Z"},
28
28
  @hyperlinks=
29
29
  {"credit"=>
30
- #<Proc:0x007fdc9b103c48/lib/balanced/resources/resource.rb:60 (lambda)>,
30
+ #<Proc:0x007ff2bd91f430/lib/balanced/resources/resource.rb:60 (lambda)>,
31
31
  "events"=>
32
- #<Proc:0x007fdc9b0aef68/lib/balanced/utils.rb:6 (lambda)>,
32
+ #<Proc:0x007ff2bd91c7a8/lib/balanced/utils.rb:6 (lambda)>,
33
33
  "order"=>
34
- #<Proc:0x007fdc9b09f4c8/lib/balanced/utils.rb:6 (lambda)>}>]
34
+ #<Proc:0x007ff2bd91dab8/lib/balanced/utils.rb:6 (lambda)>}>]
35
35
 
36
36
  % endif
@@ -3,35 +3,35 @@ Balanced::Reversal.fetch
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-1kvvievk0Qqw5wQPsrlM9g7wQwNe62cyc')
6
+ Balanced.configure('ak-test-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
7
7
 
8
- reversal = Balanced::Reversal.fetch('/reversals/RV42n8M9XZWna427oPDDi4RG')
8
+ reversal = Balanced::Reversal.fetch('/reversals/RV6OCxJ1UhkG84is6H9PHjkZ')
9
9
 
10
10
  % elif mode == 'response':
11
- #<Balanced::Reversal:0x007fdc9b047d18
11
+ #<Balanced::Reversal:0x007ff2bd8c1858
12
12
  @attributes=
13
13
  {"amount"=>3000,
14
- "created_at"=>"2014-01-27T22:58:21.214829Z",
14
+ "created_at"=>"2014-03-06T19:23:55.596399Z",
15
15
  "currency"=>"USD",
16
16
  "description"=>"Reversal for Order #1111",
17
17
  "failure_reason"=>nil,
18
18
  "failure_reason_code"=>nil,
19
- "href"=>"/reversals/RV42n8M9XZWna427oPDDi4RG",
20
- "id"=>"RV42n8M9XZWna427oPDDi4RG",
21
- "links"=>{"credit"=>"CR40neytmVG2HDBp1opfF7sY", "order"=>nil},
19
+ "href"=>"/reversals/RV6OCxJ1UhkG84is6H9PHjkZ",
20
+ "id"=>"RV6OCxJ1UhkG84is6H9PHjkZ",
21
+ "links"=>{"credit"=>"CR6NpuEtezCdLTYngDrSEODv", "order"=>nil},
22
22
  "meta"=>
23
23
  {"fulfillment.item.condition"=>"OK",
24
24
  "merchant.feedback"=>"positive",
25
25
  "user.refund_reason"=>"not happy with product"},
26
26
  "status"=>"succeeded",
27
- "transaction_number"=>"RV219-169-0008",
28
- "updated_at"=>"2014-01-27T22:58:22.190749Z"},
27
+ "transaction_number"=>"RV542-861-3670",
28
+ "updated_at"=>"2014-03-06T19:23:56.470321Z"},
29
29
  @hyperlinks=
30
30
  {"credit"=>
31
- #<Proc:0x007fdc9b03d2f0/lib/balanced/resources/resource.rb:60 (lambda)>,
31
+ #<Proc:0x007ff2bd8b9fb8/lib/balanced/resources/resource.rb:60 (lambda)>,
32
32
  "events"=>
33
- #<Proc:0x007fdc9b02f510/lib/balanced/utils.rb:6 (lambda)>,
33
+ #<Proc:0x007ff2bd8b07b0/lib/balanced/utils.rb:6 (lambda)>,
34
34
  "order"=>
35
- #<Proc:0x007fdc9b02efc0/lib/balanced/utils.rb:6 (lambda)>}>
35
+ #<Proc:0x007ff2bd8aa428/lib/balanced/utils.rb:6 (lambda)>}>
36
36
 
37
37
  % endif
@@ -3,9 +3,9 @@ Balanced::Reversal.save
3
3
 
4
4
  % elif mode == 'request':
5
5
  require 'balanced'
6
- Balanced.configure('ak-test-1kvvievk0Qqw5wQPsrlM9g7wQwNe62cyc')
6
+ Balanced.configure('ak-test-2ADpvITfpgBn8uBzEGsQ2bIgWaftUWiul')
7
7
 
8
- reversal = Balanced::Reversal.fetch('/reversals/RV42n8M9XZWna427oPDDi4RG')
8
+ reversal = Balanced::Reversal.fetch('/reversals/RV6OCxJ1UhkG84is6H9PHjkZ')
9
9
  reversal.description = 'update this description'
10
10
  reversal.meta = {
11
11
  'refund.reason' => 'user not happy with product',
@@ -15,30 +15,30 @@ reversal.meta = {
15
15
  reversal.save
16
16
 
17
17
  % elif mode == 'response':
18
- #<Balanced::Reversal:0x007fdc9e82cd50
18
+ #<Balanced::Reversal:0x007ff2be14a358
19
19
  @attributes=
20
20
  {"amount"=>3000,
21
- "created_at"=>"2014-01-27T22:58:21.214829Z",
21
+ "created_at"=>"2014-03-06T19:23:55.596399Z",
22
22
  "currency"=>"USD",
23
23
  "description"=>"update this description",
24
24
  "failure_reason"=>nil,
25
25
  "failure_reason_code"=>nil,
26
- "href"=>"/reversals/RV42n8M9XZWna427oPDDi4RG",
27
- "id"=>"RV42n8M9XZWna427oPDDi4RG",
28
- "links"=>{"credit"=>"CR40neytmVG2HDBp1opfF7sY", "order"=>nil},
26
+ "href"=>"/reversals/RV6OCxJ1UhkG84is6H9PHjkZ",
27
+ "id"=>"RV6OCxJ1UhkG84is6H9PHjkZ",
28
+ "links"=>{"credit"=>"CR6NpuEtezCdLTYngDrSEODv", "order"=>nil},
29
29
  "meta"=>
30
30
  {"refund.reason"=>"user not happy with product",
31
31
  "user.notes"=>"very polite on the phone",
32
32
  "user.satisfaction"=>"6"},
33
33
  "status"=>"succeeded",
34
- "transaction_number"=>"RV219-169-0008",
35
- "updated_at"=>"2014-01-27T22:58:27.354488Z"},
34
+ "transaction_number"=>"RV542-861-3670",
35
+ "updated_at"=>"2014-03-06T19:24:00.271458Z"},
36
36
  @hyperlinks=
37
37
  {"credit"=>
38
- #<Proc:0x007fdc9e827440/lib/balanced/resources/resource.rb:60 (lambda)>,
38
+ #<Proc:0x007ff2be1428b0/lib/balanced/resources/resource.rb:60 (lambda)>,
39
39
  "events"=>
40
- #<Proc:0x007fdc9e825078/lib/balanced/utils.rb:6 (lambda)>,
40
+ #<Proc:0x007ff2be1381f8/lib/balanced/utils.rb:6 (lambda)>,
41
41
  "order"=>
42
- #<Proc:0x007fdc9e8245b0/lib/balanced/utils.rb:6 (lambda)>}>
42
+ #<Proc:0x007ff2be12bf20/lib/balanced/utils.rb:6 (lambda)>}>
43
43
 
44
44
  % endif
@@ -145,13 +145,10 @@ describe Balanced::BankAccount, :vcr => true, :marketplace => true do
145
145
  end
146
146
 
147
147
  it 'succeeds', :vcr => {:record => :new_episodes} do
148
- before = Balanced::Marketplace.mine.in_escrow
149
148
  @credit = @bank_account.credit(:amount => 1000)
150
149
  @credit.should be_instance_of Balanced::Credit
151
150
  @credit.status.should eql('succeeded')
152
151
  @credit.destination.href.should eql(@bank_account.href)
153
- after = Balanced::Marketplace.mine.in_escrow
154
- after.should eql(before - @credit.amount)
155
152
  end
156
153
  end
157
154
  end
@@ -57,19 +57,6 @@ describe Balanced::Debit, :vcr do
57
57
  its('source.href') { should match "#{@card.href}" }
58
58
  end
59
59
 
60
- context 'default source', :vcr do
61
- subject do
62
- @customer.debit(:amount => 1234)
63
- end
64
- it { should be_instance_of Balanced::Debit }
65
- its(:href) { should_not be_nil }
66
- its(:amount) { should eql 1234 }
67
- its(:appears_on_statement_as) { should eql "BAL*#{@marketplace.domain_url}" }
68
- its(:description) { should be_nil }
69
- its(:status) { should eql 'succeeded' }
70
- its(:source) { should be_instance_of Balanced::Card }
71
- its('source.href') { should match "#{@card.href}" }
72
- end
73
60
  end
74
61
  end
75
62
 
@@ -0,0 +1,65 @@
1
+ require 'spec_helper'
2
+ require 'vcr'
3
+
4
+ describe Balanced::Dispute, :vcr do
5
+
6
+ before(:all) do
7
+ VCR.use_cassette('dispute', :record => :new_episodes) do
8
+ api_key = Balanced::ApiKey.new.save
9
+ Balanced.configure api_key.secret
10
+ @marketplace = Balanced::Marketplace.new.save
11
+ @card = Balanced::Card.new(
12
+ :number => '6500000000000002',
13
+ :expiration_month => '12',
14
+ :expiration_year => '2020',
15
+ :cvv => '123'
16
+ ).save
17
+ @debit = @card.debit(:amount => 5566)
18
+ end
19
+
20
+ puts <<-NOTICE
21
+ ### Notice ###
22
+ It takes a while before the dispute record created,
23
+ take and nap and wake up, then it should be done :/
24
+ (last time I tried it took 10 minutes...)
25
+ NOTICE
26
+ timeout = 12 * 60
27
+ interval = 10
28
+ begin_time = Time.now
29
+ while true
30
+ @dispute = Balanced::Dispute.find(:first)
31
+ if @dispute
32
+ break
33
+ end
34
+ elapsed_time = Time.now - begin_time
35
+ if elapsed_time > timeout
36
+ # TODO: use a better error to raise?
37
+ raise RuntimeError, 'timeout'
38
+ end
39
+ puts "Polling disputes..., elapsed #{ elapsed_time }"
40
+ sleep(interval)
41
+ end
42
+ end
43
+
44
+ describe 'dispute', :vcr do
45
+ it 'should be a Balanced::Dispute' do
46
+ @dispute.should be_instance_of Balanced::Dispute
47
+ end
48
+
49
+ describe 'attributes', :vcr do
50
+ subject { @dispute }
51
+ its(:href) { should match "/disputes/#{ @dispute.id }" }
52
+ its(:status) { should match "pending" }
53
+ its(:reason) { should match "fraud" }
54
+ its(:amount) { should eq 5566 }
55
+ end
56
+
57
+ describe '#transaction', :vcr do
58
+ subject { @dispute }
59
+ its(:transaction) { should be_instance_of Balanced::Debit }
60
+ its('transaction.href') { should eq(@debit.href) }
61
+ end
62
+
63
+ end
64
+
65
+ end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: balanced
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.beta1
4
+ version: '1.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Balanced
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-29 00:00:00.000000000 Z
11
+ date: 2014-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.8.6
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.8.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday_middleware
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.9.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.9.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: addressable
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.3.5
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.3.5
55
55
  description: 'Balanced is the payments platform for marketplaces. '
@@ -59,12 +59,11 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - .gitignore
63
- - .rbenv-version
64
- - .rspec
65
- - .ruby-gemset
66
- - .ruby-version
67
- - .travis.yml
62
+ - ".gitignore"
63
+ - ".rspec"
64
+ - ".ruby-gemset"
65
+ - ".ruby-version"
66
+ - ".travis.yml"
68
67
  - CONTRIBUTORS
69
68
  - Gemfile
70
69
  - Guardfile
@@ -95,6 +94,7 @@ files:
95
94
  - lib/balanced/resources/credit.rb
96
95
  - lib/balanced/resources/customer.rb
97
96
  - lib/balanced/resources/debit.rb
97
+ - lib/balanced/resources/dispute.rb
98
98
  - lib/balanced/resources/event.rb
99
99
  - lib/balanced/resources/funding_instrument.rb
100
100
  - lib/balanced/resources/hypermedia.rb
@@ -294,6 +294,7 @@ files:
294
294
  - spec/balanced/resources/credit_spec.rb
295
295
  - spec/balanced/resources/customer_spec.rb
296
296
  - spec/balanced/resources/debit_spec.rb
297
+ - spec/balanced/resources/dispute_spec.rb
297
298
  - spec/balanced/resources/marketplace_spec.rb
298
299
  - spec/balanced/resources/order_spec.rb
299
300
  - spec/balanced/resources/resource_spec.rb
@@ -311,17 +312,17 @@ require_paths:
311
312
  - lib
312
313
  required_ruby_version: !ruby/object:Gem::Requirement
313
314
  requirements:
314
- - - '>='
315
+ - - ">="
315
316
  - !ruby/object:Gem::Version
316
317
  version: '0'
317
318
  required_rubygems_version: !ruby/object:Gem::Requirement
318
319
  requirements:
319
- - - '>'
320
+ - - ">="
320
321
  - !ruby/object:Gem::Version
321
- version: 1.3.1
322
+ version: '0'
322
323
  requirements: []
323
324
  rubyforge_project:
324
- rubygems_version: 2.0.3
325
+ rubygems_version: 2.2.2
325
326
  signing_key:
326
327
  specification_version: 4
327
328
  summary: https://docs.balancedpayments.com/
@@ -336,6 +337,7 @@ test_files:
336
337
  - spec/balanced/resources/credit_spec.rb
337
338
  - spec/balanced/resources/customer_spec.rb
338
339
  - spec/balanced/resources/debit_spec.rb
340
+ - spec/balanced/resources/dispute_spec.rb
339
341
  - spec/balanced/resources/marketplace_spec.rb
340
342
  - spec/balanced/resources/order_spec.rb
341
343
  - spec/balanced/resources/resource_spec.rb