-
Stripe Tax support
Using
pay_customer stripe_attributes: :method_name, you can add an Address toStripe::Customerobjects which will be used for calculating taxes. We now recordtotal_tax_amountstoPay::Chargerecords. This includes details for each tax applied to the charge.@user.payment_processor.subscribe(plan: "growth", automatic_tax: { enabled: true })
-
Stripe Metered Billing support Removes
quantitywhen creating a new subscription (metered billing prices do not allow quantity) Addscreate_usage_recordtoPay::Subscriptionfor reporting usage on metered billing plans -
Raise error when dependencies are not supported versions. This makes sure you're using supported versions of libraries with Pay. Currently supported versions:
stripe ~> 5braintree ~> 4paddle_pay ~> 0.2receipts ~> 2
-
Replace
update_email!withupdate_customer!- @excid3 -
Add options for
cancel_now!to supportinvoice_nowandprorateflags for Stripe - @excid3 -
Adds
make_defaultflag toset_payment_processor- @excid3 -
Setting
pay_namein Stripe Subscription metadata will be used as thenameon thePay::Subscription- @excid3 -
pay_customernow supports astripe_attributes:option to add attributes to Stripe::Customers - @excid3 -
pay_customernow supports abraintree_attributes:option to add attributes to Braintree::Customers - @excid3 -
pay_customernow supports adefault_payment_processoroption to automatically create a Pay::Customer record - @excid3 -
Added
enabled_processorsto Pay config. This lets you choose exactly which processors will be enabled. - @cjilbert504
- Make payment method and charges consistent for Fake procsesor - @excid3
- Merge Stripe Checkout
session_idparam intosuccess_urlautomatically - @excid3
- Update to
@hotwired/stimulusfor payments view - @excid3 - Update test/dummy app to Pay 3 - @excid3
- Add
update_customermethods for SyncCustomer job - @excid3
- Safely handle receipts for users without
extra_billing_info- @excid3
- Correctly handle cancelling a paused Paddle subscription - @excid3
- Add
generic_trial?toPay::Subscriptionfor checking if fake processor trial - @excid3 - Charge succeeded should send email even when receipts gem isn't available - @excid3
- Update mailers to use
Pay::Customer#customer_name- @excid3 - Use
pay_customerinstead ofbillablein mailers - @excid3 - Remove payment methods when cancelling Paddle subscription - @excid3
- Convert
paddle_paused_fromto Time - @excid3
- Remove hardcoded currency in emails - @excid3
- Accept options for
Pay::Currency.format- @excid3
- Add
amount_with_currencytoPay::Payment- @excid3
- Add
Pay::Currencyfor formatting amounts with currency - @excid3 - Add
amount_with_currencyandamount_refunded_with_currencytoPay::Charge- @excid3 - Safer pay processor lookup when processor is blank - @excid3
- Store
stripe_accountwhen syncing Stripe payment methods - @excid3
- Add
CHECKOUT_SESSION_IDto checkout URLs by default and document how to add them - @excid3 - Fix invoice bill_to to use
customer.ownerinstead ofowner- @excid3
- Fix Stripe charge.refunded webhook - @excid3
- Fix Pay::Subscription charges association - @excid3
- Remove Pay::Charge default sort - @excid3
- Fix translation key - @excid3
- Better invoice line items format - @excid3
- Namespace locales under
pay- @excid3 - I18n receipt and invoice dates - @excid3
- Add
business_logoconfig - @excid3 - Add
refunded?partial_refund?andfull_refund?methods toPay::Charge- @excid3
- Fix payment method sync on customer updated - @excid3
- Fix Stripe customer.updated webhook - @excid3
- Add retries for payment method sync in case of rate limiting - @excid3
- Add
on_generic_trial?to Pay::Customer for easier checking - @excid3
Yanked
- Add payment methods to Pay::Charge
charged_tohelper - @excid3 - Improve
swaperror message - @excid3
- Add
rake pay:payment_methods:sync_defaulttask for easily upgrading to Pay 3 - @excid3
See the UPGRADE guide for steps on upgrading from Pay 2.x.
- Requires Rails 6+
- Migrates
processorandprocessor_idfrom models toPay::Customermodel - Replaces include Pay::Billable with pay_customer method
- Replaces include Pay::Merchant with pay_merchant method
- Changes Pay::Charge to associate with Pay::Customer instead of
owner{polymorphic} - Changes Pay::Subscription to associate with
Pay::Customerinstead ofowner{polymorphic} - Migrates card fields from models to
Pay::PaymentMethodmodel - Queues webhooks in
Pay::Webhookfor processing with ActiveJob to handle large volumes of webhooks - Subscriptions are automatically canceled when a Pay::Subscription deleted - @stevepolitodesign
- Active subscriptions are canceled when a Pay::Customer's owner is deleted - @stevepolitodesign
- Add
invoiceto Pay::Charge
- Don't validate SetupIntent for trialing subscriptions - @archonic
- Validate uniqueness of charges and subscriptions - @excid3
- Better handle out of order webhooks and race conditions - @excid3
- Refactor Stripe webhooks to always retrieve latest records - @excid3
- Associate charges with subscriptions if possible - @excid3
- Add
Pay::Merchantand Stripe Connect functionality - @excid3 - Save
currencyon Pay::Charge records - @excid3
- Add
subscriptionmethod to payment processor classes for direct access to the processor subscription object. The owner is not guaranteed to be on the same payment processor, which can cause problems. - @excid3
- Improve the Stripe Checkout URLs so your Rails app doesn't need a
root_url#309 - @excid3 - Fix
currencywith Stripe Checkout #308 - @excid3
- Update Stripe & Braintree default card automatically when the customer is accessed (ie. on charge, subscribe, etc) #300 - @excid3
- Add passthrough fallback for paddle payment succeeded webhook #302 - @nm
- Add Stripe
payment_intent.succeededwebhook listener
- Improve error wrappers to delegate message to original cause
- [NEW] Raise error if payment processor name is nil
- [FIX] Pay::Error now uses the correct message in to_s
- Create braintree customer on update_card if needed
- [NEW] Fake payment processor for testing and giving users free access to your application
- [FIX] Delegate trial_ends_at for subscriptions - @archonic
- [FIX] Default to empty hash when default_url_options is nil so proper error is raised
- [FIX] Fix inquiry when processor is nil
- [FIX] Correctly handle updating payment method in Stripe
- [NEW] Add Stripe Customer Billing Portal - @excid3
- Include
customeron Stripe Checkout sessions - @excid3
- [NEW] Stripe Checkout support - @excid3
- [BREAKING] Webhooks that can't be verified respond with 400 instead of 200 - @excid3
- [BREAKING] Remove StripeEvent dependency - excid3
- [BREAKING] Remove old configuration for mailer subjects in favor of locales - @excid3
- [NEW] Add
Pay::Webhook.delegatorfor subscribing to webhooks - @excid3
- [Fix] Fixed missing require for version file - @excid3
- Add Stripe app info and join the Stripe Partner program for better support for Pay! - @excid3
- [FIX] Update migration to check for symobl keys on ActiveRecord adapter with Rails 6.1 - @excid3
- [FIX] Move Paddle logic into paddle methods - @excid3
- [BREAKING] Use locales for email subjects and remove configuration - @excid3
- [FIX] Subject for payment action required emails referenced an invalid config - @excid3
- Add
datajson column to Charge and Subscription models - @excid3
To add the new migrations to your app, run:
rails pay:install:migrations
- Add Paddle initial support - @nm
Pay.model_parent_classdefaults toApplicationRecord- @excid3- Test suite now runs against sqlite, mysql, and postgresql - @excid3
- [FIX] Lookup billable on invoice.payment_action_required events - @excid3
- Bugfixes
- [NEW] Allow passing
?back=/path/to/itemfor customizing the back link for SCA payments page
Stripe API 2020-08-27 changes:
- Use
proration_behaviorinstead ofproratefor Stripe subscription changes - Switch to
::Stripe::Subscription.createinstead ofcustomer.subscriptionsas Stripe no longer includes this by default for performance - Set Stripe API version for easier gem management
- Add support for
quantityoption onsubscribefor subscription quantities - Added
Pay::BraintreeAuthorizationErrorto catch Braintree actions with malformed data or unauthorized API access.
- [FIX] Remove old billable migration
- [FIX] The
chargemethod now raisesPay::BraintreeErrorwhen a charge fails. This makes it work consistently with the Stripe implementation which raises an error on charge failure.
-
[BREAKING] Subscription & Charge associations to
ownerare now polymorphic.Requires adding
owner_type:stringto 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
endPay.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_routesconfig option has been renamed toautomount_routes - [BREAKING]
webhooks_pathconfig option has been renamed toroutes_path - Added
statuscolumn 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#showroute to handle SCA payments that require action - Added webhook handler for payments that require action
- Added
trial_period_dayswhen 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