I have created the checkout session as below:
checkout_session = stripe.checkout.Session.create(
success_url=domain_url + 'success?session_id={CHECKOUT_SESSION_ID}',
cancel_url=request.session['latestURL'],
payment_method_types=['card'],
mode='payment',
line_items=[
{
'name': 'Awesome Product',
'quantity': 1,
'currency': 'usd',
'amount': price,
}
]
)
return JsonResponse({'sessionId': checkout_session['id']})
except Exception as e:
return JsonResponse({'error': str(e)})
I have also created a product using stripe dashboard and have the product id. Now how can I pass that product id in the above checkout session so that my product image and price info will be displayed in checkout page. In the above I have pass product name price manually. I want to directly link it with the product I have created from stripe dashboard. How can I do this?