diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 9c0bc9ebae3..6379aa36746 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -654,7 +654,7 @@ class Stripe extends CommonObject * @param string $stripeacc ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect * @param int $status Status (0=test, 1=live) * @param int $createifnotlinkedtostripe 1=Create the stripe card and the link if the card is not yet linked to a stripe card - * @return \Stripe\StripeCard|null Stripe Card or null if not found + * @return \Stripe\StripeCard|\Stripe\PaymentMethod|null Stripe Card or null if not found */ public function cardStripe($cu, CompanyPaymentMode $object, $stripeacc = '', $status = 0, $createifnotlinkedtostripe = 0) { @@ -680,10 +680,24 @@ class Stripe extends CommonObject { try { if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage - $card = $cu->sources->retrieve($cardref); + if (! preg_match('/^pm_/', $cardref)) + { + $card = $cu->sources->retrieve($cardref); + } + else + { + $card = \Stripe\PaymentMethod::retrieve($cardref); + } } else { - //$card = $cu->sources->retrieve($cardref, array("stripe_account" => $stripeacc)); // this API fails when array stripe_account is provided - $card = $cu->sources->retrieve($cardref); + if (! preg_match('/^pm_/', $cardref)) + { + //$card = $cu->sources->retrieve($cardref, array("stripe_account" => $stripeacc)); // this API fails when array stripe_account is provided + $card = $cu->sources->retrieve($cardref); + } + else { + //$card = \Stripe\PaymentMethod::retrieve($cardref, array("stripe_account" => $stripeacc)); // Don't know if this works + $card = \Stripe\PaymentMethod::retrieve($cardref); + } } } catch(Exception $e) @@ -707,12 +721,28 @@ class Stripe extends CommonObject //$a = \Stripe\Stripe::getApiKey(); //var_dump($a);var_dump($stripeacc);exit; - dol_syslog("Try to create card dataforcard = ".json_encode($dataforcard)); + dol_syslog("Try to create card with dataforcard = ".json_encode($dataforcard)); try { if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage - $card = $cu->sources->create($dataforcard); + if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) + { + $card = $cu->sources->create($dataforcard); + } + else + { + // TODO + dol_syslog("Error: This case is not supported", LOG_ERR); + } } else { - $card = $cu->sources->create($dataforcard, array("stripe_account" => $stripeacc)); + if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) + { + $card = $cu->sources->create($dataforcard, array("stripe_account" => $stripeacc)); + } + else + { + // TODO + dol_syslog("Error: This case is not supported", LOG_ERR); + } } if ($card) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 17532380337..334fbe00ba1 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -655,6 +655,14 @@ select.flat.selectlimit { max-width: 0; overflow: auto; } +.divintdwithtwolinesmax { + width: 75px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; +} + .tablelistofcalendars { margin-top: 25px !important; } diff --git a/htdocs/theme/md/main_menu_fa_icons.inc.php b/htdocs/theme/md/main_menu_fa_icons.inc.php index 681c90c75ae..4386d607050 100644 --- a/htdocs/theme/md/main_menu_fa_icons.inc.php +++ b/htdocs/theme/md/main_menu_fa_icons.inc.php @@ -9,7 +9,7 @@ font-variant: normal; text-rendering: auto; line-height: 26px; - font-size: ; + font-size: 1.5em; -webkit-font-smoothing: antialiased; text-align:center; text-decoration:none;