-
Notifications
You must be signed in to change notification settings - Fork 136
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
Redirect to a second checkout on subscriptions with platform tip #587
Conversation
'price' => $price->id, | ||
'price' => $this->stripe->prices->create([ | ||
'unit_amount' => $invest->amount * 100, | ||
'currency' => 'eur', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change this for the settings field Currency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this checkout to use the project's currency and the platform tip checkout to use Config currency. This way each checkout matches the payments recipient's (project and platform) currency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When doing a new invest i found a bug. After paying the first donation, the one that represents the subscription, it will create a new Invest entry. At the end of the process we end with two invests, one with the amount + donation_amount, and another with only the amount, both with valid status.
I belive the problem comes from the After both invest creation, the controller does not look for a previously created invest based on the metadata of the invest. We should look for it and then update it. When the first donation is correct then we should update the donation_amount to 0, and then when the second payment is correct then return the value. What do you think? @subiabre |
🎩 What? Why?
This PR fixes the previously undefined behaviour of tips on subscriptions payments. See https://app.asana.com/0/1206149597772083/1206163960878458
Testing
If you choose to do a donation to the platform when paying with a subscription via Stripe, you'll be redirected to a second checkout (for the donation) after the first checkout (for the subscription).