Skip to content

Instantly share code, notes, and snippets.

@jitendrapurohit
Created September 30, 2023 15:42
Show Gist options
  • Save jitendrapurohit/03a851d0c7e1c54ec7a68c746cabeffc to your computer and use it in GitHub Desktop.
Save jitendrapurohit/03a851d0c7e1c54ec7a68c746cabeffc to your computer and use it in GitHub Desktop.
diff --git a/CRM/Stripe/PaymentIntent.php b/CRM/Stripe/PaymentIntent.php
index 87d6189..74ceea4 100644
--- a/CRM/Stripe/PaymentIntent.php
+++ b/CRM/Stripe/PaymentIntent.php
@@ -413,6 +413,12 @@ class CRM_Stripe_PaymentIntent {
$intentParams = [];
$intentParams['confirm'] = TRUE;
+ $intentParams['confirmation_method'] = 'manual';
+ if (empty($params['paymentIntentID']) && empty($params['paymentMethodID'])) {
+ $intentParams['confirm'] = FALSE;
+ $intentParams['confirmation_method'] = 'automatic';
+ }
+ $intentParams['payment_method_types'] = ['card'];
if (!empty($params['paymentIntentID'])) {
try {
@@ -446,8 +452,8 @@ class CRM_Stripe_PaymentIntent {
$intentParams['customer'] = $params['customer'];
}
- $intentParams['automatic_payment_methods']['enabled'] = TRUE;
- $intentParams['automatic_payment_methods']['allow_redirects'] = 'never';
+ // $intentParams['automatic_payment_methods']['enabled'] = TRUE;
+ // $intentParams['automatic_payment_methods']['allow_redirects'] = 'never';
$intent = $this->paymentProcessor->stripeClient->paymentIntents->create($intentParams);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment