#paul_ece-googlepay
1 messages ยท Page 1 of 1 (latest)
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.
- paulc7053_code, 21 hours ago, 99 messages
- paulc7053_code, 1 day ago, 51 messages
- paulc7053_api, 1 day ago, 79 messages
- paulc7053_code, 3 days ago, 114 messages
๐ 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.
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
No, there's no error being thrown
the gpay popup just states that the request failed
ah gotcha so it is likely a Google Pay error internally with your card itself before it even reaches Stripe
Unfortunately I don't think there's anything I can dig into. You'd have to talk to Google directly I think
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
what you can do is try on https://stripe.com/docs/stripe-js/elements/payment-request-button and then on https://rsolomakhin.github.io/pr/gp2/ the former is our own demo and the latter is a google demo and see if you get similar errors
It works there
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
actually works on both (just tried the one on your domain too)
hum that is super strange then
no
what do you see on https://4242.io/test/express-checkout-element/?
(it's my team's test server)
sure
{ "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?
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
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
oh boy I'm so sorry, didn't even cross my mind it could be something like this
such a cryptic error from Google ๐ฆ
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)
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!