diff --git a/UPGRADE.md b/UPGRADE.md index cee3c8e2..8446b74a 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -110,7 +110,7 @@ This is a major change to add Stripe tax support, Stripe metered billing, new co ### Method Additions and Changes -In an effort to keep a consistant naming convention, the email parameters of `subscription` and `charge` have been updated to have `pay_` prepended to them (`pay_subscription` and `pay_charge` respectively). If you are directly using any of the built in emails or created custom Pay views, you will want to be sure to update your parameter names to the updated names. +In an effort to keep a consistent naming convention, the email parameters of `subscription` and `charge` have been updated to have `pay_` prepended to them (`pay_subscription` and `pay_charge` respectively). If you are directly using any of the built in emails or created custom Pay views, you will want to be sure to update your parameter names to the updated names. You'll need to replace all references to: ```ruby @@ -120,7 +120,7 @@ params[:subscription] with params[:pay_subscription] The `send_emails` configuration variable has been removed from Pay and replaced by the new configuration system which is discussed below. `Pay.send_emails` is primarily used internally, but if you have been using it in your application code you will need to update those areas to use the new method calls from the email configuration settings. For example, to check if the receipt email should be sent you can now call `Pay.send_email?(:receipt)`. If your email configuration option uses a lambda, you can pass any additional arguments to `send_email?` like so `Pay.send_email?(:receipt, pay_charge)` for use in the lambda. -The `update_email!` method has been replaced with `update_customer!`. When dealing with a `Stripe::Billable` or `Braintree::Billable` object, a hash of additional attributes can be passed in that will be merged into the default atrributes. +The `update_email!` method has been replaced with `update_customer!`. When dealing with a `Stripe::Billable` or `Braintree::Billable` object, a hash of additional attributes can be passed in that will be merged into the default attributes. The `Stripe::Subscription#cancel_now!` method now accepts a hash of options such as `cancel_now!(prorate: true, invoice_now: true)` which will be handled automatically by Stripe. diff --git a/app/models/pay/fake_processor/subscription.rb b/app/models/pay/fake_processor/subscription.rb index 0fc93714..5253beb0 100644 --- a/app/models/pay/fake_processor/subscription.rb +++ b/app/models/pay/fake_processor/subscription.rb @@ -1,11 +1,15 @@ module Pay module FakeProcessor class Subscription < Pay::Subscription + def self.sync(processor_id, **options) + # Bypass sync operation for FakeProcessor + end + def api_record(**options) self end - # With trial, sets end to trial end (mimicing Stripe) + # With trial, sets end to trial end (mimicking Stripe) # Without trial, sets can ends_at to end of month def cancel(**options) return if canceled? diff --git a/test/pay/fake_processor/subscription_test.rb b/test/pay/fake_processor/subscription_test.rb index 8a796068..15ca5dec 100644 --- a/test/pay/fake_processor/subscription_test.rb +++ b/test/pay/fake_processor/subscription_test.rb @@ -69,4 +69,10 @@ class Pay::FakeProcessor::Subscription::Test < ActiveSupport::TestCase assert @subscription.canceled? refute @subscription.resumable? end + + test "fake processor sync!" do + assert_nothing_raised do + @subscription.sync! + end + end end