From 999e36344616c199a8cf5ebb3ba28831f369036e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 13:52:37 +0100 Subject: [PATCH] Update charge.php --- htdocs/stripe/charge.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 3483efcaa18..992b5266b5b 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -142,7 +142,11 @@ if (!$rowid) } if (! empty($charge->payment_intent)) { - $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); + if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent); + } else { + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); + } } // The metadata FULLTAG is defined by the online payment page