Stripe - responding to errors in SC

I’ve just started using Wappler’s Stripe features. I have a very basic requirement - to submit payment details and capture the payment later. I’ve added a Checkout Form using App Connect, and used a Create Setup Intent Template in Server Connect, setting the payment method to Manual. This all works fine and was easy to set up.

After the card details are successfully submitted and payment authorised, I want to store the details and add a button to capture the details etc. Again, this seems straightforward. What I’m not clear about is how to handle errors such as ‘card declined’ etc. I would like to add a condition before the insert here:

image

…but can’t get any value returned to use in the condition. Eg pmt_status above returns ‘requires_payment_method’ which doesn’t help. I’ve tried various promising options, but they don’t return any values, eg:
createPaymentIntent.last_payment_error.code
createPaymentIntent.last_payment_error.decline_code
createPaymentIntent.last_payment_error.message

if the payment is authorised, I would like to store ‘requires capture’ for the payment status, but I don’t know where to find that either.

The dynamic events in the Stripe Checkout Form in App Connect reflect the status of the card authorisation. Is this the way to approach the problem? It just seems that it ought to be possible to to access the relevant responses in Server Connect. I think I’m missing some of the basics of how this should work.

I would be grateful for any suggestions.

Community Page
Last updated: