killbill-stripe 4.1.0 → 4.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/NEWS DELETED
@@ -1,37 +0,0 @@
1
- 4.1.0
2
- Initial release for Kill Bill 0.18.x
3
-
4
- 4.0.0
5
- Initial release for Kill Bill 0.17.x
6
-
7
- 3.0.2
8
- Allow override of the Stripe customer id in the add_payment_method call
9
-
10
- 3.0.1
11
- https://github.com/killbill/killbill-stripe-plugin/issues/8
12
-
13
- 3.0.0
14
- Initial release for Kill Bill 0.16.x
15
-
16
- 2.0.0
17
- Initial release for Kill Bill 0.15.x
18
-
19
- 1.0.0
20
- Initial release for Kill Bill 0.14.x
21
-
22
- 0.2.3
23
- Add thread_safe dependency
24
-
25
- 0.2.2
26
- Initial release for Kill Bill 0.13.x
27
- Stripe API version 2015-02-18 compatibility
28
- https://github.com/killbill/killbill-plugin-framework-ruby/issues/13
29
-
30
- 0.2.1
31
- Add missing require 'openssl'
32
-
33
- 0.2.0
34
- Initial release for Kill Bill 0.12.x
35
-
36
- 0.1.0
37
- Initial release
data/README.md DELETED
@@ -1,159 +0,0 @@
1
- killbill-stripe-plugin
2
- ======================
3
-
4
- Plugin to use [Stripe](https://stripe.com/) as a gateway.
5
-
6
- Release builds are available on [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.kill-bill.billing.plugin.ruby%22%20AND%20a%3A%22stripe-plugin%22) with coordinates `org.kill-bill.billing.plugin.ruby:stripe-plugin`.
7
-
8
- A full end-to-end integration demo is available [here](https://github.com/killbill/killbill-stripe-demo).
9
-
10
- Kill Bill compatibility
11
- -----------------------
12
-
13
- | Plugin version | Kill Bill version | Stripe version |
14
- | -------------: | -----------------: | --------------------------------------------------------: |
15
- | 1.x.y | 0.14.z | [2015-02-18](https://stripe.com/docs/upgrades#2015-02-18) |
16
- | 2.x.y | 0.15.z | [2015-02-18](https://stripe.com/docs/upgrades#2015-02-18) |
17
- | 3.x.y | 0.16.z | [2015-02-18](https://stripe.com/docs/upgrades#2015-02-18) |
18
- | 4.x.y | 0.17.z | [2015-02-18](https://stripe.com/docs/upgrades#2015-02-18) |
19
-
20
- Requirements
21
- ------------
22
-
23
- The plugin needs a database. The latest version of the schema can be found [here](https://github.com/killbill/killbill-stripe-plugin/blob/master/db/ddl.sql).
24
-
25
- Configuration
26
- -------------
27
-
28
- ```
29
- curl -v \
30
- -X POST \
31
- -u admin:password \
32
- -H 'X-Killbill-ApiKey: bob' \
33
- -H 'X-Killbill-ApiSecret: lazar' \
34
- -H 'X-Killbill-CreatedBy: admin' \
35
- -H 'Content-Type: text/plain' \
36
- -d ':stripe:
37
- :api_secret_key: "your-secret-key"
38
- :api_publishable_key: "your-publishable-key"
39
- :fees_amount: "default-fees-amount-for-connect"
40
- :fees_percent: "default-fees-percent-for-connect"' \
41
- http://127.0.0.1:8080/1.0/kb/tenants/uploadPluginConfig/killbill-stripe
42
- ```
43
-
44
- To get your credentials:
45
-
46
- 1. Go to [stripe.com](http://stripe.com/) and create an account. This account will be used as a sandbox environment for testing.
47
- 2. In your Stripe account, click on **Your Account** (top right), then click on **Account Settings** and then on the **API Keys** tab. Write down your keys.
48
-
49
- For Connect, you can configure a default fees amount (`fees_amount`) or percentage (`fees_percent`, such as .3 for 30%). These can be modified on a per request basis by passing the plugin property `fees_amount` or `fees_percent`.
50
- You'll also need to add a row to the `stripe_application_fees` table and add a percent (such as .3 for 30%) to the `application_fee` field.
51
-
52
- To go to production, create a `stripe.yml` configuration file under `/var/tmp/bundles/plugins/ruby/killbill-stripe/x.y.z/` containing the following:
53
-
54
- ```
55
- :stripe:
56
- :test: false
57
- ```
58
-
59
- Usage
60
- -----
61
-
62
- You would typically implement [Stripe.js](https://stripe.com/docs/stripe.js) to tokenize credit cards.
63
-
64
- After receiving the token from Stripe, create a Kill Bill payment method associated with it as such:
65
-
66
- ```
67
- curl -v \
68
- -X POST \
69
- -u admin:password \
70
- -H 'X-Killbill-ApiKey: bob' \
71
- -H 'X-Killbill-ApiSecret: lazar' \
72
- -H 'X-Killbill-CreatedBy: admin' \
73
- -H 'Content-Type: application/json' \
74
- -d '{
75
- "pluginName": "killbill-stripe",
76
- "pluginInfo": {
77
- "properties": [{
78
- "key": "token",
79
- "value": "tok_20G53990M6953444J"
80
- }]
81
- }
82
- }' \
83
- "http://127.0.0.1:8080/1.0/kb/accounts/<KB_ACCOUNT_ID>/paymentMethods?isDefault=true"
84
- ```
85
-
86
- An example implementation is exposed at:
87
-
88
- ```
89
- http://127.0.0.1:8080/plugins/killbill-stripe?kb_account_id=<KB_ACCOUNT_ID>&kb_tenant_id=<KB_TENANT_ID>
90
- ```
91
-
92
- After entering you credit card, this demo page will:
93
-
94
- * Tokenize it in Stripe (JS call)
95
- * Call Kill Bill during the redirect to create a payment method for that token
96
- * Output the result of the tokenization call
97
-
98
- ### Connect
99
-
100
- Managed accounts must first have their own account in Kill Bill. Then, create them in Stripe using `POST /plugins/killbill-stripe/accounts`:
101
-
102
- ```
103
- curl -v -X POST \
104
- -d '{
105
- "legal_entity": {
106
- "address": {
107
- "city": "San Francisco",
108
- "country": "US"
109
- },
110
- "dob": {
111
- "day": 31,
112
- "month": 12,
113
- "year": 1969
114
- },
115
- "first_name": "Jane",
116
- "last_name": "Doe"",
117
- "type": "individual"
118
- }' \
119
- http://127.0.0.1:8080/plugins/killbill-stripe/accounts?kb_account_id=<KB_ACCOUNT_ID>&kb_tenant_id=<KB_TENANT_ID>
120
- ```
121
-
122
- When charging customers, you can now pass the Kill Bill account id of the managed account as the `destination` plugin property.
123
-
124
- See the [Stripe documentation](https://stripe.com/docs/connect/managed-accounts#creating-a-managed-account) for more details.
125
-
126
- Plugin properties
127
- -----------------
128
-
129
- | Key | Description |
130
- | ---------------------------: | ----------------------------------------------------------------- |
131
- | skip_gw | If true, skip the call to Stripe |
132
- | payment_processor_account_id | Config entry name of the merchant account to use |
133
- | external_key_as_order_id | If true, set the payment external key as the Stripe order id |
134
- | customer | Stripe customer id |
135
- | token | Stripe token |
136
- | cc_first_name | Credit card holder first name |
137
- | cc_last_name | Credit card holder last name |
138
- | cc_type | Credit card brand |
139
- | cc_expiration_month | Credit card expiration month |
140
- | cc_expiration_year | Credit card expiration year |
141
- | cc_verification_value | CVC/CVV/CVN |
142
- | email | Purchaser email |
143
- | address1 | Billing address first line |
144
- | address2 | Billing address second line |
145
- | city | Billing address city |
146
- | zip | Billing address zip code |
147
- | state | Billing address state |
148
- | country | Billing address country |
149
- | eci | Network tokenization attribute |
150
- | payment_cryptogram | Network tokenization attribute |
151
- | transaction_id | Network tokenization attribute |
152
- | payment_instrument_name | ApplePay tokenization attribute |
153
- | payment_network | ApplePay tokenization attribute |
154
- | transaction_identifier | ApplePay tokenization attribute |
155
- | destination | [Connect] KB account id of the receiving account |
156
- | fees_amount | [Connect] Amount in cents of fees to collect |
157
- | fees_percent | [Connect] Percentage amount of fees to collect |
158
- | reverse_transfer | [Connect] True if the transfer should be reversed when refunding |
159
- | refund_application_fee | [Connect] True if fees should be refunded when refunding |
data/Rakefile DELETED
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env rake
2
-
3
- # Install tasks to build and release the plugin
4
- require 'bundler/setup'
5
- Bundler::GemHelper.install_tasks
6
-
7
- # Install test tasks
8
- require 'rspec/core/rake_task'
9
- namespace :test do
10
- desc 'Run RSpec tests'
11
- RSpec::Core::RakeTask.new do |task|
12
- task.name = 'spec'
13
- task.pattern = './spec/*/*_spec.rb'
14
- end
15
-
16
- namespace :remote do
17
- desc 'Run RSpec remote tests'
18
- RSpec::Core::RakeTask.new do |task|
19
- task.name = 'spec'
20
- task.pattern = './spec/*/remote/*_spec.rb'
21
- end
22
- end
23
- end
24
-
25
- # Install tasks to package the plugin for Killbill
26
- require 'killbill/rake_task'
27
- Killbill::PluginHelper.install_tasks
28
-
29
- # Run tests by default
30
- task :default => 'test:spec'
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 4.1.0
data/config.ru DELETED
@@ -1,4 +0,0 @@
1
- require 'stripe'
2
- require 'stripe/application'
3
-
4
- run Sinatra::Application
data/db/ddl.sql DELETED
@@ -1,124 +0,0 @@
1
- CREATE TABLE stripe_payment_methods (
2
- id serial unique,
3
- kb_payment_method_id varchar(255) DEFAULT NULL,
4
- token varchar(255) DEFAULT NULL,
5
- stripe_customer_id varchar(255) DEFAULT NULL,
6
- cc_first_name varchar(255) DEFAULT NULL,
7
- cc_last_name varchar(255) DEFAULT NULL,
8
- cc_type varchar(255) DEFAULT NULL,
9
- cc_exp_month varchar(255) DEFAULT NULL,
10
- cc_exp_year varchar(255) DEFAULT NULL,
11
- cc_number varchar(255) DEFAULT NULL,
12
- cc_last_4 varchar(255) DEFAULT NULL,
13
- cc_start_month varchar(255) DEFAULT NULL,
14
- cc_start_year varchar(255) DEFAULT NULL,
15
- cc_issue_number varchar(255) DEFAULT NULL,
16
- cc_verification_value varchar(255) DEFAULT NULL,
17
- cc_track_data varchar(255) DEFAULT NULL,
18
- address1 varchar(255) DEFAULT NULL,
19
- address2 varchar(255) DEFAULT NULL,
20
- city varchar(255) DEFAULT NULL,
21
- state varchar(255) DEFAULT NULL,
22
- zip varchar(255) DEFAULT NULL,
23
- country varchar(255) DEFAULT NULL,
24
- is_deleted boolean NOT NULL DEFAULT '0',
25
- created_at datetime NOT NULL,
26
- updated_at datetime NOT NULL,
27
- kb_account_id varchar(255) DEFAULT NULL,
28
- kb_tenant_id varchar(255) DEFAULT NULL,
29
- PRIMARY KEY (id)
30
- ) /*! ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin */;
31
- CREATE INDEX index_stripe_payment_methods_kb_account_id ON stripe_payment_methods(kb_account_id);
32
- CREATE INDEX index_stripe_payment_methods_kb_payment_method_id ON stripe_payment_methods(kb_payment_method_id);
33
-
34
- CREATE TABLE stripe_transactions (
35
- id serial unique,
36
- stripe_response_id bigint /*! unsigned */ NOT NULL,
37
- api_call varchar(255) NOT NULL,
38
- kb_payment_id varchar(255) NOT NULL,
39
- kb_payment_transaction_id varchar(255) NOT NULL,
40
- transaction_type varchar(255) NOT NULL,
41
- payment_processor_account_id varchar(255) DEFAULT NULL,
42
- txn_id varchar(255) DEFAULT NULL,
43
- amount_in_cents int DEFAULT NULL,
44
- currency varchar(255) DEFAULT NULL,
45
- created_at datetime NOT NULL,
46
- updated_at datetime NOT NULL,
47
- kb_account_id varchar(255) NOT NULL,
48
- kb_tenant_id varchar(255) NOT NULL,
49
- PRIMARY KEY (id)
50
- ) /*! ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin */;
51
- CREATE INDEX index_stripe_transactions_kb_payment_id ON stripe_transactions(kb_payment_id);
52
- CREATE INDEX index_stripe_transactions_stripe_response_id ON stripe_transactions(stripe_response_id);
53
-
54
- CREATE TABLE stripe_responses (
55
- id serial unique,
56
- api_call varchar(255) NOT NULL,
57
- kb_payment_id varchar(255) DEFAULT NULL,
58
- kb_payment_transaction_id varchar(255) DEFAULT NULL,
59
- transaction_type varchar(255) DEFAULT NULL,
60
- payment_processor_account_id varchar(255) DEFAULT NULL,
61
- message varchar(255) DEFAULT NULL,
62
- authorisation varchar(255) DEFAULT NULL,
63
- fraud_review boolean DEFAULT NULL,
64
- test boolean DEFAULT NULL,
65
- params_id varchar(255) DEFAULT NULL,
66
- params_object varchar(255) DEFAULT NULL,
67
- params_created varchar(255) DEFAULT NULL,
68
- params_livemode varchar(255) DEFAULT NULL,
69
- params_paid varchar(255) DEFAULT NULL,
70
- params_amount varchar(255) DEFAULT NULL,
71
- params_currency varchar(255) DEFAULT NULL,
72
- params_refunded varchar(255) DEFAULT NULL,
73
- params_card_id varchar(255) DEFAULT NULL,
74
- params_card_object varchar(255) DEFAULT NULL,
75
- params_card_last4 varchar(255) DEFAULT NULL,
76
- params_card_type varchar(255) DEFAULT NULL,
77
- params_card_exp_month varchar(255) DEFAULT NULL,
78
- params_card_exp_year varchar(255) DEFAULT NULL,
79
- params_card_fingerprint varchar(255) DEFAULT NULL,
80
- params_card_customer varchar(255) DEFAULT NULL,
81
- params_card_country varchar(255) DEFAULT NULL,
82
- params_card_name varchar(255) DEFAULT NULL,
83
- params_card_address_line1 varchar(255) DEFAULT NULL,
84
- params_card_address_line2 varchar(255) DEFAULT NULL,
85
- params_card_address_city varchar(255) DEFAULT NULL,
86
- params_card_address_state varchar(255) DEFAULT NULL,
87
- params_card_address_zip varchar(255) DEFAULT NULL,
88
- params_card_address_country varchar(255) DEFAULT NULL,
89
- params_card_cvc_check varchar(255) DEFAULT NULL,
90
- params_card_address_line1_check varchar(255) DEFAULT NULL,
91
- params_card_address_zip_check varchar(255) DEFAULT NULL,
92
- params_captured varchar(255) DEFAULT NULL,
93
- params_refunds text DEFAULT NULL,
94
- params_balance_transaction varchar(255) DEFAULT NULL,
95
- params_failure_message varchar(255) DEFAULT NULL,
96
- params_failure_code varchar(255) DEFAULT NULL,
97
- params_amount_refunded varchar(255) DEFAULT NULL,
98
- params_customer varchar(255) DEFAULT NULL,
99
- params_email varchar(255) DEFAULT NULL,
100
- params_delinquent varchar(255) DEFAULT NULL,
101
- params_subscription varchar(255) DEFAULT NULL,
102
- params_discount varchar(255) DEFAULT NULL,
103
- params_account_balance varchar(255) DEFAULT NULL,
104
- params_cards text DEFAULT NULL,
105
- params_invoice varchar(255) DEFAULT NULL,
106
- params_description varchar(255) DEFAULT NULL,
107
- params_dispute varchar(255) DEFAULT NULL,
108
- params_metadata varchar(255) DEFAULT NULL,
109
- params_error_type varchar(255) DEFAULT NULL,
110
- params_error_message varchar(255) DEFAULT NULL,
111
- avs_result_code varchar(255) DEFAULT NULL,
112
- avs_result_message varchar(255) DEFAULT NULL,
113
- avs_result_street_match varchar(255) DEFAULT NULL,
114
- avs_result_postal_match varchar(255) DEFAULT NULL,
115
- cvv_result_code varchar(255) DEFAULT NULL,
116
- cvv_result_message varchar(255) DEFAULT NULL,
117
- success boolean DEFAULT NULL,
118
- created_at datetime NOT NULL,
119
- updated_at datetime NOT NULL,
120
- kb_account_id varchar(255) DEFAULT NULL,
121
- kb_tenant_id varchar(255) DEFAULT NULL,
122
- PRIMARY KEY (id)
123
- ) /*! ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin */;
124
- CREATE INDEX index_stripe_responses_kb_payment_id_kb_tenant_id ON stripe_responses(kb_payment_id, kb_tenant_id);
data/db/schema.rb DELETED
@@ -1,126 +0,0 @@
1
- require 'active_record'
2
-
3
- ActiveRecord::Schema.define(:version => 20140410153635) do
4
- create_table "stripe_payment_methods", :force => true do |t|
5
- t.string "kb_payment_method_id" # NULL before Kill Bill knows about it
6
- t.string "token" # stripe id
7
- t.string "stripe_customer_id"
8
- t.string "cc_first_name"
9
- t.string "cc_last_name"
10
- t.string "cc_type"
11
- t.string "cc_exp_month"
12
- t.string "cc_exp_year"
13
- t.string "cc_number"
14
- t.string "cc_last_4"
15
- t.string "cc_start_month"
16
- t.string "cc_start_year"
17
- t.string "cc_issue_number"
18
- t.string "cc_verification_value"
19
- t.string "cc_track_data"
20
- t.string "address1"
21
- t.string "address2"
22
- t.string "city"
23
- t.string "state"
24
- t.string "zip"
25
- t.string "country"
26
- t.boolean "is_deleted", :null => false, :default => false
27
- t.datetime "created_at", :null => false
28
- t.datetime "updated_at", :null => false
29
- t.string "kb_account_id"
30
- t.string "kb_tenant_id"
31
- end
32
-
33
- add_index(:stripe_payment_methods, :kb_account_id)
34
- add_index(:stripe_payment_methods, :kb_payment_method_id)
35
-
36
- create_table "stripe_transactions", :force => true do |t|
37
- t.integer "stripe_response_id", :null => false
38
- t.string "api_call", :null => false
39
- t.string "kb_payment_id", :null => false
40
- t.string "kb_payment_transaction_id", :null => false
41
- t.string "transaction_type", :null => false
42
- t.string "payment_processor_account_id"
43
- t.string "txn_id" # stripe transaction id
44
- # Both null for void
45
- t.integer "amount_in_cents"
46
- t.string "currency"
47
- t.datetime "created_at", :null => false
48
- t.datetime "updated_at", :null => false
49
- t.string "kb_account_id", :null => false
50
- t.string "kb_tenant_id", :null => false
51
- end
52
-
53
- add_index(:stripe_transactions, :kb_payment_id)
54
- add_index(:stripe_transactions, :stripe_response_id)
55
-
56
- create_table "stripe_responses", :force => true do |t|
57
- t.string "api_call", :null => false
58
- t.string "kb_payment_id"
59
- t.string "kb_payment_transaction_id"
60
- t.string "transaction_type"
61
- t.string "payment_processor_account_id"
62
- t.string "message"
63
- t.string "authorization"
64
- t.boolean "fraud_review"
65
- t.boolean "test"
66
- t.string "params_id"
67
- t.string "params_object"
68
- t.string "params_created"
69
- t.string "params_livemode"
70
- t.string "params_paid"
71
- t.string "params_amount"
72
- t.string "params_currency"
73
- t.string "params_refunded"
74
- t.string "params_card_id"
75
- t.string "params_card_object"
76
- t.string "params_card_last4"
77
- t.string "params_card_type"
78
- t.string "params_card_exp_month"
79
- t.string "params_card_exp_year"
80
- t.string "params_card_fingerprint"
81
- t.string "params_card_customer"
82
- t.string "params_card_country"
83
- t.string "params_card_name"
84
- t.string "params_card_address_line1"
85
- t.string "params_card_address_line2"
86
- t.string "params_card_address_city"
87
- t.string "params_card_address_state"
88
- t.string "params_card_address_zip"
89
- t.string "params_card_address_country"
90
- t.string "params_card_cvc_check"
91
- t.string "params_card_address_line1_check"
92
- t.string "params_card_address_zip_check"
93
- t.string "params_captured"
94
- t.text "params_refunds"
95
- t.string "params_balance_transaction"
96
- t.string "params_failure_message"
97
- t.string "params_failure_code"
98
- t.string "params_amount_refunded"
99
- t.string "params_customer"
100
- t.string "params_email"
101
- t.string "params_delinquent"
102
- t.string "params_subscription"
103
- t.string "params_discount"
104
- t.string "params_account_balance"
105
- t.text "params_cards"
106
- t.string "params_invoice"
107
- t.string "params_description"
108
- t.string "params_dispute"
109
- t.string "params_metadata"
110
- t.string "params_error_type"
111
- t.string "params_error_message"
112
- t.string "avs_result_code"
113
- t.string "avs_result_message"
114
- t.string "avs_result_street_match"
115
- t.string "avs_result_postal_match"
116
- t.string "cvv_result_code"
117
- t.string "cvv_result_message"
118
- t.boolean "success"
119
- t.datetime "created_at", :null => false
120
- t.datetime "updated_at", :null => false
121
- t.string "kb_account_id"
122
- t.string "kb_tenant_id"
123
- end
124
-
125
- add_index(:stripe_responses, [:kb_payment_id, :kb_tenant_id])
126
- end