Checkout form data returns 200 whether its success or failure

I have a shopping cart I built. All works as it should except the api connector from the form to the credit card processor returns a http 200 whether its a success or failure. I need my form to redirect according to success or failure of the card. How can do that? I can’t use the standard wappler success/error etc to do it? Because either way it returns 200

the app.dmx.data from console info

I basically need the onsuccess event to go to checkout-confirm is success or check-problem if failure

Basically take this

 dmx-on:success="cart.clear();browser1.goto('Checkout-Complete')" 

and then something like browser1.goto( if data.apiSubmitPayment.data = ‘success’ then a certain page or if data.apiSubmitPayment.data = ‘failure’ go to a different page

There is a condition step you could use if you choose inline-flow for the dmx-on:success event

1 Like

Hi Baub,

On success run an inline flow with Condition if the substring “=SUCCESS” exists, then use a Run step and run the browser1.goto operation

1 Like

Yeah just about the time I posted this I figure out I could do the onsuccess with a flow. Working that up now…

1 Like

how do I setup the if statement?

I basically need to check for something like this, but needs to be contains or something?

payment_form.data.apiSubmitPayment.data.responsetext = 'Success'


do I have to parse that last data string out some way so that I can check for responsetext=’success’

Got it! Thanks for the help guys. This is what I check for in my condition

payment_form.data.apiSubmitPayment.data.contains('SUCCESS', false)