#paul_ece-googlepay

1 messages ยท Page 1 of 1 (latest)

cyan hillBOT
winter tundraBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

cyan hillBOT
#

๐Ÿ‘‹ 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/1218255104734662697

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

austere dune
#

hi!

#

just to continue the code

#

`const { error: submitError } = await elements.submit();
if (submitError) {
// setErrorMessage(submitError.message);
return;
};

    // create the customer
    const stripeCustomerIdRes = await fetch('/api/stripe/findOrCreateCustomer', {});
    const stripeCustomerId = (await stripeCustomerIdRes.json()).stripeCustomerId;

    // create the subscription
    const subscriptionRes = await fetch('/api/stripe/createSubscription', {}),
    });
    const clientSecret = (await subscriptionRes.json()).clientSecret;

    // confirm the payment
    const { error } = await stripe.confirmPayment({
        elements,
        clientSecret,
        confirmParams: {
            return_url: `${process.env.NEXT_PUBLIC_HOST ? process.env.NEXT_PUBLIC_HOST : 'google.com'}/payment-successful`,
        },
    });`
#

Trying to pay with GPay with my real credit card doesnt work

opal sequoia
#

Do you know which part is erroring exactly in your code?

#

paul_ece-googlepay

austere dune
#

No, there's no error being thrown

#

the gpay popup just states that the request failed

opal sequoia
#

ah gotcha so it is likely a Google Pay error internally with your card itself before it even reaches Stripe

austere dune
#

I see

#

what is there to do about this?

#

tried with 2 cards that work

opal sequoia
#

Unfortunately I don't think there's anything I can dig into. You'd have to talk to Google directly I think

austere dune
#

O wow

#

That's very unlikely

opal sequoia
#

If you google that error it's what a lot of websites/answers seem to say. That's it's an issue with the card

austere dune
#

Hmm I see

#

I'll look into it!

#

Thanks a lot!

opal sequoia
austere dune
#

Sorry for the delay

#

here https://rsolomakhin.github.io/pr/gp2/

#

I think the docs you sent are for the Payment request button, and I want to use the express checkout

#

But yes, I've followed the documentation, alongside the one showing how to create a subscription

austere dune
opal sequoia
#

hum that is super strange then

austere dune
#

indeed..

#

does something with the code look weird to you?

opal sequoia
#

no

#

(it's my team's test server)

austere dune
#

It also works

#

would you like the response?

opal sequoia
#

sure

austere dune
#

{ "id": "pi_3OufkqCHlokEYlHR0w36sfev", "object": "payment_intent", "amount": 4200, "amount_details": { "tip": {} }, "automatic_payment_methods": { "allow_redirects": "always", "enabled": true }, "canceled_at": null, "cancellation_reason": null, "capture_method": "automatic", "client_secret": "pi_3OufkqCHlokEYlHR0w36sfev_secret_qHBU2StJsKqYS0aC0CpV8BkLG", "confirmation_method": "automatic", "created": 1710528320, "currency": "gbp", "description": null, "last_payment_error": null, "livemode": false, "next_action": null, "payment_method": "pm_1OufkrCHlokEYlHRB7syF541", "payment_method_configuration_details": { "id": "pmc_1O2zdnCHlokEYlHRm1nJii7D", "parent": null }, "payment_method_types": [ "card", "link", "paypal" ], "processing": null, "receipt_email": null, "setup_future_usage": null, "shipping": null, "source": null, "status": "succeeded" }

#

What do you think is wrong with my implementation?

winter tundraBOT
opal sequoia
#

I don't know. I think what you now need to do is add clear logs to your own code before/after each Stripe calls to figure out which one(s) is failing

#

earlier you said the error happened directly before anything else in your code but it doesn't seem to be the case if the same browser/card works on our docs

austere dune
#

Okay I just logged the error explicitly

#

and it states "Invalid URL: An explicit scheme (such as https) must be provided."

#

Ah, may be the return url

#

passed

opal sequoia
#

oh boy I'm so sorry, didn't even cross my mind it could be something like this

#

such a cryptic error from Google ๐Ÿ˜ฆ

austere dune
#

Sorry

#

i had an if (error) {} after, but didn't see it's empty

opal sequoia
#

yeah and I didn't think to check that and thought the error happened before the createPaymentMethod() or whatever. I'm glad you tested more thoroughly to confirm it wasn't your card (it sadly is often just google rejecting the card or the IP and such)

austere dune
#

May I also ask

#

where should I look into this error :"The provided setup_future_usage (off_session) does not match the expected setup_future_usage (null). Try confirming with a Payment Intent that is configured to use the same parameters as Stripe Elements."?

#

Unfortunately, I wont be able to reply for a while (my building closes), but will look back at the chat once home. If you won't be here anymore, thanks a lot for your time!

hollow shard
#

Hi taking over here

#

Can you share the request id from that error?