#msy_code
1 messages ยท Page 1 of 1 (latest)
๐ 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/1357454981694885949
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello, can you tell me more about what is happening here? Are we throwing an error when you pass us those options?
Well I'm getting no type-hinting from Visual studio code
I haven't tried to just pass them in anyway
Can you try doing this anyway and see what happens? There are a lot of ways for intellisense to get out of sync with what is actually available
Forcing the options seems to not render the express checkout element at all.
One second, let me see if there are any load errors
I don't really get anything back other than a CORS error (when passing in the options that aren't available in the intellisense):
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.sandbox.paypal.com/xoplatform/logger/api/logger?disableSetCookie=true. (Reason: CORS request did not succeed). Status code: (null).
So the buttonTheme and wallets options are in autocomplete and work, but any other options make the ECE not show up at all?
Correct
And if you remove those params again does the CORS error stay? I wouldn't expect those options to be able to affect anything CORS-wise
If you mean removing the one's that aren't available in the intellisense, the CORS error disappears
Is this test site publicly accessible? Those options are working for me currently and are not causing any errors like that
Unfortunately not, I only have it as a local environment.
Can I verify if we have matching stripe versions?
"@stripe/react-stripe-js": "^3.1.1",
"@stripe/stripe-js": "^1.29.0",
We aren't but that wouldn't effect what parameters are available or the CORS requirement in this case. If you can resolve the CORS error around the paypal sandbox, that may get the element to show. My guess is that one of those settings effects the paypal button's behavior. Can you try setting paypal to never to see if getting rid of that gets rid of the CORS error temporarily?
options={{
emailRequired: true,
buttonTheme: { applePay: "black", googlePay: "black" },
wallets: {
applePay: "always",
googlePay: "always",
paypal: "never",
},
layout: { maxColumns: 2, maxRows: 2 },
}}
It didn't stop the CORS error from showing, but I managed to get this:
Also note that the paypal parameter is also errored in the intellisense.
{
"error": {
"code": "parameter_missing",
"doc_url": "https://stripe.com/docs/error-codes/parameter-missing",
"message": "Missing required param: is_shipping_required.",
"param": "is_shipping_required",
"type": "invalid_request_error"
}
}
Hi there! I'll be stepping in for Pompey here
that looks like a server-side error - where is it being surfaced? what action?
const onConfirm = async (event: StripeExpressCheckoutElementConfirmEvent) => {
setError(null)
try {
if (!stripe || !elements) {
setError("Payment processing not ready. Please try again.")
return
}
await elements.submit().catch((err) => {
console.error(err)
setError(err.message || "An error occurred with the payment")
return
})
} catch (err: any) {
setError(err.message)
}
}
This is my onConfirm, if that's what you mean
That will work - did you log out any objects from that request? Like a PaymentIntent id?
I can do, which objects would help?
PaymentIntent would be enough
I don't think it runs onConfirm
Yeah it doesn't make it to onConfirm, it's as soon as I click on the button
That's okay - can I have your account id or literally any object id created on that account?
Where can i get this from
acct_1R9pAuBCIsGHwpVC
Yeah unfortunately those calls are not making it to us
I think this shouldn't be required but can you add the parameter below and try again? I'm hoping we can get a call that makes it to our API and then I can inspect what's going on a little more fully
I can make it to the paypal payment flow now. Are there any test accounts for paypal to simulate a successful payment?
There are only failed scenarios there
Did you try a random/fake email address?
You are using testmode API keys, right?
Yeah they are all prefixed with sk_test/pk_test, from my sandbox environment
๐ Stepping in for my teammate here, give me a few minutes to catch up
You'll need to create a Paypal sandbox test account then use this during testing: https://docs.stripe.com/elements/express-checkout-element/accept-a-payment#paypal
I've managed to make the checkout complete, however I cannot find where I would allow users to select shipping rates in the express flow?