#maya121

1 messages · Page 1 of 1 (latest)

blissful reefBOT
sand raven
#

👋 let's chat here! could you share more context on what you need help with?

urban vale
#

I need help with the integration of error messages in payments, that is, when a card is insufficient, tell me with a pop-up screen

#

I already tried with the api error code but it gives me a fatal exception error 402

sand raven
#

the line that handles displaying the error message is:
messageContainer.textContent = error.message;

urban vale
#

I tried the try cacth function and it gives me a fatal error. I need an example.

#

ok and if the payment is denied and I want to show you you do not have funds

sand raven
urban vale
#

ok i already did it but using this

function example_function($args) {
try {
$stripe->paymentIntents->create($args);
error_log("No error.");
} catch(\Stripe\Exception\CardException $e) {
error_log("A payment error occurred: {$e->getError()->message}");
} catch (\Stripe\Exception\InvalidRequestException $e) {
error_log("An invalid request occurred.");
} catch (Exception $e) {
error_log("Another problem occurred, maybe unrelated to Stripe.");
}

#

help