diff --git a/api/v3/StripePaymentintent.php b/api/v3/StripePaymentintent.php index 07f5bab3ca294b540cdc9f88c40b720c25a0233c..b4d9f43bc3d1002caf64c5a0f8409dcd9633c67e 100644 --- a/api/v3/StripePaymentintent.php +++ b/api/v3/StripePaymentintent.php @@ -142,9 +142,9 @@ function civicrm_api3_stripe_paymentintent_process($params) { _civicrm_api3_stripe_paymentintent_returnInvalid(); } } - $paymentMethodID = CRM_Utils_Type::validate($params['payment_method_id'], 'String'); - $paymentIntentID = CRM_Utils_Type::validate($params['payment_intent_id'], 'String'); - $capture = CRM_Utils_Type::validate($params['capture'], 'Boolean', FALSE); + $paymentMethodID = CRM_Utils_Type::validate($params['payment_method_id'] ?? '', 'String'); + $paymentIntentID = CRM_Utils_Type::validate($params['payment_intent_id'] ?? '', 'String'); + $capture = CRM_Utils_Type::validate($params['capture'] ?? NULL, 'Boolean', FALSE); $amount = CRM_Utils_Type::validate($params['amount'], 'String'); // $capture is normally true if we have already created the intent and just need to get extra // authentication from the user (eg. on the confirmation page). So we don't need the amount