From eb0d04f3047277c17c48edefa24f48b837f5ade1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Jun 2019 11:24:35 +0200 Subject: [PATCH] Code comment --- htdocs/stripe/class/stripe.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 1d81e12da8c..de43c063922 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -242,7 +242,7 @@ class Stripe extends CommonObject * Warning. If a payment was tried and failed, a payment intent was created. * But if we change someting on object to pay (amount or other), reusing same payment intent is not allowed. * Recommanded solution is to recreate a new payment intent each time we need one (old one will be automatically closed after a delay), - * that's why i comment the part of code to retreive a payment intent with object id (never mind if we cumulate payment intent with old that will not be used) + * that's why i comment the part of code to retreive a payment intent with object id (never mind if we cumulate payment intent with old ones that will not be used) * * @param double $amount Amount * @param string $currency_code Currency code @@ -366,6 +366,7 @@ class Stripe extends CommonObject global $stripearrayofkeysbyenv; \Stripe\Stripe::setApiKey($stripearrayofkeysbyenv[$status]['secret_key']); + // Note: If all data for payment intent are same than a previous on, even if we use 'create', Stripe will return ID of the old existing payment intent. if (empty($key)) { // If the Stripe connect account not set, we use common API usage $paymentintent = \Stripe\PaymentIntent::create($dataforintent, array("idempotency_key" => "$description")); //$paymentintent = \Stripe\PaymentIntent::create($dataforintent, array()); @@ -373,7 +374,7 @@ class Stripe extends CommonObject $paymentintent = \Stripe\PaymentIntent::create($dataforintent, array("idempotency_key" => "$description", "stripe_account" => $key)); //$paymentintent = \Stripe\PaymentIntent::create($dataforintent, array("stripe_account" => $key)); } - //var_dump($paymentintent); + //var_dump($paymentintent->id); // Store the payment intent if (is_object($object))