bullet_train 1.41.0 → 1.42.0
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/app/views/devise/confirmations/new.html.erb +1 -1
- data/app/views/devise/registrations/edit.html.erb +1 -1
- data/app/views/devise/unlocks/new.html.erb +1 -1
- data/config/initializers/action_text_sanitzer.rb +8 -0
- data/config/locales/en/users.en.yml +1 -1
- data/docs/billing/stripe.md +29 -4
- data/lib/bullet_train/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6895bf64ffc5e161994dad5e10a2c7cc45d2a0249976a4b6bedb4c3b1fac5f88
|
|
4
|
+
data.tar.gz: effb6a1b210cceaeaf293798254d397c3472669cbe12c41bb6542b86731c2b70
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 47b4b64bc3390a73ecdd1787c229b522717c813aee82b144ff276ff20a169b0ee4fad84a0cce8f34ad91866bfc1a317b9f678e98c347c5798358b036d8e05c15
|
|
7
|
+
data.tar.gz: 5c0a516a131e1b26de9cbb1770950d0e4133f055ba45e022efa51baf8db2f648a1870f1e562cb1ca2266c05612dd0ede1e9a57e1c0fb812f9467fd9ec2c5c1f7
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<h2><%= t('device.headers.resend_confirm') %></h2>
|
|
2
2
|
|
|
3
3
|
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
|
|
4
|
-
<%=
|
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
5
5
|
|
|
6
6
|
<div class="field">
|
|
7
7
|
<%= f.label :email %><br />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<h2><%= t('devise.headers.edit_registration', resource_name: resource_name.to_s.humanize) %></h2>
|
|
2
2
|
|
|
3
3
|
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
|
4
|
-
<%=
|
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
5
5
|
|
|
6
6
|
<div class="field">
|
|
7
7
|
<%= f.label :email %><br />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<h2><%= t('devise.headers.resend_unlock') %></h2>
|
|
2
2
|
|
|
3
3
|
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
|
|
4
|
-
<%=
|
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
5
5
|
|
|
6
6
|
<div class="field">
|
|
7
7
|
<%= f.label :email %><br />
|
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
# NOTE: This is all way more verbose that I'd like it to be. Maybe we can
|
|
5
5
|
# slim it down if this Rails issue is ever fixed:
|
|
6
6
|
# https://github.com/rails/rails/issues/54478
|
|
7
|
+
|
|
8
|
+
# We require this here since we need ActionText things below.
|
|
9
|
+
# This won't do anything for most apps, but if you happen to be trying to use
|
|
10
|
+
# BT in a non-starter-repo app that was generated with the `--minimal` flag,
|
|
11
|
+
# then this will save you some head scratching.
|
|
12
|
+
# https://github.com/bullet-train-co/bullet_train-core/issues/1288
|
|
13
|
+
require "action_text/engine"
|
|
14
|
+
|
|
7
15
|
Rails.application.config.after_initialize do
|
|
8
16
|
default_allowed_attributes = Rails::HTML5::Sanitizer.safe_list_sanitizer.allowed_attributes + ActionText::Attachment::ATTRIBUTES.to_set
|
|
9
17
|
custom_allowed_attributes = Set.new(%w[controls poster type])
|
data/docs/billing/stripe.md
CHANGED
|
@@ -201,7 +201,7 @@ basic:
|
|
|
201
201
|
|
|
202
202
|
Each root level entry (i.e. `free` and `basic`) are the types of subscriptions that will be available to your customers. Each subscription has the following:
|
|
203
203
|
|
|
204
|
-
- `price`: A unique
|
|
204
|
+
- `price`: A unique identifier for this price
|
|
205
205
|
- `image`: The product image from `assets/images/products` that is presented to the buyer from the new subscription page
|
|
206
206
|
- `limits`: The resource constraints on what a user can do on this subscription. To learn more, refer to [Bullet Train Usage Limits](/docs/billing/usage.md)
|
|
207
207
|
- `prices`: The list of pricing options for this product, where each price will have the following:
|
|
@@ -251,7 +251,6 @@ Subscription translations can be retrieved directly [from github](https://github
|
|
|
251
251
|
`curl -o config/locales/en/billing/subscriptions.en.yml https://raw.githubusercontent.com/bullet-train-pro/bullet_train-billing/refs/heads/main/config/locales/en/billing/subscriptions.en.yml`
|
|
252
252
|
```
|
|
253
253
|
|
|
254
|
-
|
|
255
254
|
## 9. Rinse and Repeat Configuration Steps for Production
|
|
256
255
|
|
|
257
256
|
As mentioned earlier, all of the links we provided for configuration steps on Stripe were linked to the "test mode" on your Stripe account. When you're ready to launch payments in production, you will need to:
|
|
@@ -261,8 +260,34 @@ As mentioned earlier, all of the links we provided for configuration steps on St
|
|
|
261
260
|
- Run `STRIPE_SECRET_KEY=... rake billing:stripe:populate_products_in_stripe` (where `...` is your live secret key) in order to create live versions of your products and prices.
|
|
262
261
|
- Copy the environment variables output by that rake task into your production environment.
|
|
263
262
|
- Configure a live version of your webhooks endpoint for the production environment by following the same steps as before, but replacing the ngrok host with your production host in the endpoint URL.
|
|
264
|
-
- After creating the live webhooks endpoint, configure the corresponding signing secret as the `STRIPE_WEBHOOKS_ENDPOINT_SECRET`
|
|
263
|
+
- After creating the live webhooks endpoint, configure the corresponding signing secret as the `STRIPE_WEBHOOKS_ENDPOINT_SECRET` environment variable in your production environment.
|
|
264
|
+
|
|
265
|
+
## 10. Allow Customers to Purchase a Subscription as a Business
|
|
266
|
+
|
|
267
|
+
Some of your customers may be businesses that need to be invoiced under their business name and tax ID rather than a personal name. Stripe Checkout supports [collecting tax IDs](https://docs.stripe.com/tax/checkout/tax-ids?payment-ui=stripe-hosted) during the subscription purchase flow, and this feature is enabled by default in Bullet Train.
|
|
268
|
+
|
|
269
|
+
When tax ID collection is enabled:
|
|
270
|
+
|
|
271
|
+
- Customers in supported regions will see a checkbox to indicate they're purchasing as a business
|
|
272
|
+
- When checked, Checkout displays fields for entering a tax ID and legal business name
|
|
273
|
+
- The tax ID and business name are automatically saved to the Stripe Customer object
|
|
274
|
+
- The business name appears on invoices generated for that customer
|
|
275
|
+
- If you use Stripe Tax, providing a valid tax ID can result in reverse charge or zero-rate tax application according to applicable laws
|
|
276
|
+
|
|
277
|
+
**Note:** Checkout only collects tax IDs for customers that don't already have one. If a customer already has a tax ID saved, the form won't appear even if tax ID collection is enabled.
|
|
278
|
+
|
|
279
|
+
### 10.1. Allow Customers to Update their Tax Information
|
|
280
|
+
|
|
281
|
+
While tax ID collection during checkout is enabled by default, you can also allow customers to add or update their tax information and business name through the customer portal (which you configured in [section 7](#7-configure-stripe-billings-customer-portal)):
|
|
282
|
+
|
|
283
|
+
- Visit https://dashboard.stripe.com/test/settings/billing/portal
|
|
284
|
+
- Under the "Customer Information" section turn on:
|
|
285
|
+
- Tax ID
|
|
286
|
+
|
|
287
|
+
This enables customers to add or update their tax ID and business name after their initial subscription purchase.
|
|
288
|
+
|
|
289
|
+
**Note:** When you configure this for production, you'll need to repeat this step in your live Stripe account's customer portal settings.
|
|
265
290
|
|
|
266
|
-
##
|
|
291
|
+
## 11. You should be done!
|
|
267
292
|
|
|
268
293
|
[Let us know on Discord](https://discord.gg/gmfybM8kA6) if any part of this guide was not clear or could be improved!
|
data/lib/bullet_train/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bullet_train
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.42.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Culver
|
|
@@ -43,14 +43,14 @@ dependencies:
|
|
|
43
43
|
requirements:
|
|
44
44
|
- - ">="
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version:
|
|
46
|
+
version: 7.0.0
|
|
47
47
|
type: :runtime
|
|
48
48
|
prerelease: false
|
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
51
|
- - ">="
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version:
|
|
53
|
+
version: 7.0.0
|
|
54
54
|
- !ruby/object:Gem::Dependency
|
|
55
55
|
name: bullet_train-roles
|
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|