Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stripe Prices fixes #8472

Merged
merged 6 commits into from
Nov 27, 2024
Merged

Stripe Prices fixes #8472

merged 6 commits into from
Nov 27, 2024

Conversation

gbp
Copy link
Member

@gbp gbp commented Nov 27, 2024

What does this do?

Adds a couple of Stripe fixes for issues preventing signups.

  • Change Price.id to Price.to_param so prices can be loaded
  • Correct payment intent status (missing an s) should fix incomplete subscriptions
  • Update payment failed email, don't send to users without current subscriptions - ie those who are attempting to sign up.

Why was this needed?

Getting payments working correctly.


[skip changelog]

- Add guard clauses
- Remove brackets around conditional
- Remove leading underscore on variables names
Need to pass in the subscription param instead of ID otherwise Pro
Price#retrieve method won't find the Stripe Price instance.

This commit also clears up the variables in Pro Price to make it clearer
what is expected and ensures prices are defined in config/general.yml.
Fixing invalid Stripe payment intent status.

Should be "requires_action" this would result in payments attempts being
left in an incomplete state and the user being shown the generic "try
again" error message when they are signing up.

See: https://docs.stripe.com/payments/paymentintents/lifecycle#intent-statuses
Change payment intents with the  "requires_source_action" status from
returning true.

According to payment intent lifecycle this state is for when processing
fails and we should display an error to the user. This change will do
just that.

See: https://docs.stripe.com/payments/paymentintents/lifecycle#intent-statuses
Don't send the notification when the user has no subscriptions which are
past due.
Before this change, webhooks would be ignored if the main object
plan/price ID didn't match the namespace.

This change means we now look up the price ID against those configured
in config/general.yml.

Note: Since only Stripe plans are returned in the webhooks generated
from the stripe-ruby-mock gem the specs still rely on setting up plans
are can't be migrated to prices.
@gbp gbp merged commit b73f0b7 into develop Nov 27, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant