Skip to content
Snippets Groups Projects
Commit 6639afb8 authored by mattwire's avatar mattwire
Browse files

Use getErrorUrl function

parent 863d3609
Branches
Tags
1 merge request!241Stripe Import extension
......@@ -716,7 +716,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
}
catch (Exception $e) {
$parsedError = $this->parseStripeException('doPayment', $e);
$this->handleError($parsedError['code'], $parsedError['message'], ($propertyBag->has('error_url') ? $propertyBag->getCustomProperty('error_url') : ''), FALSE);
$this->handleError($parsedError['code'], $parsedError['message'], $this->getErrorUrl($propertyBag), FALSE);
}
// @fixme FROM HERE we are using $params ONLY - SET things if required ($propertyBag is not used beyond here)
......@@ -754,7 +754,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
'email' => $propertyBag->getEmail(),
'currency' => mb_strtolower($propertyBag->getCurrency()),
// Include this to allow redirect within session on payment failure
'error_url' => $propertyBag->getCustomProperty('error_url'),
'error_url' => $this->getErrorUrl($propertyBag),
];
// Get the Stripe Customer:
......@@ -1048,7 +1048,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
}
}
catch (Exception $e) {
$this->handleError($e->getCode(), $e->getMessage(), $params['error_url']);
$this->handleError($e->getCode(), $e->getMessage(), $params['error_url'] ?? '');
}
finally {
// Always update the paymentIntent in the CiviCRM database for later tracking
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment