From 27a0c046dfc2e69ff700468e685f0f99ff55a52c Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 18 Jul 2019 09:58:26 +0200 Subject: [PATCH 1/4] Update stripe.class.php --- htdocs/stripe/class/stripe.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 6b910236e96..b5db41a424e 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -392,14 +392,14 @@ class Stripe extends CommonObject "payment_method_types" => array("card"), "description" => $description, "statement_descriptor" => dol_trunc($tag, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description) - //"save_payment_method" => true, + "setup_future_usage" => "off_session", "metadata" => $metadata ); if (! is_null($customer)) $dataforintent["customer"]=$customer; // payment_method = // payment_method_types = array('card') //var_dump($dataforintent); - + if ($conf->entity!=$conf->global->STRIPECONNECT_PRINCIPAL && $stripefee > 0) { $dataforintent["application_fee"] = $stripefee; From 8a5aad34337723af0fa479c0f67487efbe0f97e3 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 18 Jul 2019 10:00:57 +0200 Subject: [PATCH 2/4] Update stripe.class.php --- htdocs/stripe/class/stripe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index b5db41a424e..e4b021167e0 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -399,7 +399,7 @@ class Stripe extends CommonObject // payment_method = // payment_method_types = array('card') //var_dump($dataforintent); - + if ($conf->entity!=$conf->global->STRIPECONNECT_PRINCIPAL && $stripefee > 0) { $dataforintent["application_fee"] = $stripefee; From 4235f0b3523694c1ef7d3587e3539dae3dd75fd1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 18 Jul 2019 10:05:54 +0200 Subject: [PATCH 3/4] Update stripe.class.php --- htdocs/stripe/class/stripe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index e4b021167e0..993fe6a07dd 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -392,7 +392,7 @@ class Stripe extends CommonObject "payment_method_types" => array("card"), "description" => $description, "statement_descriptor" => dol_trunc($tag, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description) - "setup_future_usage" => "off_session", + "setup_future_usage" => "on_session", "metadata" => $metadata ); if (! is_null($customer)) $dataforintent["customer"]=$customer; From 8857d0acf5404dfc5f966cbd771386ba2d07bc36 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 03:18:53 +0200 Subject: [PATCH 4/4] Keep save_payment_method to true. Keep it to true because i see no reason to not save the credit card on Stripe side. --- htdocs/stripe/class/stripe.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 993fe6a07dd..319ff08d2cd 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -392,7 +392,8 @@ class Stripe extends CommonObject "payment_method_types" => array("card"), "description" => $description, "statement_descriptor" => dol_trunc($tag, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description) - "setup_future_usage" => "on_session", + "save_payment_method" => true, + "setup_future_usage" => "on_session", "metadata" => $metadata ); if (! is_null($customer)) $dataforintent["customer"]=$customer;