- Added
Pay::BraintreeAuthorizationError
to catch Braintree actions with malformed data or unauthorized API access.
- [FIX] Remove old billable migration
- [FIX] The
charge
method now raisesPay::BraintreeError
when a charge fails. This makes it work consistently with the Stripe implementation which raises an error on charge failure.
-
[BREAKING] Subscription & Charge associations to
owner
are now polymorphic.Requires adding
owner_type:string
to both Pay::Charge and Pay::Subscription models and setting the value for all existing records to your model name.
class AddOwnerTypeToPay < ActiveRecord::Migration[6.0]
def change
add_column :pay_charges, :owner_type, :string
add_column :pay_subscriptions, :owner_type, :string
# Backfill owner_type column to match your Billable model
Pay::Charge.update_all owner_type: "User"
Pay::Subscription.update_all owner_type: "User"
end
end
Pay.billable_class
is now deprecated and will be removed in a future version. You should also update your existing Pay migrations to reference the :users
table rather than Pay.billable_class
and any other code you may have that references this method.
- [FIX] Stripe subscription cancel shouldn't change status
- [FIX] Stripe test payment methods should now work (ie.
pm_card_visa
)
- [FIX] Styling tweaks for payment intent page
- [FIX] Stripe Refund and Charge references weren't matching the right class
- [NEW] Stripe SCA support
- [BREAKING] Requires using PaymentMethods instead of Source and Tokens
- [BREAKING] Drops Ruby 2.4 support
- [BREAKING]
automount_webhook_routes
config option has been renamed toautomount_routes
- [BREAKING]
webhooks_path
config option has been renamed toroutes_path
- Added
status
column to payments to keep in sync with Stripe. We're also adding statuses to Braintree subscriptions to keep them in sync as best we can. - Added
payments#show
route to handle SCA payments that require action - Added webhook handler for payments that require action
- Added
trial_period_days
when creating a subscription that works the same on Stripe and Braintree
- Set default from email to
Pay.support_email
- Add
on_trial_or_subscribed?
convenience method
- Removed Rails HTML Sanitizer dependency since it wasn't being used
- Add
stripe?
,braintree?
, andpaypal?
to Pay::Charge - Add webhook mounting and path options
- Makes
stripe?
,braintree?
, andpaypal?
helper methods always available on Billable.
- Update migration to reference Billable instead of Users
- Check ENV first when looking up keys to allow for overrides