#seth_go-upgrade

1 messages ¡ Page 1 of 1 (latest)

lone gullBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1300978455940431933

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

rugged yew
#

seth_go-upgrade

#

@limber minnow I'm going to need a bit more details than this, such as an exact API request id req_123 with the exact error you get and where the error comes from (client or server-side)
Also can you explain which stripe-go version you upgraded from and whether you carefully reviewed the breaking changes between each one?

limber minnow
#

I migrated from v70.15.0 to v80.2.0. I did review all of the breaking changes, especially around creating a new payment intent.

This is happening when I first create a payment intent with the provided params:

params := &stripe.PaymentIntentParams{
Amount: stripe.Int64(amount),
Currency: stripe.String(string(stripe.CurrencyUSD)),
PaymentMethod: stripe.String(paymentMethodId),
ReceiptEmail: stripe.String(receiptEmail),
Customer: stripe.String(stripeCustomerID),
ConfirmationMethod: stripe.String(string(stripe.PaymentIntentConfirmationMethodManual)),
TransferGroup: stripe.String(rideId),
}

and then later go to confirm that payment after the user action is completed I get this error:

"status":400,"message":"A return_url must be specified because this Payment Intent is configured to automatically accept the payment methods enabled in the Dashboard, some of which may require a full page redirect to succeed. If you do not want to accept redirect-based payment methods, set automatic_payment_methods[enabled] to true and automatic_payment_methods[allow_redirects] to never when creating Setup Intents and Payment Intents."

rugged yew
#

Ah gotcha you did a huge jump like 10 major versions is a huge deal. You also jumped like 3 or 4 years of API versions with tons of breaking changes.

limber minnow
#

They have all been resolved based on the changelog.

rugged yew
#

and then later go to confirm that payment after the user action is completed I get this error:
do you have the code and the request id for that error?

limber minnow
#

I have the payment_intent id, is that helpful?

rugged yew
#

They have all been resolved based on the changelog.
you likely fixed build errors but didn't look at API breaking changes where the behaviour of the API changed which is why you are hitting this one

limber minnow
#

Just kidding, I have the request ID too...didn't realize I logged it: "request_id":"req_fGqvIhphlpwtG3"

rugged yew
#

Okay so you are confirming server-side with go. That PaymentIntent was created in https://dashboard.stripe.com/test/logs/req_AbZu44yQzJTZFT
That API request never disabled automatic payment methods. You mentioned you did in your original question but really that's what you are missing here

limber minnow
#

Yup, so to resolve the issue before reaching out I attempted to disable automatic payment methods. However, when I add that to my payment intent creating I get this error

rugged yew
limber minnow
#

"status":400,"message":"You may only specify one of these parameters: automatic_payment_methods, confirmation_method.

rugged yew
#

cool so the easiest change for you is to pass payment_method_types: ['card'] on PaymentIntent creation specifically to only force card support and get the old behaviour

limber minnow
#

Great. That worked, thank you!

#

I'll review the API changes, wasn't aware of that changelog. Really appreciate it, inherited this code and trying to clean up the mess.