killbill 3.1.3 → 3.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Jarfile +7 -5
- data/NEWS +3 -0
- data/README.md +41 -17
- data/VERSION +1 -1
- data/generators/active_merchant/templates/Jarfile.rb +7 -5
- data/generators/active_merchant/templates/config.yml.rb +3 -3
- data/generators/active_merchant/templates/db/ddl.sql.rb +4 -0
- data/generators/active_merchant/templates/db/schema.rb +4 -0
- data/generators/active_merchant/templates/lib/api.rb +42 -22
- data/generators/active_merchant/templates/lib/models/response.rb +3 -1
- data/generators/active_merchant/templates/plugin.gemspec.rb +1 -1
- data/lib/killbill.rb +7 -4
- data/lib/killbill/gen/api/account.rb +4 -3
- data/lib/killbill/gen/api/account_api_exception.rb +4 -3
- data/lib/killbill/gen/api/account_audit_logs.rb +12 -68
- data/lib/killbill/gen/api/account_audit_logs_for_object_type.rb +4 -3
- data/lib/killbill/gen/api/account_data.rb +4 -3
- data/lib/killbill/gen/api/account_email.rb +4 -3
- data/lib/killbill/gen/api/account_user_api.rb +4 -3
- data/lib/killbill/gen/api/audit_log.rb +4 -3
- data/lib/killbill/gen/api/audit_user_api.rb +4 -3
- data/lib/killbill/gen/api/billing_exception_base.rb +4 -3
- data/lib/killbill/gen/api/block.rb +4 -3
- data/lib/killbill/gen/api/blockable.rb +4 -3
- data/lib/killbill/gen/api/blocking_api_exception.rb +4 -3
- data/lib/killbill/gen/api/blocking_state.rb +4 -3
- data/lib/killbill/gen/api/call_context.rb +4 -3
- data/lib/killbill/gen/api/catalog.rb +4 -3
- data/lib/killbill/gen/api/catalog_api_exception.rb +4 -3
- data/lib/killbill/gen/api/catalog_user_api.rb +4 -3
- data/lib/killbill/gen/api/column_info.rb +4 -3
- data/lib/killbill/gen/api/control_tag.rb +4 -3
- data/lib/killbill/gen/api/currency_conversion.rb +4 -3
- data/lib/killbill/gen/api/currency_conversion_api.rb +4 -3
- data/lib/killbill/gen/api/currency_conversion_exception.rb +4 -3
- data/lib/killbill/gen/api/currency_value_null.rb +4 -3
- data/lib/killbill/gen/api/custom_field.rb +4 -3
- data/lib/killbill/gen/api/custom_field_api_exception.rb +4 -3
- data/lib/killbill/gen/api/custom_field_user_api.rb +4 -3
- data/lib/killbill/gen/api/database_export_output_stream.rb +4 -3
- data/lib/killbill/gen/api/direct_payment.rb +39 -11
- data/lib/killbill/gen/api/direct_payment_api.rb +643 -31
- data/lib/killbill/gen/api/direct_payment_transaction.rb +37 -12
- data/lib/killbill/gen/api/duration.rb +4 -3
- data/lib/killbill/gen/api/entitlement.rb +4 -3
- data/lib/killbill/gen/api/entitlement_ao_status_dry_run.rb +4 -3
- data/lib/killbill/gen/api/entitlement_api.rb +4 -3
- data/lib/killbill/gen/api/entitlement_api_exception.rb +4 -3
- data/lib/killbill/gen/api/entity.rb +4 -3
- data/lib/killbill/gen/api/fixed.rb +4 -3
- data/lib/killbill/gen/api/illegal_plan_change.rb +4 -3
- data/lib/killbill/gen/api/international_price.rb +4 -3
- data/lib/killbill/gen/api/invalid_config_exception.rb +4 -3
- data/lib/killbill/gen/api/invoice.rb +4 -3
- data/lib/killbill/gen/api/invoice_api_exception.rb +4 -3
- data/lib/killbill/gen/api/invoice_creation_event.rb +4 -3
- data/lib/killbill/gen/api/invoice_formatter.rb +4 -3
- data/lib/killbill/gen/api/invoice_item.rb +4 -3
- data/lib/killbill/gen/api/invoice_item_formatter.rb +4 -3
- data/lib/killbill/gen/api/invoice_payment.rb +7 -7
- data/lib/killbill/gen/api/invoice_payment_api.rb +7 -153
- data/lib/killbill/gen/api/invoice_user_api.rb +22 -3
- data/lib/killbill/gen/api/limit.rb +4 -3
- data/lib/killbill/gen/api/listing.rb +4 -3
- data/lib/killbill/gen/api/migration_plan.rb +4 -3
- data/lib/killbill/gen/api/mutable_account_data.rb +4 -3
- data/lib/killbill/gen/api/osgi_killbill.rb +15 -7
- data/lib/killbill/gen/api/osgi_plugin_properties.rb +4 -3
- data/lib/killbill/gen/api/pagination.rb +4 -3
- data/lib/killbill/gen/api/payment_api_exception.rb +4 -3
- data/lib/killbill/gen/api/payment_gateway_api.rb +4 -3
- data/lib/killbill/gen/api/payment_method.rb +11 -4
- data/lib/killbill/gen/api/payment_method_plugin.rb +5 -76
- data/lib/killbill/gen/api/payment_options.rb +68 -0
- data/lib/killbill/gen/api/plan.rb +4 -3
- data/lib/killbill/gen/api/plan_change_result.rb +4 -3
- data/lib/killbill/gen/api/plan_phase.rb +4 -3
- data/lib/killbill/gen/api/plan_phase_specifier.rb +4 -3
- data/lib/killbill/gen/api/plan_specifier.rb +4 -3
- data/lib/killbill/gen/api/plugin_config_service_api.rb +4 -3
- data/lib/killbill/gen/api/plugin_property.rb +4 -3
- data/lib/killbill/gen/api/price.rb +4 -3
- data/lib/killbill/gen/api/price_list.rb +4 -3
- data/lib/killbill/gen/api/price_list_set.rb +4 -3
- data/lib/killbill/gen/api/product.rb +4 -3
- data/lib/killbill/gen/api/rate.rb +4 -3
- data/lib/killbill/gen/api/record_id_api.rb +4 -3
- data/lib/killbill/gen/api/recurring.rb +4 -3
- data/lib/killbill/gen/api/refund.rb +7 -6
- data/lib/killbill/gen/api/require_gen.rb +5 -6
- data/lib/killbill/gen/api/rolled_up_usage.rb +4 -3
- data/lib/killbill/gen/api/security_api_exception.rb +4 -3
- data/lib/killbill/gen/api/static_catalog.rb +4 -3
- data/lib/killbill/gen/api/subscription.rb +4 -3
- data/lib/killbill/gen/api/subscription_api.rb +4 -3
- data/lib/killbill/gen/api/subscription_api_exception.rb +4 -3
- data/lib/killbill/gen/api/subscription_bundle.rb +4 -3
- data/lib/killbill/gen/api/subscription_bundle_timeline.rb +4 -3
- data/lib/killbill/gen/api/subscription_event.rb +4 -3
- data/lib/killbill/gen/api/tag.rb +4 -3
- data/lib/killbill/gen/api/tag_api_exception.rb +4 -3
- data/lib/killbill/gen/api/tag_definition.rb +4 -3
- data/lib/killbill/gen/api/tag_definition_api_exception.rb +4 -3
- data/lib/killbill/gen/api/tag_user_api.rb +4 -3
- data/lib/killbill/gen/api/tenant.rb +4 -3
- data/lib/killbill/gen/api/tenant_api_exception.rb +4 -3
- data/lib/killbill/gen/api/tenant_context.rb +4 -3
- data/lib/killbill/gen/api/tenant_data.rb +4 -3
- data/lib/killbill/gen/api/tenant_kv.rb +4 -3
- data/lib/killbill/gen/api/tenant_user_api.rb +4 -3
- data/lib/killbill/gen/api/tier.rb +4 -3
- data/lib/killbill/gen/api/tiered_block.rb +4 -3
- data/lib/killbill/gen/api/unit.rb +4 -3
- data/lib/killbill/gen/api/usage.rb +4 -3
- data/lib/killbill/gen/api/usage_user_api.rb +4 -3
- data/lib/killbill/gen/plugin-api/currency_plugin_api.rb +4 -3
- data/lib/killbill/gen/plugin-api/ext_bus_event.rb +4 -3
- data/lib/killbill/gen/plugin-api/gateway_notification.rb +4 -3
- data/lib/killbill/gen/plugin-api/hosted_payment_page_form_descriptor.rb +4 -3
- data/lib/killbill/gen/plugin-api/notification_plugin_api.rb +4 -3
- data/lib/killbill/gen/plugin-api/payment_method_info_plugin.rb +4 -3
- data/lib/killbill/gen/plugin-api/payment_plugin_api.rb +75 -81
- data/lib/killbill/gen/plugin-api/payment_plugin_api_exception.rb +4 -3
- data/lib/killbill/gen/plugin-api/{payment_info_plugin.rb → payment_transaction_info_plugin.rb} +21 -6
- data/lib/killbill/gen/plugin-api/require_gen.rb +5 -5
- data/lib/killbill/helpers/active_merchant/active_record/models/payment_method.rb +20 -36
- data/lib/killbill/helpers/active_merchant/active_record/models/response.rb +72 -81
- data/lib/killbill/helpers/active_merchant/active_record/models/transaction.rb +62 -43
- data/lib/killbill/helpers/active_merchant/killbill_spec_helper.rb +0 -13
- data/lib/killbill/helpers/active_merchant/payment_plugin.rb +127 -125
- data/lib/killbill/http_servlet.rb +16 -1
- data/lib/killbill/killbill_api.rb +0 -3
- data/lib/killbill/payment.rb +22 -6
- data/lib/killbill/rake_task.rb +93 -31
- data/spec/killbill/helpers/payment_method_spec.rb +153 -0
- data/spec/killbill/helpers/response_spec.rb +58 -15
- data/spec/killbill/helpers/test_schema.rb +12 -8
- data/spec/killbill/helpers/transaction_spec.rb +134 -0
- data/spec/killbill/payment_plugin_api_spec.rb +18 -18
- data/spec/killbill/payment_plugin_spec.rb +26 -15
- data/spec/killbill/payment_test.rb +6 -7
- data/spec/spec_helper.rb +3 -0
- metadata +6 -5
- data/lib/killbill/gen/api/payment.rb +0 -187
- data/lib/killbill/gen/plugin-api/refund_info_plugin.rb +0 -152
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faaf0e82033d38d64c4d2b2485bc2dcaaf742ced
|
4
|
+
data.tar.gz: 2261f28500e2de1415d4bfef9362ad216b6555ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db84c65123b4b468eddf817bdade8754adc39ff1086f42b93d54e2353025faa6e7e911fc053b675886ffd6b7a17cccef94d3f364712554060a576193dbd98ae9
|
7
|
+
data.tar.gz: b453cd617a78cbb27987c15be256b30da157c602979c0856fe1d560dc1acab4b43beaf298c4ac5f28284aedaaaf9f29f63355b7833d7ecc00b20942cb0057429
|
data/Jarfile
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
jar 'org.kill-bill.billing:killbill-api', '0.9.
|
2
|
-
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-notification', '0.7.
|
3
|
-
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-payment', '0.7.
|
4
|
-
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-currency', '0.7.
|
5
|
-
jar 'org.kill-bill.billing:killbill-
|
1
|
+
jar 'org.kill-bill.billing:killbill-api', '0.9.6'
|
2
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-notification', '0.7.4'
|
3
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-payment', '0.7.4'
|
4
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-currency', '0.7.4'
|
5
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-retry', '0.7.4'
|
6
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-invoice', '0.7.4'
|
7
|
+
jar 'org.kill-bill.billing:killbill-util:tests', '0.11.3'
|
6
8
|
jar 'javax.servlet:javax.servlet-api', '3.0.1'
|
data/NEWS
CHANGED
data/README.md
CHANGED
@@ -56,43 +56,55 @@ How to write a Payment plugin
|
|
56
56
|
puts "MyPaymentPlugin plugin started"
|
57
57
|
end
|
58
58
|
|
59
|
-
def
|
59
|
+
def authorize_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
60
60
|
end
|
61
61
|
|
62
|
-
def
|
62
|
+
def capture_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
63
63
|
end
|
64
64
|
|
65
|
-
def
|
65
|
+
def purchase_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
66
66
|
end
|
67
67
|
|
68
|
-
def
|
68
|
+
def void_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, properties, context)
|
69
69
|
end
|
70
70
|
|
71
|
-
def
|
71
|
+
def credit_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
72
72
|
end
|
73
73
|
|
74
|
-
def
|
74
|
+
def refund_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
75
75
|
end
|
76
76
|
|
77
|
-
def
|
77
|
+
def get_payment_info(kb_account_id, kb_payment_id, properties, context)
|
78
78
|
end
|
79
79
|
|
80
|
-
def
|
80
|
+
def search_payments(search_key, offset, limit, properties, context)
|
81
81
|
end
|
82
82
|
|
83
|
-
def
|
83
|
+
def add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default, properties, context)
|
84
84
|
end
|
85
85
|
|
86
|
-
def
|
86
|
+
def delete_payment_method(kb_account_id, kb_payment_method_id, properties, context)
|
87
87
|
end
|
88
88
|
|
89
|
-
def
|
89
|
+
def get_payment_method_detail(kb_account_id, kb_payment_method_id, properties, context)
|
90
90
|
end
|
91
91
|
|
92
|
-
def
|
92
|
+
def set_default_payment_method(kb_account_id, kb_payment_method_id, properties, context)
|
93
93
|
end
|
94
94
|
|
95
|
-
def
|
95
|
+
def get_payment_methods(kb_account_id, refresh_from_gateway, properties, context)
|
96
|
+
end
|
97
|
+
|
98
|
+
def search_payment_methods(search_key, offset, limit, properties, context)
|
99
|
+
end
|
100
|
+
|
101
|
+
def reset_payment_methods(kb_account_id, payment_methods, properties, context)
|
102
|
+
end
|
103
|
+
|
104
|
+
def build_form_descriptor(kb_account_id, descriptor_fields, properties, context)
|
105
|
+
end
|
106
|
+
|
107
|
+
def process_notification(notification, properties, context)
|
96
108
|
end
|
97
109
|
|
98
110
|
# Overriding this method is optional, only if you need to do some tear down work
|
@@ -124,13 +136,17 @@ This will generate a tree of files ready to be plugged into Kill Bill. To packag
|
|
124
136
|
|
125
137
|
Most of the work consists of filling in the blank in `api.rb` (payment plugin API for ActiveMerchant gateways) and `application.rb` (sinatra application for ActiveMerchant integrations). Check the [Stripe plugin](https://github.com/killbill/killbill-stripe-plugin) for an example.
|
126
138
|
|
139
|
+
In case the templates behind the generator change and you want to upgrade your plugin, you can re-run the above
|
140
|
+
generate command on top of your existing code. For each file, you'll be prompted whether you want to overwrite it, show a
|
141
|
+
diff, etc.
|
142
|
+
|
127
143
|
|
128
144
|
How to expose HTTP endpoints
|
129
145
|
----------------------------
|
130
146
|
|
131
147
|
Killbill exports a Rack handler that interfaces directly with the container in which killbill-server runs (e.g. Jetty).
|
132
148
|
|
133
|
-
This basically means that Killbill will understand native Rack config.ru files placed in the root of your plugin, e.g. (using Sinatra):
|
149
|
+
This basically means that Killbill will understand native Rack config.ru files placed in the root of your plugin, e.g. (using Sinatra):
|
134
150
|
|
135
151
|
require 'sinatra'
|
136
152
|
|
@@ -168,7 +184,15 @@ To build the artifacts into pkg/:
|
|
168
184
|
# The <plugin_name>-<plugin-version>/ directory is used as a staging directory
|
169
185
|
rake killbill:package
|
170
186
|
|
187
|
+
For quick testing of your plugin, you can use the `deploy` task:
|
171
188
|
|
172
|
-
|
173
|
-
|
174
|
-
|
189
|
+
# Deploy the plugin in /var/tmp/bundles
|
190
|
+
rake killbill:deploy
|
191
|
+
# Deploy the plugin and clobber a previous version if needed
|
192
|
+
rake killbill:deploy[true]
|
193
|
+
# You can also specify a custom plugins directory as such
|
194
|
+
rake killbill:deploy[false,/path/to/bundles]
|
195
|
+
|
196
|
+
To debug packaging issues, pass `true` as the third (optional) parameter:
|
197
|
+
|
198
|
+
rake killbill:deploy[false,/path/to/bundles,true]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.4
|
@@ -1,6 +1,8 @@
|
|
1
|
-
jar 'org.kill-bill.billing:killbill-api', '0.9.
|
2
|
-
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-notification', '0.7.
|
3
|
-
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-payment', '0.7.
|
4
|
-
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-currency', '0.7.
|
5
|
-
jar 'org.kill-bill.billing:killbill-
|
1
|
+
jar 'org.kill-bill.billing:killbill-api', '0.9.6'
|
2
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-notification', '0.7.4'
|
3
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-payment', '0.7.4'
|
4
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-currency', '0.7.4'
|
5
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-retry', '0.7.4'
|
6
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-invoice', '0.7.4'
|
7
|
+
jar 'org.kill-bill.billing:killbill-util:tests', '0.11.3'
|
6
8
|
jar 'javax.servlet:javax.servlet-api', '3.0.1'
|
@@ -7,7 +7,7 @@
|
|
7
7
|
:database: test.db
|
8
8
|
# For MySQL
|
9
9
|
# :adapter: 'jdbc'
|
10
|
-
# :username: '
|
11
|
-
# :password: '
|
10
|
+
# :username: 'killbill'
|
11
|
+
# :password: 'killbill'
|
12
12
|
# :driver: 'com.mysql.jdbc.Driver'
|
13
|
-
# :url: 'jdbc:mysql://127.0.0.1:3306/
|
13
|
+
# :url: 'jdbc:mysql://127.0.0.1:3306/killbill'
|
@@ -35,6 +35,8 @@ CREATE TABLE `<%= identifier %>_transactions` (
|
|
35
35
|
`<%= identifier %>_response_id` int(11) NOT NULL,
|
36
36
|
`api_call` varchar(255) NOT NULL,
|
37
37
|
`kb_payment_id` varchar(255) NOT NULL,
|
38
|
+
`kb_payment_transaction_id` varchar(255) NOT NULL,
|
39
|
+
`transaction_type` varchar(255) NOT NULL,
|
38
40
|
`txn_id` varchar(255) NOT NULL,
|
39
41
|
`amount_in_cents` int(11) NOT NULL,
|
40
42
|
`currency` varchar(255) NOT NULL,
|
@@ -50,6 +52,8 @@ CREATE TABLE `<%= identifier %>_responses` (
|
|
50
52
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
51
53
|
`api_call` varchar(255) NOT NULL,
|
52
54
|
`kb_payment_id` varchar(255) DEFAULT NULL,
|
55
|
+
`kb_payment_transaction_id` varchar(255) DEFAULT NULL,
|
56
|
+
`transaction_type` varchar(255) DEFAULT NULL,
|
53
57
|
`message` varchar(255) DEFAULT NULL,
|
54
58
|
`authorization` varchar(255) DEFAULT NULL,
|
55
59
|
`fraud_review` tinyint(1) DEFAULT NULL,
|
@@ -36,6 +36,8 @@ ActiveRecord::Schema.define(:version => 20140410153635) do
|
|
36
36
|
t.integer "<%= identifier %>_response_id", :null => false
|
37
37
|
t.string "api_call", :null => false
|
38
38
|
t.string "kb_payment_id", :null => false
|
39
|
+
t.string "kb_payment_transaction_id", :null => false
|
40
|
+
t.string "transaction_type", :null => false
|
39
41
|
t.string "txn_id" # <%= identifier %> transaction id
|
40
42
|
t.integer "amount_in_cents", :null => false
|
41
43
|
t.string "currency", :null => false
|
@@ -50,6 +52,8 @@ ActiveRecord::Schema.define(:version => 20140410153635) do
|
|
50
52
|
create_table "<%= identifier %>_responses", :force => true do |t|
|
51
53
|
t.string "api_call", :null => false
|
52
54
|
t.string "kb_payment_id"
|
55
|
+
t.string "kb_payment_transaction_id"
|
56
|
+
t.string "transaction_type"
|
53
57
|
t.string "message"
|
54
58
|
t.string "authorization"
|
55
59
|
t.boolean "fraud_review"
|
@@ -15,60 +15,68 @@ module Killbill #:nodoc:
|
|
15
15
|
::Killbill::<%= class_name %>::<%= class_name %>Response)
|
16
16
|
end
|
17
17
|
|
18
|
-
def authorize_payment(kb_account_id, kb_payment_id, kb_payment_method_id, amount, currency, properties, context)
|
18
|
+
def authorize_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
19
19
|
# Pass extra parameters for the gateway here
|
20
20
|
options = {}
|
21
21
|
|
22
22
|
properties = merge_properties(properties, options)
|
23
|
-
super(kb_account_id, kb_payment_id, kb_payment_method_id, amount, currency, properties, context)
|
23
|
+
super(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
24
24
|
end
|
25
25
|
|
26
|
-
def capture_payment(kb_account_id, kb_payment_id, kb_payment_method_id, amount, currency, properties, context)
|
26
|
+
def capture_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
27
27
|
# Pass extra parameters for the gateway here
|
28
28
|
options = {}
|
29
29
|
|
30
30
|
properties = merge_properties(properties, options)
|
31
|
-
super(kb_account_id, kb_payment_id, kb_payment_method_id, amount, currency, properties, context)
|
31
|
+
super(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
32
32
|
end
|
33
33
|
|
34
|
-
def
|
34
|
+
def purchase_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
35
35
|
# Pass extra parameters for the gateway here
|
36
36
|
options = {}
|
37
37
|
|
38
38
|
properties = merge_properties(properties, options)
|
39
|
-
super(kb_account_id, kb_payment_id, kb_payment_method_id, properties, context)
|
39
|
+
super(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
40
40
|
end
|
41
41
|
|
42
|
-
def
|
42
|
+
def void_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, properties, context)
|
43
43
|
# Pass extra parameters for the gateway here
|
44
44
|
options = {}
|
45
45
|
|
46
46
|
properties = merge_properties(properties, options)
|
47
|
-
super(kb_account_id, kb_payment_id,
|
47
|
+
super(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, properties, context)
|
48
48
|
end
|
49
49
|
|
50
|
-
def
|
51
|
-
|
52
|
-
|
50
|
+
def credit_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
51
|
+
# Pass extra parameters for the gateway here
|
52
|
+
options = {}
|
53
53
|
|
54
|
-
|
55
|
-
super
|
54
|
+
properties = merge_properties(properties, options)
|
55
|
+
super(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
56
56
|
end
|
57
57
|
|
58
|
-
def
|
58
|
+
def refund_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
59
59
|
# Pass extra parameters for the gateway here
|
60
60
|
options = {}
|
61
61
|
|
62
62
|
properties = merge_properties(properties, options)
|
63
|
-
super(kb_account_id, kb_payment_id,
|
63
|
+
super(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
64
64
|
end
|
65
65
|
|
66
|
-
def
|
67
|
-
|
66
|
+
def get_payment_info(kb_account_id, kb_payment_id, properties, context)
|
67
|
+
# Pass extra parameters for the gateway here
|
68
|
+
options = {}
|
69
|
+
|
70
|
+
properties = merge_properties(properties, options)
|
71
|
+
super(kb_account_id, kb_payment_id, properties, context)
|
68
72
|
end
|
69
73
|
|
70
|
-
def
|
71
|
-
|
74
|
+
def search_payments(search_key, offset, limit, properties, context)
|
75
|
+
# Pass extra parameters for the gateway here
|
76
|
+
options = {}
|
77
|
+
|
78
|
+
properties = merge_properties(properties, options)
|
79
|
+
super(search_key, offset, limit, properties, context)
|
72
80
|
end
|
73
81
|
|
74
82
|
def add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default, properties, context)
|
@@ -88,7 +96,11 @@ module Killbill #:nodoc:
|
|
88
96
|
end
|
89
97
|
|
90
98
|
def get_payment_method_detail(kb_account_id, kb_payment_method_id, properties, context)
|
91
|
-
|
99
|
+
# Pass extra parameters for the gateway here
|
100
|
+
options = {}
|
101
|
+
|
102
|
+
properties = merge_properties(properties, options)
|
103
|
+
super(kb_account_id, kb_payment_method_id, properties, context)
|
92
104
|
end
|
93
105
|
|
94
106
|
def set_default_payment_method(kb_account_id, kb_payment_method_id, properties, context)
|
@@ -96,11 +108,19 @@ module Killbill #:nodoc:
|
|
96
108
|
end
|
97
109
|
|
98
110
|
def get_payment_methods(kb_account_id, refresh_from_gateway, properties, context)
|
99
|
-
|
111
|
+
# Pass extra parameters for the gateway here
|
112
|
+
options = {}
|
113
|
+
|
114
|
+
properties = merge_properties(properties, options)
|
115
|
+
super(kb_account_id, refresh_from_gateway, properties, context)
|
100
116
|
end
|
101
117
|
|
102
118
|
def search_payment_methods(search_key, offset, limit, properties, context)
|
103
|
-
|
119
|
+
# Pass extra parameters for the gateway here
|
120
|
+
options = {}
|
121
|
+
|
122
|
+
properties = merge_properties(properties, options)
|
123
|
+
super(search_key, offset, limit, properties, context)
|
104
124
|
end
|
105
125
|
|
106
126
|
def reset_payment_methods(kb_account_id, payment_methods, properties, context)
|
@@ -6,10 +6,12 @@ module Killbill #:nodoc:
|
|
6
6
|
|
7
7
|
has_one :<%= identifier %>_transaction
|
8
8
|
|
9
|
-
def self.from_response(api_call, kb_account_id, kb_payment_id, kb_tenant_id, response, extra_params = {})
|
9
|
+
def self.from_response(api_call, kb_account_id, kb_payment_id, kb_payment_transaction_id, transaction_type, kb_tenant_id, response, extra_params = {})
|
10
10
|
super(api_call,
|
11
11
|
kb_account_id,
|
12
12
|
kb_payment_id,
|
13
|
+
kb_payment_transaction_id,
|
14
|
+
transaction_type,
|
13
15
|
kb_tenant_id,
|
14
16
|
response,
|
15
17
|
{
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
|
23
23
|
s.rdoc_options << '--exclude' << '.'
|
24
24
|
|
25
|
-
s.add_dependency 'killbill', '~> 3.1.
|
25
|
+
s.add_dependency 'killbill', '~> 3.1.4'
|
26
26
|
s.add_dependency 'activemerchant', '~> 1.42.9'
|
27
27
|
s.add_dependency 'activerecord', '~> 4.1.0'
|
28
28
|
s.add_dependency 'actionpack', '~> 4.1.0'
|
data/lib/killbill.rb
CHANGED
@@ -24,15 +24,18 @@ begin
|
|
24
24
|
IMPORT_KILLBILL_APIS = %w(
|
25
25
|
org.killbill.billing.account.api.AccountUserApi
|
26
26
|
org.killbill.billing.catalog.api.CatalogUserApi
|
27
|
-
org.killbill.billing.
|
27
|
+
org.killbill.billing.currency.api.CurrencyConversionApi
|
28
28
|
org.killbill.billing.entitlement.api.EntitlementApi
|
29
29
|
org.killbill.billing.entitlement.api.SubscriptionApi
|
30
|
+
org.killbill.billing.invoice.api.InvoicePaymentApi
|
30
31
|
org.killbill.billing.invoice.api.InvoiceUserApi
|
31
|
-
org.killbill.billing.
|
32
|
-
org.killbill.billing.payment.api.
|
32
|
+
org.killbill.billing.payment.api.DirectPaymentApi
|
33
|
+
org.killbill.billing.payment.api.PaymentGatewayApi
|
34
|
+
org.killbill.billing.tenant.api.TenantUserApi
|
35
|
+
org.killbill.billing.usage.api.UsageUserApi
|
36
|
+
org.killbill.billing.util.api.AuditUserApi
|
33
37
|
org.killbill.billing.util.api.CustomFieldUserApi
|
34
38
|
org.killbill.billing.util.api.TagUserApi
|
35
|
-
org.killbill.billing.currency.api.CurrencyConversionApi
|
36
39
|
javax.servlet.http.HttpServlet
|
37
40
|
)
|
38
41
|
|
@@ -1,10 +1,11 @@
|
|
1
1
|
###################################################################################
|
2
2
|
# #
|
3
3
|
# Copyright 2010-2013 Ning, Inc. #
|
4
|
+
# Copyright 2014 The Billing Project, LLC #
|
4
5
|
# #
|
5
|
-
#
|
6
|
-
# (the "License"); you may not use this file except in
|
7
|
-
# License. You may obtain a copy of the License at:
|
6
|
+
# The Billing Project licenses this file to you under the Apache License, #
|
7
|
+
# version 2.0 (the "License"); you may not use this file except in #
|
8
|
+
# compliance with the License. You may obtain a copy of the License at: #
|
8
9
|
# #
|
9
10
|
# http://www.apache.org/licenses/LICENSE-2.0 #
|
10
11
|
# #
|
@@ -1,10 +1,11 @@
|
|
1
1
|
###################################################################################
|
2
2
|
# #
|
3
3
|
# Copyright 2010-2013 Ning, Inc. #
|
4
|
+
# Copyright 2014 The Billing Project, LLC #
|
4
5
|
# #
|
5
|
-
#
|
6
|
-
# (the "License"); you may not use this file except in
|
7
|
-
# License. You may obtain a copy of the License at:
|
6
|
+
# The Billing Project licenses this file to you under the Apache License, #
|
7
|
+
# version 2.0 (the "License"); you may not use this file except in #
|
8
|
+
# compliance with the License. You may obtain a copy of the License at: #
|
8
9
|
# #
|
9
10
|
# http://www.apache.org/licenses/LICENSE-2.0 #
|
10
11
|
# #
|
@@ -1,10 +1,11 @@
|
|
1
1
|
###################################################################################
|
2
2
|
# #
|
3
3
|
# Copyright 2010-2013 Ning, Inc. #
|
4
|
+
# Copyright 2014 The Billing Project, LLC #
|
4
5
|
# #
|
5
|
-
#
|
6
|
-
# (the "License"); you may not use this file except in
|
7
|
-
# License. You may obtain a copy of the License at:
|
6
|
+
# The Billing Project licenses this file to you under the Apache License, #
|
7
|
+
# version 2.0 (the "License"); you may not use this file except in #
|
8
|
+
# compliance with the License. You may obtain a copy of the License at: #
|
8
9
|
# #
|
9
10
|
# http://www.apache.org/licenses/LICENSE-2.0 #
|
10
11
|
# #
|
@@ -32,7 +33,7 @@ module Killbill
|
|
32
33
|
|
33
34
|
include org.killbill.billing.util.audit.AccountAuditLogs
|
34
35
|
|
35
|
-
attr_accessor :audit_logs_for_account, :audit_logs_for_bundle, :audit_logs_for_subscription, :audit_logs_for_subscription_event, :audit_logs_for_blocking_state, :audit_logs_for_invoice, :audit_logs_for_invoice_item, :audit_logs_for_invoice_payment, :audit_logs_for_payment, :
|
36
|
+
attr_accessor :audit_logs_for_account, :audit_logs_for_bundle, :audit_logs_for_subscription, :audit_logs_for_subscription_event, :audit_logs_for_blocking_state, :audit_logs_for_invoice, :audit_logs_for_invoice_item, :audit_logs_for_invoice_payment, :audit_logs_for_payment, :audit_logs_for_payment_transaction, :audit_logs_for_payment_method, :audit_logs_for_tag, :audit_logs_for_custom_field, :audit_logs
|
36
37
|
|
37
38
|
def initialize()
|
38
39
|
end
|
@@ -119,23 +120,14 @@ module Killbill
|
|
119
120
|
end
|
120
121
|
@audit_logs_for_payment = tmp
|
121
122
|
|
122
|
-
# conversion for
|
123
|
+
# conversion for audit_logs_for_payment_transaction [type = java.util.List]
|
123
124
|
tmp = java.util.ArrayList.new
|
124
|
-
(@
|
125
|
+
(@audit_logs_for_payment_transaction || []).each do |m|
|
125
126
|
# conversion for m [type = org.killbill.billing.util.audit.AuditLog]
|
126
127
|
m = m.to_java unless m.nil?
|
127
128
|
tmp.add(m)
|
128
129
|
end
|
129
|
-
@
|
130
|
-
|
131
|
-
# conversion for audit_logs_for_direct_payment_transaction [type = java.util.List]
|
132
|
-
tmp = java.util.ArrayList.new
|
133
|
-
(@audit_logs_for_direct_payment_transaction || []).each do |m|
|
134
|
-
# conversion for m [type = org.killbill.billing.util.audit.AuditLog]
|
135
|
-
m = m.to_java unless m.nil?
|
136
|
-
tmp.add(m)
|
137
|
-
end
|
138
|
-
@audit_logs_for_direct_payment_transaction = tmp
|
130
|
+
@audit_logs_for_payment_transaction = tmp
|
139
131
|
|
140
132
|
# conversion for audit_logs_for_payment_method [type = java.util.List]
|
141
133
|
tmp = java.util.ArrayList.new
|
@@ -146,24 +138,6 @@ module Killbill
|
|
146
138
|
end
|
147
139
|
@audit_logs_for_payment_method = tmp
|
148
140
|
|
149
|
-
# conversion for audit_logs_for_refund [type = java.util.List]
|
150
|
-
tmp = java.util.ArrayList.new
|
151
|
-
(@audit_logs_for_refund || []).each do |m|
|
152
|
-
# conversion for m [type = org.killbill.billing.util.audit.AuditLog]
|
153
|
-
m = m.to_java unless m.nil?
|
154
|
-
tmp.add(m)
|
155
|
-
end
|
156
|
-
@audit_logs_for_refund = tmp
|
157
|
-
|
158
|
-
# conversion for audit_logs_for_chargeback [type = java.util.List]
|
159
|
-
tmp = java.util.ArrayList.new
|
160
|
-
(@audit_logs_for_chargeback || []).each do |m|
|
161
|
-
# conversion for m [type = org.killbill.billing.util.audit.AuditLog]
|
162
|
-
m = m.to_java unless m.nil?
|
163
|
-
tmp.add(m)
|
164
|
-
end
|
165
|
-
@audit_logs_for_chargeback = tmp
|
166
|
-
|
167
141
|
# conversion for audit_logs_for_tag [type = java.util.List]
|
168
142
|
tmp = java.util.ArrayList.new
|
169
143
|
(@audit_logs_for_tag || []).each do |m|
|
@@ -278,25 +252,15 @@ module Killbill
|
|
278
252
|
end
|
279
253
|
@audit_logs_for_payment = tmp
|
280
254
|
|
281
|
-
# conversion for
|
282
|
-
@
|
255
|
+
# conversion for audit_logs_for_payment_transaction [type = java.util.List]
|
256
|
+
@audit_logs_for_payment_transaction = j_obj.audit_logs_for_payment_transaction
|
283
257
|
tmp = []
|
284
|
-
(@
|
258
|
+
(@audit_logs_for_payment_transaction || []).each do |m|
|
285
259
|
# conversion for m [type = org.killbill.billing.util.audit.AuditLog]
|
286
260
|
m = Killbill::Plugin::Model::AuditLog.new.to_ruby(m) unless m.nil?
|
287
261
|
tmp << m
|
288
262
|
end
|
289
|
-
@
|
290
|
-
|
291
|
-
# conversion for audit_logs_for_direct_payment_transaction [type = java.util.List]
|
292
|
-
@audit_logs_for_direct_payment_transaction = j_obj.audit_logs_for_direct_payment_transaction
|
293
|
-
tmp = []
|
294
|
-
(@audit_logs_for_direct_payment_transaction || []).each do |m|
|
295
|
-
# conversion for m [type = org.killbill.billing.util.audit.AuditLog]
|
296
|
-
m = Killbill::Plugin::Model::AuditLog.new.to_ruby(m) unless m.nil?
|
297
|
-
tmp << m
|
298
|
-
end
|
299
|
-
@audit_logs_for_direct_payment_transaction = tmp
|
263
|
+
@audit_logs_for_payment_transaction = tmp
|
300
264
|
|
301
265
|
# conversion for audit_logs_for_payment_method [type = java.util.List]
|
302
266
|
@audit_logs_for_payment_method = j_obj.audit_logs_for_payment_method
|
@@ -308,26 +272,6 @@ module Killbill
|
|
308
272
|
end
|
309
273
|
@audit_logs_for_payment_method = tmp
|
310
274
|
|
311
|
-
# conversion for audit_logs_for_refund [type = java.util.List]
|
312
|
-
@audit_logs_for_refund = j_obj.audit_logs_for_refund
|
313
|
-
tmp = []
|
314
|
-
(@audit_logs_for_refund || []).each do |m|
|
315
|
-
# conversion for m [type = org.killbill.billing.util.audit.AuditLog]
|
316
|
-
m = Killbill::Plugin::Model::AuditLog.new.to_ruby(m) unless m.nil?
|
317
|
-
tmp << m
|
318
|
-
end
|
319
|
-
@audit_logs_for_refund = tmp
|
320
|
-
|
321
|
-
# conversion for audit_logs_for_chargeback [type = java.util.List]
|
322
|
-
@audit_logs_for_chargeback = j_obj.audit_logs_for_chargeback
|
323
|
-
tmp = []
|
324
|
-
(@audit_logs_for_chargeback || []).each do |m|
|
325
|
-
# conversion for m [type = org.killbill.billing.util.audit.AuditLog]
|
326
|
-
m = Killbill::Plugin::Model::AuditLog.new.to_ruby(m) unless m.nil?
|
327
|
-
tmp << m
|
328
|
-
end
|
329
|
-
@audit_logs_for_chargeback = tmp
|
330
|
-
|
331
275
|
# conversion for audit_logs_for_tag [type = java.util.List]
|
332
276
|
@audit_logs_for_tag = j_obj.audit_logs_for_tag
|
333
277
|
tmp = []
|