Wei
Wei

Reputation: 23

Display description for a plan on Stripe checkout page

I am using Stripe Checkout and was wondering how to display some message on the Checkout page for a subscription. I have:

  1. created product and plan on the Stripe dashboard.

  2. created session in my php code:

$session = \Stripe\Checkout\Session::create([
   'payment_method_types' => ['card'],
   'billing_address_collection' => 'required',
   'subscription_data' => [
      'items' => [
         [
          'plan' => $plan_id
         ]
      ],
   ],
   'success_url' => $success_url.'?session_id={CHECKOUT_SESSION_ID}',
   'cancel_url' => $cancel_url,
]);
  1. then passed the session id to js and redirect to the checkout page:
unction redirect(id){
   var stripe = Stripe('pk_test_######################');
   stripe.redirectToCheckout({
      sessionId: id
   }).then(function (result) {
      result.error.message = 'error';
   });
}
redirect('<? echo $session->id; ?>');

The payment is made successfully.

Now I am just really curious about where can I (or is it possible to) add some message on the checkout page. I know for a one-time payment, you can add 'description' to 'line_items' when creating the session. However I found no clue of how to do it for a subscription.

Thanks in advance!

Upvotes: 2

Views: 748

Answers (1)

Nolan H
Nolan H

Reputation: 7419

Unfortunately, that's not possible today.

I'd recommend signing up for the Checkout Roadmap mailing list to be notified of changes to Checkout in the future.

Upvotes: 1

Related Questions