killbill-payment-test 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -21,3 +21,4 @@ doc/
21
21
  Jarfile.lock
22
22
  Gemfile.lock
23
23
  *.swp
24
+ killbill-payment-test
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
 
23
23
  s.rdoc_options << '--exclude' << '.'
24
24
 
25
- s.add_dependency 'killbill', '~> 1.0.6'
25
+ s.add_dependency 'killbill', '~> 1.0.9'
26
26
  s.add_dependency 'activemerchant', '~> 1.29.3'
27
27
  s.add_dependency 'sinatra', '~> 1.3.4'
28
28
 
@@ -18,68 +18,37 @@ module PaymentTest
18
18
  def get_name
19
19
  end
20
20
 
21
- def charge(kb_payment_id, kb_payment_method_id, amount_in_cents, options = {})
22
- if @raise_exception
23
- raise StandardError.new("Test exception")
24
- else
25
- Killbill::Plugin::PaymentResponse.new(amount_in_cents, DateTime.now, DateTime.now, Killbill::Plugin::PaymentStatus::SUCCESS, "gateway_error", "gateway_error_code")
26
- end
21
+ def process_payment(kb_payment_id, kb_payment_method_id, amount_in_cents, options = {})
22
+ res = Killbill::Plugin::PaymentResponse.new(amount_in_cents, DateTime.now, DateTime.now, Killbill::Plugin::PaymentStatus::SUCCESS, "gateway_error", "gateway_error_code")
27
23
  end
28
24
 
29
25
  def get_payment_info(kb_payment_id, options = {})
30
- if @raise_exception
31
- raise StandardError.new("Test exception")
32
- else
33
26
  Killbill::Plugin::PaymentResponse.new(0, DateTime.now, DateTime.now, Killbill::Plugin::PaymentStatus::SUCCESS, "gateway_error", "gateway_error_code")
34
- end
35
27
  end
36
28
 
37
- def refund(kb_payment_id, amount_in_cents, options = {})
38
- if @raise_exception
39
- raise StandardError.new("Test exception")
40
- else
29
+ def process_refund(kb_payment_id, amount_in_cents, options = {})
41
30
  Killbill::Plugin::RefundResponse.new(amount_in_cents, DateTime.now, DateTime.now, Killbill::Plugin::PaymentStatus::SUCCESS, "gateway_error", "gateway_error_code")
42
- end
43
31
  end
44
32
 
45
33
  def add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default, options = {})
46
- if @raise_exception
47
- raise StandardError.new("Test exception")
48
- end
34
+ nil
49
35
  end
50
36
 
51
37
  def delete_payment_method(kb_payment_method_id, options = {})
52
- if @raise_exception
53
- raise StandardError.new("Test exception")
54
- end
55
38
  end
56
39
 
57
40
  def get_payment_method_detail(kb_account_id, kb_payment_method_id, options = {})
58
- if @raise_exception
59
- raise StandardError.new("Test exception")
60
- else
61
41
  Killbill::Plugin::PaymentMethodResponse.new("foo", true, [])
62
- end
63
42
  end
64
43
 
65
44
  def set_default_payment_method(kb_payment_method_id, options = {})
66
- if @raise_exception
67
- raise StandardError.new("Test exception")
68
- end
69
45
  end
70
46
 
71
- def get_payment_methods(kb_account_id, options = {})
72
- if @raise_exception
73
- raise StandardError.new("Test exception")
74
- else
47
+ def get_payment_methods(kb_account_id, refresh_from_gateway, options = {})
75
48
  [Killbill::Plugin::PaymentMethodResponseInternal.new(kb_account_id, kb_account_id, true, "external_payment_method_id")]
76
- end
77
49
  end
78
50
 
79
51
  def reset_payment_methods(payment_methods)
80
- if @raise_exception
81
- raise StandardError.new("Test exception")
82
- end
83
52
  end
84
53
 
85
54
  def raise_exception_on_next_calls
@@ -20,7 +20,7 @@ describe PaymentTest::PaymentPlugin do
20
20
 
21
21
  it "should should test charge " do
22
22
 
23
- output = @plugin.charge(@kb_payment_id, @kb_payment_method_id, @amount_in_cents)
23
+ output = @plugin.process_payment(@kb_payment_id, @kb_payment_method_id, @amount_in_cents)
24
24
 
25
25
  output.should be_an_instance_of Killbill::Plugin::PaymentResponse
26
26
  output.amount_in_cents.should == @amount_in_cents
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-payment-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-21 00:00:00.000000000 Z
12
+ date: 2013-03-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: killbill
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 1.0.6
21
+ version: 1.0.9
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 1.0.6
29
+ version: 1.0.9
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: activemerchant
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  version: '0'
148
148
  segments:
149
149
  - 0
150
- hash: -2279506154400517826
150
+ hash: -1458090976118478225
151
151
  requirements: []
152
152
  rubyforge_project:
153
153
  rubygems_version: 1.8.24