Commit 99f79b7d authored by Mark Harding's avatar Mark Harding

(fix): catch error when adding payment method

1 merge request!254&37 - Multi-currency
Pipeline #79208479 failed with stages
in 4 minutes and 38 seconds
......@@ -46,7 +46,14 @@ class apply implements Interfaces\Api
}
// Save the payment method
$paymentMethodsManager->add($paymentMethod);
try {
$paymentMethodsManager->add($paymentMethod);
} catch (\Exception $e) {
return Factory::response([
'status' => 'error',
'message' => 'Sorry, there was an error. Please try again',
]);
}
return Factory::response([]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment