Update Stripe integration for main fundraising page. #1058
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thePRODUCTS
dict added.