Merge pull request #22658 from ptibogxiv/patch-55

Fix newpayment.php with stripeconnect
This commit is contained in:
Laurent Destailleur 2022-10-24 17:18:11 +02:00 committed by GitHub
commit f4d9301199
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2390,7 +2390,17 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme
// Code for payment with option STRIPE_USE_NEW_CHECKOUT set
// Create a Stripe client.
<?php
if (empty($stripeacc)) {
?>
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>');
<?php
} else {
?>
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>', { stripeAccount: '<?php echo $stripeacc; ?>' });
<?php
}
?>
// Create an instance of Elements
var elements = stripe.elements();
@ -2433,9 +2443,19 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme
} elseif (!empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) {
?>
// Code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION set to 1 or 2
// Create a Stripe client.
<?php
if (empty($stripeacc)) {
?>
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>');
<?php
} else {
?>
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>', { stripeAccount: '<?php echo $stripeacc; ?>' });
<?php
}
?>
<?php
if (getDolGlobalInt('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION') == 2) {