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

Update Stripe integration for main fundraising page. #1058

Merged
merged 1 commit into from
Jan 4, 2021

Conversation

carltongibson
Copy link
Member

This is the first part for #1052.

It updates the main form on /fundraising/ to use Stripe's new hosted Checkout flow, and the Prices API.

Beyond updating the API usage, the difference in the flow is that we now need to handle the Hero, Donation and Payment creation in the WebHook handler, rather than in the form submission. Users are directed back to a generic success page, but (without changing the flow to require a login) we can't match that back to the Stripe Session there and then. As such, the email becomes more important, as that's the only method whereby users can enter their Django Hero details.

I need to follow up with adjustments to the manage your donation flows — adjusting subscription, changing card and cancelling — plus, there are various other TODOs added here — but this is the main immediate priority, and I want to get that in to follow up in the next few weeks with the other changes.

In order to deploy, I need to add product_ids from the Stripe live environment to the secret store. (I'm not 100% sure whether product ids are considered sensitive but thought it best to err on the side of caution.) prod.py settings will need the PRODUCTS dict added.

Comment on lines +287 to +288
hero, _ = DjangoHero.objects.get_or_create(
stripe_customer_id=customer.id,
defaults={
"email": customer.email,
}
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this? stripe_customer_id is not unique.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's not. It should be (I think) See TODO in models.py

(I need to shell into the DB and check if duplicates exist.)

@carltongibson carltongibson force-pushed the corporate_member_badges branch 2 times, most recently from 9e093ab to 35fb34a Compare December 30, 2020 10:16
Thanks to Mariusz Felisiak for review.
@felixxm felixxm merged commit cc80dfa into django:master Jan 4, 2021
@felixxm
Copy link
Member

felixxm commented Jan 4, 2021

@carltongibson Thanks 🎊

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.

None yet

2 participants