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

Cards that are confirmed by the user (eg. via 3dsecure) require confirmation...

Cards that are confirmed by the user (eg. via 3dsecure) require confirmation before the payment can be captured. Other cards don't. Support both
parent 7c63f757
Branches
Tags
No related merge requests found
......@@ -435,8 +435,13 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
try {
$intent = \Stripe\PaymentIntent::retrieve($paymentIntentID);
$intent->description = $params['description'] . ' # Invoice ID: ' . CRM_Utils_Array::value('invoiceID', $params);
$intent->confirm();
$intent->capture(['amount_to_capture' => $this->getAmount($params)]);
switch ($intent->status) {
case 'requires_confirmation':
$intent->confirm();
case 'requires_capture':
$intent->capture(['amount_to_capture' => $this->getAmount($params)]);
break;
}
}
catch (Exception $e) {
$this->handleError($e->getCode(), $e->getMessage(), $params['stripe_error_url']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment