Method: Pay::Stripe::Billable#sync_subscriptions
- Defined in:
- lib/pay/stripe/billable.rb
#sync_subscriptions(**options) ⇒ Object
Syncs a customer’s subscriptions from Stripe to the database. Note that by default canceled subscriptions are NOT returned by Stripe. In order to include them, use ‘sync_subscriptions(status: “all”)`.
192 193 194 195 196 197 198 199 |
# File 'lib/pay/stripe/billable.rb', line 192 def sync_subscriptions(**) subscriptions = ::Stripe::Subscription.list(.merge(customer: customer), ) subscriptions.map do |subscription| Pay::Stripe::Subscription.sync(subscription.id) end rescue ::Stripe::StripeError => e raise Pay::Stripe::Error, e end |