-
Notifications
You must be signed in to change notification settings - Fork 17
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
Donation page layout #58
Conversation
Hey this looks good, two minor design bits:
My understanding is we have to wait for the Stripe integration to fully review & merge this? |
For now it's the UI alone. We would need API key to integrate Stripe - I have put details in the ticket. |
I have fixed these issues with latest commit @shuesken |
@vuphuctho I think the redirect URL should be |
The issue is that Stripe's element requires an initial price to be render, so whenever user reselects amount of donation we have to call Stripe again. Also one-time and recurring use different Stripe APIs, hence I have to track I understand the issue you observe - let me see if there is better way to handle user's reselection. |
@shuesken I have fixed the flow for Stripe payment:
|
@vuphuctho I updated the donate-complete page to be a little more cheery. The flow works fine now, but I run into issues when running this with It's annoying there appears to be different behaviour here depending on runtime environment :/ |
@shuesken I tried the Stackoverflow solution but it's not working - then I applied the solution in There are a few more things they suggested (update package Problem I have right now is 2 server endpoints |
@vuphuctho I've investigated this and it's some issue with Cloudflare. The handler times out at I looked at their sample implementation and noticed they explicitly specify an
I could imagine that our issue is somewhere there. I tried using that code though and didn't get better results either. When running this on I'll keep looking at this! |
I removed the Stripe SDK in favour of direct HTTP calls, deployed to test.bank.green and asked Zak for feedback. |
Looks ok to me. Here are some notes. I'm happy to work on these next week or to have someone else pick them up.
|
I am not sure this is possible. As far as Stripe is concerned, a new amount is a new product and the Stripe process starts by telling Stripe "A customer wants to purchase these products, please start the flow" and they return you a session and a payment element to render and handle the rest. But e.g. you cannot auto-fill sensitive details of that element (like CVC or Number) and you cannot update the products. You can allow a customer to change the quantity of a line item if you explicitly set that flag.
Changed this.
Payment methods availability is orthogonal to SDK vs HTTP; the SDK is just a wrapper around the HTTP calls with typing and some convenience error handling. We still use what's called the Stripe Payment Element (which is maybe what you thought of just now). In general, Stripe automatically supports most common payment methods and displays the appropriate ones, including e.g. iDEAL for Netherlands or Giropay in Germany. For me, for example, it always displays "Cash App" as a way of paying. However, it comes with restrictions that apply in our case: E.g. iDEAL is only offered when the presentment currency is Euro and the business location is in particular places (which do not include the UK). Giropay supports UK businesses, but also requires the amount to be presented in Euro. (Stripe "presentment currency" is what the customer is shown and what is charged from them, "settlement currency" is what ends up in your account, possibly after conversion fees if that was necessary). You can get an overview of what methods are automatically supported and under what restrictions they're offered on our stripe dashboard. Klarna is supported and works when I turn it on. I don't know if we actually want to support them though, they're backed by WebBank, which provides Fintech's with banking services, makes loans to individuals and businesses, and almost certainly doesn't care about climate change since they have no consumer brand. Paypal seems to be supported but I couldn't find it to enable in our payment methods, so maybe there's something restricting it. So we could make changes to allow for payment in Euros or connect other business accounts, but it's not trivial and should definitely not be part of this PR. For what it's worth, most cards issued in Europe today are (also) debit cards and work just fine with the card payment flow, the Netherlands is an outlier in this as far as I understand. |
It's a shame with Paypal. It seems like it's not enabled for business based outside of the EU. LGTM though. Let's do it. |
TODO:
TODO: design the two page donate success and donate failure