GoteoFoundation / goteo

Goteo Version 3, the Open Source Crowdfunding Platform
http://goteo.org
GNU Affero General Public License v3.0
188 stars 133 forks source link

Redirect to a second checkout on subscriptions with platform tip #587

Closed subiabre closed 10 months ago

subiabre commented 11 months ago

:tophat: 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).

davidbeig commented 11 months ago

I belive the problem comes from the StripeSubscriptionController.php

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