From 6e605df1c12b38727449be9135c87c8509404ea1 Mon Sep 17 00:00:00 2001 From: "Esteban L. Castro" <43482256+elcf@users.noreply.github.com> Date: Thu, 2 May 2024 13:37:52 -0400 Subject: [PATCH] Updated Stripe code for inline items (#29577) (#29589) Changes made according to: https://docs.stripe.com/payments/checkout/migrating-prices?integration=server#server-side-code-for-inline-items --- htdocs/public/payment/newpayment.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 9825b331f1b..c8791b4c09f 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -2381,13 +2381,18 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme $arrayforcheckout = array( 'payment_method_types' => array('card'), 'line_items' => array(array( - 'name' => $langs->transnoentitiesnoconv("Payment").' '.$TAG, // Label of product line - 'description' => 'Stripe payment: '.$FULLTAG.($ref ? ' ref='.$ref : ''), - 'amount' => $amountstripe, - 'currency' => $currency, - //'images' => array($urllogofull), + 'price_data' => array( + 'currency' => $currency, + 'unit_amount' => $amountstripe, + 'product_data' => array( + 'name' => $langs->transnoentitiesnoconv("Payment").' '.$TAG, // Label of product line + 'description' => 'Stripe payment: '.$FULLTAG.($ref ? ' ref='.$ref : ''), + //'images' => array($urllogofull), + ), + ), 'quantity' => 1, )), + 'mode' => 'payment', 'client_reference_id' => $FULLTAG, 'success_url' => $urlok, 'cancel_url' => $urlko,