kaui 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/app/controllers/kaui/payment_methods_controller.rb +17 -13
- data/kaui.gemspec +1 -1
- data/lib/kaui/version.rb +1 -1
- data/test/killbill_test_helper.rb +12 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69a715b46b207b1b61efdab90449e98406488d87
|
4
|
+
data.tar.gz: eba301b72bc6957f3b6d6342ea07ba89f5d8c8c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5ec35de209aef18aeb38a4d13267b782a8aab0bfac3f2aca76c6dc0c9f8654286b191fd497bf1df3f9a8847838cae908d588c0ce8b7a14f4931adc23157aebc
|
7
|
+
data.tar.gz: 1a3ae67d11058beaa7b49f401e7763a4e0e31996e178393f36ff4a833f4fbff77ec57c583cd09beb84b29862741a1b53687b12044eff5cb34b5fcd46c3d39024
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
kaui (0.7.
|
4
|
+
kaui (0.7.1)
|
5
5
|
cancan (~> 1.6.10)
|
6
6
|
carmen-rails (~> 1.0.0)
|
7
7
|
d3_rails (~> 3.2.8)
|
8
8
|
devise (~> 3.0.2)
|
9
9
|
jquery-rails (~> 3.0.4)
|
10
|
-
killbill-client (~> 0.
|
10
|
+
killbill-client (~> 0.8.1)
|
11
11
|
money-rails (~> 0.8.1)
|
12
12
|
rails (~> 3.2.14)
|
13
13
|
|
@@ -69,8 +69,8 @@ GEM
|
|
69
69
|
railties (>= 3.0, < 5.0)
|
70
70
|
thor (>= 0.14, < 2.0)
|
71
71
|
json (1.8.1)
|
72
|
-
killbill-client (0.
|
73
|
-
json (
|
72
|
+
killbill-client (0.8.1)
|
73
|
+
json (>= 1.2.0)
|
74
74
|
mail (2.5.4)
|
75
75
|
mime-types (~> 1.16)
|
76
76
|
treetop (~> 1.4.8)
|
@@ -126,7 +126,7 @@ GEM
|
|
126
126
|
treetop (1.4.15)
|
127
127
|
polyglot
|
128
128
|
polyglot (>= 0.3.1)
|
129
|
-
tzinfo (0.3.
|
129
|
+
tzinfo (0.3.41)
|
130
130
|
unicode_utils (1.4.0)
|
131
131
|
warden (1.2.3)
|
132
132
|
rack (>= 1.0)
|
@@ -51,6 +51,7 @@ class Kaui::PaymentMethodsController < Kaui::EngineController
|
|
51
51
|
@expiration_year = params[:expiration_year]
|
52
52
|
@expiration_month = params[:expiration_month]
|
53
53
|
@credit_card_number = params[:credit_card_number]
|
54
|
+
@verification_value = params[:verification_value]
|
54
55
|
@address1 = params[:address1]
|
55
56
|
@address2 = params[:address2]
|
56
57
|
@city = params[:city]
|
@@ -58,23 +59,26 @@ class Kaui::PaymentMethodsController < Kaui::EngineController
|
|
58
59
|
@state = params[:state]
|
59
60
|
@country = params[:country]
|
60
61
|
|
62
|
+
# Magic from lib/killbill/helpers/active_merchant/payment_plugin.rb
|
61
63
|
@payment_method.plugin_info = {
|
62
|
-
'type'
|
63
|
-
'ccType'
|
64
|
-
'
|
65
|
-
'
|
66
|
-
'
|
67
|
-
'
|
68
|
-
'
|
69
|
-
'
|
70
|
-
'
|
71
|
-
'
|
72
|
-
'
|
73
|
-
'
|
64
|
+
'type' => 'CreditCard',
|
65
|
+
'ccType' => @card_type,
|
66
|
+
'ccFirstName' => @card_holder_name,
|
67
|
+
'ccLastName' => @card_holder_name,
|
68
|
+
'ccExpirationMonth' => @expiration_month,
|
69
|
+
'ccExpirationYear' => @expiration_year,
|
70
|
+
'ccNumber' => @credit_card_number,
|
71
|
+
'ccVerificationValue' => @verification_value,
|
72
|
+
'address1' => @address1,
|
73
|
+
'address2' => @address2,
|
74
|
+
'city' => @city,
|
75
|
+
'country' => @country,
|
76
|
+
'zip' => @postal_code,
|
77
|
+
'state' => @state
|
74
78
|
}
|
75
79
|
|
76
80
|
begin
|
77
|
-
@payment_method = @payment_method.create(current_user.kb_username, @reason, @comment, options_for_klient)
|
81
|
+
@payment_method = @payment_method.create(@payment_method.is_default, current_user.kb_username, @reason, @comment, options_for_klient)
|
78
82
|
redirect_to payment_method_path(@payment_method.payment_method_id), :notice => 'Payment method was successfully created'
|
79
83
|
rescue => e
|
80
84
|
flash.now[:error] = "Error while creating payment method: #{as_string(e)}"
|
data/kaui.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.add_dependency 'jquery-rails', '~> 3.0.4'
|
27
27
|
s.add_dependency 'money-rails', '~> 0.8.1'
|
28
28
|
s.add_dependency 'd3_rails', '~> 3.2.8'
|
29
|
-
s.add_dependency 'killbill-client', '~> 0.
|
29
|
+
s.add_dependency 'killbill-client', '~> 0.8.1'
|
30
30
|
s.add_dependency 'devise', '~> 3.0.2'
|
31
31
|
s.add_dependency 'cancan', '~> 1.6.10'
|
32
32
|
s.add_dependency 'carmen-rails', '~> 1.0.0'
|
data/lib/kaui/version.rb
CHANGED
@@ -31,6 +31,11 @@ module Kaui
|
|
31
31
|
@cba = create_cba(@invoice_item.invoice_id, @account, @tenant)
|
32
32
|
@paid_invoice_item = create_charge(@account, @tenant)
|
33
33
|
@payment = create_payment(@paid_invoice_item, @account, @tenant)
|
34
|
+
|
35
|
+
KillBillClient.api_key = @tenant.api_key
|
36
|
+
KillBillClient.api_secret = @tenant.api_secret
|
37
|
+
KillBillClient.username = USERNAME
|
38
|
+
KillBillClient.password = PASSWORD
|
34
39
|
end
|
35
40
|
|
36
41
|
# Return a new test account
|
@@ -78,7 +83,7 @@ module Kaui
|
|
78
83
|
account = create_account(tenant, username, password, user, reason, comment) if account.nil?
|
79
84
|
|
80
85
|
payment_method = Kaui::PaymentMethod.new(:account_id => account.account_id, :plugin_name => '__EXTERNAL_PAYMENT__', :is_default => set_default)
|
81
|
-
payment_method.create(user, reason, comment, build_options(tenant, username, password))
|
86
|
+
payment_method.create(true, user, reason, comment, build_options(tenant, username, password))
|
82
87
|
end
|
83
88
|
|
84
89
|
# Return the created external charge
|
@@ -124,7 +129,12 @@ module Kaui
|
|
124
129
|
tenant.api_key = api_key
|
125
130
|
tenant.api_secret = api_secret
|
126
131
|
|
127
|
-
tenant.create(user, reason, comment, build_options)
|
132
|
+
tenant = tenant.create(user, reason, comment, build_options)
|
133
|
+
|
134
|
+
# Re-hydrate the secret, which is not returned
|
135
|
+
tenant.api_secret = api_secret
|
136
|
+
|
137
|
+
tenant
|
128
138
|
end
|
129
139
|
|
130
140
|
def build_options(tenant = nil, username = USERNAME, password = PASSWORD)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Killbill core team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.8.1
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.8.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: devise
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|