fix strip exception logging

This commit is contained in:
2023-07-11 10:52:34 +10:00
parent c662567384
commit 1258fcdb7c

View File

@@ -222,20 +222,20 @@ function booking_stripe_validate_form_payment($form, &$form_state) {
} }
} }
catch(\Stripe\Error\Card $e) { catch(\Stripe\Error\Card $e) {
$e_json = $e->getJsonBody(); //$e_json = $e->getJsonBody();
$error = $e_json['error']; //$error = $e_json['error'];
watchdog('booking', "<pre>Detected exception processing Stripe payment (!message)\n@info</pre>", watchdog('booking', "<pre>Detected exception processing Stripe payment (!message)\n@info</pre>",
array('!message' => $e->getMessage(), '@info' => var_dump( $e->getTraceAsString() ))); array('!message' => $e->getMessage(), '@info' => $e->getTraceAsString() ));
drupal_set_message($e->getMessage(), 'error'); drupal_set_message($e->getMessage(), 'error');
} }
catch (\Stripe\Error\ApiConnection $e) { catch (\Stripe\Error\ApiConnection $e) {
watchdog('booking', "<pre>Detected exception processing Stripe payment (!message)\n@info</pre>", watchdog('booking', "<pre>Detected exception processing Stripe payment (!message)\n@info</pre>",
array('!message' => $e->getMessage(), '@info' => var_dump( $e->getTraceAsString() ))); array('!message' => $e->getMessage(), '@info' => $e->getTraceAsString() ));
drupal_set_message($e->getMessage(), 'error'); drupal_set_message($e->getMessage(), 'error');
} }
catch (\Stripe\Error\Api $e) { catch (\Stripe\Error\Api $e) {
watchdog('booking', "<pre>Detected exception processing Stripe payment (!message)\n@info</pre>", watchdog('booking', "<pre>Detected exception processing Stripe payment (!message)\n@info</pre>",
array('!message' => $e->getMessage(), '@info' => var_dump( $e->getTraceAsString() ))); array('!message' => $e->getMessage(), '@info' => $e->getTraceAsString() ));
drupal_set_message($e->getMessage(), 'error'); drupal_set_message($e->getMessage(), 'error');
} }
catch (\Stripe\Exception\CardException $e) { catch (\Stripe\Exception\CardException $e) {