You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an invoice.upcoming webhook with a null next_payment_attempt attribute is received by Pay, Pay::Stripe::Webhooks::SubscriptionRenewing will raise a TypeError can't convert NilClass into an exact number because Time.zone.at cannot receive null arguments
Receive a Stripe invoice.upcoming webhook with a null next_payment_attempt attribute
Expected Behavior:
The webhook should successfully process and send an subscription renewing email.
Actual Behavior: TypeError can't convert NilClass into an exact number is raised
Environment:
Pay gem version: 8.3.0
Ruby version: 3.3.6
Rails version: 7.2
Operating System: Ubuntu 24
Possible Fix:
The next_payment_attempt can be safe navigated to handle null values and solve this error, but the subscription renewing email should probably be modified to handle conditions where next_payment_attempt is not set.
Labels to Apply:
bug
Checklist:
I have searched for similar issues and couldn't find any
I have checked the documentation for relevant information
I have included all the required information
The text was updated successfully, but these errors were encountered:
Bug Report
Describe the Bug:
The
next_payment_attempt
attribute of Stripe's Invoice object is nullable for invoices wherecollection_method=send_invoice
If an
invoice.upcoming
webhook with a nullnext_payment_attempt
attribute is received by Pay,Pay::Stripe::Webhooks::SubscriptionRenewing
will raise aTypeError can't convert NilClass into an exact number
becauseTime.zone.at
cannot receive null argumentspay/lib/pay/stripe/webhooks/subscription_renewing.rb
Line 21 in 5b9a107
To Reproduce:
invoice.upcoming
webhook with a nullnext_payment_attempt
attributeExpected Behavior:
The webhook should successfully process and send an subscription renewing email.
Actual Behavior:
TypeError can't convert NilClass into an exact number
is raisedEnvironment:
Possible Fix:
The
next_payment_attempt
can be safe navigated to handle null values and solve this error, but the subscription renewing email should probably be modified to handle conditions wherenext_payment_attempt
is not set.Labels to Apply:
bug
Checklist:
The text was updated successfully, but these errors were encountered: