killbill-payment-test 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Jarfile +3 -0
- data/VERSION +1 -1
- data/killbill-payment-test.gemspec +1 -1
- data/lib/payment_test/api.rb +9 -10
- data/pom.xml +1 -1
- data/spec/payment_test/base_plugin_spec.rb +20 -4
- metadata +6 -5
data/Jarfile
ADDED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.8
|
@@ -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.
|
25
|
+
s.add_dependency 'killbill', '~> 1.0.17'
|
26
26
|
s.add_dependency 'sinatra', '~> 1.3.4'
|
27
27
|
|
28
28
|
s.add_development_dependency 'jbundler', '~> 0.4.1'
|
data/lib/payment_test/api.rb
CHANGED
@@ -18,41 +18,40 @@ module PaymentTest
|
|
18
18
|
def get_name
|
19
19
|
end
|
20
20
|
|
21
|
-
def process_payment(kb_account_id, kb_payment_id, kb_payment_method_id, amount_in_cents, currency, options = {})
|
22
|
-
|
21
|
+
def process_payment(kb_account_id, kb_payment_id, kb_payment_method_id, amount_in_cents, currency, call_context, options = {})
|
23
22
|
# Make an API call from the payment call
|
24
23
|
account = @kb_apis.get_account_by_id(kb_account_id)
|
25
24
|
puts "process_payment got ACCOUNT #{account.inspect}"
|
26
25
|
Killbill::Plugin::Model::PaymentInfoPlugin.new(amount_in_cents, DateTime.now, DateTime.now, Killbill::Plugin::Model::PaymentPluginStatus.new(:PROCESSED), "gateway_error", "gateway_error_code", nil, nil)
|
27
26
|
end
|
28
27
|
|
29
|
-
def get_payment_info(kb_account_id, kb_payment_id, options = {})
|
28
|
+
def get_payment_info(kb_account_id, kb_payment_id, tenant_context, options = {})
|
30
29
|
Killbill::Plugin::Model::PaymentInfoPlugin.new(0, DateTime.now, DateTime.now, Killbill::Plugin::Model::PaymentPluginStatus.new(:PROCESSED), "gateway_error", "gateway_error_code", nil, nil)
|
31
30
|
end
|
32
31
|
|
33
|
-
def process_refund(kb_account_id, kb_payment_id, amount_in_cents, currency, options = {})
|
32
|
+
def process_refund(kb_account_id, kb_payment_id, amount_in_cents, currency, call_context, options = {})
|
34
33
|
Killbill::Plugin::Model::RefundInfoPlugin.new(amount_in_cents, DateTime.now, DateTime.now, Killbill::Plugin::Model::RefundPluginStatus.new(:PROCESSED), "gateway_error", "gateway_error_code", nil)
|
35
34
|
end
|
36
35
|
|
37
|
-
def get_refund_info(kb_account_id, kb_payment_id, options = {})
|
36
|
+
def get_refund_info(kb_account_id, kb_payment_id, tenant_context, options = {})
|
38
37
|
Killbill::Plugin::Model::RefundInfoPlugin.new(amount_in_cents, DateTime.now, DateTime.now, illbill::Plugin::Model::RefundPluginStatus.new(:PROCESSED), "gateway_error", "gateway_error_code", nil)
|
39
38
|
end
|
40
39
|
|
41
|
-
def add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default, options = {})
|
40
|
+
def add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default, call_context, options = {})
|
42
41
|
nil
|
43
42
|
end
|
44
43
|
|
45
|
-
def delete_payment_method(kb_account_id, kb_payment_method_id, options = {})
|
44
|
+
def delete_payment_method(kb_account_id, kb_payment_method_id, call_context, options = {})
|
46
45
|
end
|
47
46
|
|
48
|
-
def get_payment_method_detail(kb_account_id, kb_payment_method_id, options = {})
|
47
|
+
def get_payment_method_detail(kb_account_id, kb_payment_method_id, tenant_context, options = {})
|
49
48
|
Killbill::Plugin::Model::PaymentMethodPlugin.new("foo", true, [], nil, "type", "cc_name", "cc_type", "cc_expiration_month", "cc_expiration_year", "cc_last4", "address1", "address2", "city", "state", "zip", "country")
|
50
49
|
end
|
51
50
|
|
52
|
-
def set_default_payment_method(kb_account_id, kb_payment_method_id, options = {})
|
51
|
+
def set_default_payment_method(kb_account_id, kb_payment_method_id, call_context, options = {})
|
53
52
|
end
|
54
53
|
|
55
|
-
def get_payment_methods(kb_account_id, refresh_from_gateway, options = {})
|
54
|
+
def get_payment_methods(kb_account_id, refresh_from_gateway, call_context, options = {})
|
56
55
|
[Killbill::Plugin::Model::PaymentMethodInfoPlugin.new(kb_account_id, kb_account_id, true, "external_payment_method_id")]
|
57
56
|
end
|
58
57
|
|
data/pom.xml
CHANGED
@@ -2,17 +2,33 @@ require 'spec_helper'
|
|
2
2
|
require 'logger'
|
3
3
|
require 'tempfile'
|
4
4
|
|
5
|
+
require 'killbill'
|
6
|
+
|
5
7
|
require 'payment_test'
|
6
8
|
|
9
|
+
class KillbillApiWithFakeGetAccountById < Killbill::Plugin::KillbillApi
|
10
|
+
def initialize(japi_proxy)
|
11
|
+
super(japi_proxy)
|
12
|
+
end
|
13
|
+
|
14
|
+
# Returns an account where we specify the currency for the report group
|
15
|
+
def get_account_by_id(id)
|
16
|
+
Killbill::Plugin::Model::Account.new(id, nil, nil, nil, nil, nil, 1, nil, 1, 'USD', nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, false, true)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
7
20
|
describe PaymentTest::PaymentPlugin do
|
8
21
|
before(:each) do
|
9
22
|
@plugin = PaymentTest::PaymentPlugin.new
|
10
23
|
@plugin.logger = Logger.new(STDOUT)
|
24
|
+
@plugin.kb_apis = KillbillApiWithFakeGetAccountById.new(nil)
|
25
|
+
|
11
26
|
@kb_account_id = "a86ed6d4-c0bd-4a44-b49a-5ec29c3b314a"
|
12
27
|
@kb_payment_id = "9f73c8e9-188a-4603-a3ba-2ce684411fb9"
|
13
28
|
@kb_payment_method_id = "b1396a76-b210-4690-a61e-e94c911a2a09"
|
14
29
|
@amount_in_cents = 100
|
15
30
|
@currency = 'USD'
|
31
|
+
@call_context = nil
|
16
32
|
end
|
17
33
|
|
18
34
|
it "should start and stop correctly" do
|
@@ -21,11 +37,11 @@ describe PaymentTest::PaymentPlugin do
|
|
21
37
|
end
|
22
38
|
|
23
39
|
it "should should test charge" do
|
24
|
-
output = @plugin.process_payment(@kb_account_id, @kb_payment_id, @kb_payment_method_id, @amount_in_cents, @currency)
|
40
|
+
output = @plugin.process_payment(@kb_account_id, @kb_payment_id, @kb_payment_method_id, @amount_in_cents, @currency, @call_context)
|
25
41
|
|
26
|
-
output.should be_an_instance_of Killbill::Plugin::
|
27
|
-
output.
|
28
|
-
output.status.should == Killbill::Plugin::
|
42
|
+
output.should be_an_instance_of Killbill::Plugin::Model::PaymentInfoPlugin
|
43
|
+
output.amount.should == @amount_in_cents
|
44
|
+
output.status.should == Killbill::Plugin::Model::PaymentPluginStatus.new(:PROCESSED)
|
29
45
|
end
|
30
46
|
|
31
47
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: killbill-payment-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.8
|
4
5
|
prerelease:
|
5
|
-
version: 1.0.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Killbill core team
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: killbill
|
@@ -17,13 +17,13 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 1.0.
|
20
|
+
version: 1.0.17
|
21
21
|
none: false
|
22
22
|
requirement: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0.
|
26
|
+
version: 1.0.17
|
27
27
|
none: false
|
28
28
|
prerelease: false
|
29
29
|
type: :runtime
|
@@ -99,6 +99,7 @@ extra_rdoc_files: []
|
|
99
99
|
files:
|
100
100
|
- ".gitignore"
|
101
101
|
- Gemfile
|
102
|
+
- Jarfile
|
102
103
|
- README.md
|
103
104
|
- Rakefile
|
104
105
|
- VERSION
|
@@ -131,9 +132,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
132
|
- !ruby/object:Gem::Version
|
132
133
|
segments:
|
133
134
|
- 0
|
134
|
-
hash: 2
|
135
135
|
version: !binary |-
|
136
136
|
MA==
|
137
|
+
hash: 2
|
137
138
|
none: false
|
138
139
|
requirements: []
|
139
140
|
rubyforge_project:
|