Firstly, I realise that others have asked this question in the past, but none of them actually conclude with a definitive answer. I’m also aware of Yisrael’s Stripe payment processing example, which I may end up utilising if I can’t get this to fully work, but I’m hesitant as my current process works 95% of the time (and doesn’t require any use of the Stripe npm/api).
I’ve built a payment flow using the wixPay and wixPayBackend modules to process a payment (connected to Stripe) and then emails the customer with an access code. Initially, I had issues making onPaymentUpdate() fire automatically and found that I could bypass it by just using the ‘.status’ item on the startPayment() function for Wix Pay frontend (this fires when a customer completes or cancels the payment popup).
This method works well, and does everything it’s supposed to… but only 95% of the time. On occasions, the customer payment will go through, and nothing happens. This seems to be down to onPaymentUpdate() not firing (as I think that is also referenced by startPayment() anyway).
As this seems to be something that others have faced difficulty with, has anyone got a payment flow that works flawlessly every time? I.e you can insert an item to a database EVERY time someone makes a payment?
Happy to post code snippets or provide access to Wix staff.