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

Drop support for passing 'capture=true' into intent processor

parent afeeaf73
Branches
Tags
No related merge requests found
......@@ -335,8 +335,6 @@ class CRM_Stripe_PaymentIntent {
*/
public function processIntent(array $params) {
// Params that may or may not be set by calling code:
// 'capture' was used by civicrmStripeConfirm.js and was removed when we added setupIntents.
$params['capture'] = $params['capture'] ?? FALSE;
// 'currency' should really be set but we'll default if not set.
$currency = \CRM_Utils_Type::validate($params['currency'], 'String', \CRM_Core_Config::singleton()->defaultCurrency);
// If a payment using MOTO (mail order telephone order) was requested.
......@@ -359,7 +357,7 @@ class CRM_Stripe_PaymentIntent {
$processPaymentIntentParams = [
'paymentIntentID' => $params['intentID'],
'paymentMethodID' => $params['paymentMethodID'],
'capture' => $params['capture'],
'capture' => FALSE,
'amount' => $params['amount'],
'currency' => $currency,
'payment_method_options' => $params['payment_method_options'] ?? [],
......@@ -428,9 +426,6 @@ class CRM_Stripe_PaymentIntent {
if ($intent->status === 'requires_confirmation') {
$intent->confirm();
}
if ($params['capture'] && $intent->status === 'requires_capture') {
$intent->capture();
}
}
catch (Exception $e) {
\Civi::log()->debug(get_class($e) . $e->getMessage());
......
......@@ -98,7 +98,7 @@ class ProcessMOTO extends \Civi\Api4\Generic\AbstractAction {
}
if (empty($this->amount) && !$this->setup) {
\Civi::log('stripe')->error(__CLASS__ . 'missing amount and not capture or setup');
\Civi::log('stripe')->error(__CLASS__ . 'missing amount and not setup');
throw new \API_Exception('Bad request');
}
if (empty($this->paymentProcessorID)) {
......
......@@ -107,7 +107,7 @@ class ProcessPublic extends \Civi\Api4\Generic\AbstractAction {
}
if (empty($this->amount) && !$this->setup) {
\Civi::log('stripe')->error(__CLASS__ . 'missing amount and not capture or setup');
\Civi::log('stripe')->error(__CLASS__ . 'missing amount and not setup');
throw new \CRM_Core_Exception('Bad request');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment