Mistake in wix pay 'Processing Payments' Corvid Tutorial

Hello!
https://support.wix.com/en/article/corvid-tutorial-processing-payments

I implemented the wix Pay api in my website with this tutorial but things weren’t working as desired, so I opened the chrome developer tools and saw that, in the JavaScript of my page, the then method of startPayment is triggering right after the form opens, and it’s set to undefined, so it throws an error, because you can’t have result.status if result is undefined.

The tutorial insted says that the .then ia triggered when the user completes the form, which is not happening to me in my page.

Anything to help would be so much appreciated!

Thanks :slight_smile:

Hi Dani :raised_hand_with_fingers_splayed:

Can you share the site URL?

sjmalbal.com/code-samples

There you have a buttpn with a payment of one

I think you need to remove these }); (The ones inside the green circle), you copied them by mistake.

What you’re doing is getting the (result) object from the function " createPaymentFor…() " instead of getting it from the startPayment() function.

Try it and tell me if it worked :wink:

Ahmad

Working now Ahmad. Thanks always for your awesome help :slight_smile:

You’re welcome Dani, any time :blush: