#jonastex_api
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/1226880909463130252
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there ๐ can you tell me a bit more about what you're describing when you say "it then cancels it"? Can you share the ID of a Payment Intent from your testing where you saw this behavior?
I don't have an ID because the payment doesn't even exist on my dashboard
Can you tell me more about what is being canceled then? I thought you were referring to a Payment Intent.
No, when i use my phone on safari i see the button for use apple pay, when i use the button Apple asks me which card I want to use... and then he proceeds to payment but after the paiement its cancel. I am using my test token, is this due to this?
Are you testing in livemode or testmode? Is your code that is processing the payment throwing any errors? What debugging have you done so far?
in testmode, i don't have error in my log, i have try to replace this php $intent = $stripe->paymentIntents->create([ 'customer' => $id_customer, 'setup_future_usage' => 'off_session', 'amount' => 1099, 'currency' => 'eur', 'automatic_payment_methods' => [ 'enabled' => 'true', ], ]);
by this php $intent = $stripe->paymentIntents->create([ 'customer' => $id_customer, 'setup_future_usage' => 'off_session', 'amount' => 1099, 'currency' => 'eur', 'payment_method_types' => ['card', 'google_pay', 'apple_pay'], ]); but it nothing work
Huh? Do you have a publicly accessible test site I can look at?
A demo of payment on Stripe
Okay, so this looks like an Express Checkout Element integration, not the Payment Element.
Ah, ok ok Do you have a solution to resolve payment issues?
I'm still trying to figure out what the behavior you're describing is. Sorry, the server has been very busy so I haven't had too much time to debug this for you.
Okay okay
Looking at browser console I see this error:
Unhandled Promise Rejection: IntegrationError: Unhandled expressCheckout Element confirm event. Make sure to register a confirm handler.
Did you add the logic shown here to process the payment for your Express Checkout Element?
https://docs.stripe.com/elements/express-checkout-element/accept-a-payment#submit-the-payment
Also taking a step back, did you want a separate Express Checkout Element instead of using the Payment Element ot accept wallet payments?
What is the difference? because after I use another PHP code to subscribe the user to a subscription
They're two distinct types of Elements, both of which would need their own logic if you use them side by side. The Express Checkout Element is designed to accept wallet based payment methods, the Payment Element is designed to accept most types of Payment Methods that we support.
Did you add the logic shown here to process the payment for your Express Checkout Element?
Yes i use this
Do you wan't my code for look ?
I don't need it, I'm scanning your code using Safari and see that isn't there.
Ok the Payment Element requires a redirection on one of your sites?
Okay okay i look that
The Payment Element may require a redirect to a third-party site depending on the type of payment method types you're accpeting.
I have add this code but I have the same result js const expressCheckoutElement = elements.create('expressCheckout'); expressCheckoutElement.mount('#express-checkout-element'); expressCheckoutElement.on('confirm', async (event) => { handleSubmit(event); });
What error do you see in the browser console now?
I'm trying payment with Apple Pay directly on my phone, so I don't have a console
You should find a way to test this where you can see the console. It's crucial to your debugging efforts to be able to see the errors you're running into.
Ok, I corrected a few lines and it works, thank you
Glad to hear! Any time!