1

I developped the last Stripe module for the end of the year as they ask, but since I put it, I haven't any more the description and the name of the customer in Stripe.

Do you know how can I put it again ?

This is my code in PHP :

 try { $session = \Stripe\Checkout\Session::create([ 'payment_method_types' => ['card'], 'customer_email' => $email, 'line_items' => [[ 'price_data' => [ 'product_data' => [ 'name' => $custom['item_name'], 'metadata' => [ 'pro_id' => $custom['item_name'] ] ], 'unit_amount' => (isset($custom['amountTotal']) ? $custom['amountTotal'] : $custom['amount'])*100, 'currency' => $custom['currency_code'], ], 'quantity' => 1, 'description' => $custom['item_name'], ]], 'mode' => 'payment', 'success_url' => $url, 'cancel_url' => $request->cancel, ], ['stripe_account' => $_SESSION['param']->stripeUID]); }catch(Exception $e) { $api_error = $e->getMessage(); } if(empty($api_error) && $session){ $response = array( 'status' => 1, 'message' => 'Checkout Session created successfully!', 'sessionId' => $session['id'] ); }else{ $response = array( 'status' => 0, 'error' => array( 'message' => 'Checkout Session creation failed! '.$api_error ) ); } 

And this is what I have now enter image description here

1

2 Answers 2

7

You should be able to set it here: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-description

Sign up to request clarification or add additional context in comments.

2 Comments

Great working well !! Thank you I haven't read it carfully
It is also worth knowing that the payment_intent_data.description only works for payment mode and not subscription.
2

just add this line so the description appears, I mark it with asterisks or in bold

 'payment_method_types' => ['card'], '**payment_intent_data**' => [ 'description' => ''.$productName.'' ], 'line_items' => [[ 'price_data' => [ 'product_data' => [ 'name' => $productName, 'description' => ''.$productName.'', 'metadata' => [ 'pro_id' => $productID ] ], 'unit_amount' => $stripeAmount, 'currency' => $currency, ], 'quantity' => 1, 'description' => $descripcion, ]], 'mode' => 'payment', 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.