#woakaley-ionic

1 messages ยท Page 1 of 1 (latest)

olive gate
#

๐Ÿ‘‹ happy to help

#

if I understood correctly you are bundling your webhook endpoint in your hybrid app?

median sundial
#

Well, yes. I have a wordpress backend, with rest api's, with a Ionic/Angular front end.

#

This is the error log

#

And in test mode, everything were working fine. I even tried to switch back, and it worked. But when i am trying to test the payment in live mode, it gives me the attached error.

olive gate
#

the webhook endpoint should be part of your backend and not your frontend

median sundial
#

Yepp, I know. It's in my backend. Otherwise it would not work in test mode neither.

#

This was a log in test mode. The origin is the same

#

And it worked.

#

Maybe its not working, because my backend is still on a dev environment on our own server?

#

If i put the backend on a live environment, the payment would work? WHat do you think?

olive gate
#

in test mode we print a warning to the console that the domain youโ€™re redirecting to Checkout from is not valid, in live mode that is stepped up to an error

#

this is why it's not working

#

in production

#

so the only way to fix this issue is to change your integration from being a client only integration and use full client-server Checkout, or use PaymentLinks

median sundial
#

Hmm, I think i understood what do to. Basically I have to make my dev backend into a live domain. like app.example.com, where my backend lives, so the stripe will see the domains. Am i right?

median sundial
#

I mean the way i integrated Stripe in my app.

olive gate
#

yes exactly, this is the only solution

median sundial
#

Can i find some examples for full client-server Checkout ?

#

in php? ๐Ÿ˜„

#

Or maybe the payment link is the easiest way to do this. I dont know. This is my first experience with Stripe.

olive gate
median sundial
#

Hmm, but the think is that, i need a response when the payment was successful. I have to change the subscription status to Active in my backend, if the payment was fine.

#

Can i do that with payment links as well?

olive gate
#

yes using the webhook endpoint

#

you can listen to checkout.session.completed

median sundial
#

Ohh, okey. SO basically i dont have to change my php file, where i listen to the stripe webhook, i just have to place the payment link somehow into my code, so when the user clicks the Pay with Card button, it will redirect him to the payment link.

olive gate
#

yes

median sundial
#

Well, thank you very much for your fast responses ๐Ÿ™‚ It helped. I will try the payment links, and If i have further questions, can we keep this thread for a few days?

olive gate
#

threads are kept open for 1h of inactivity unfortunately, but feel free to come back to the main channel and ask your questions, a colleague will pick it up if I'm not around

median sundial
#

Alright, thanks!