【发布时间】:2020-07-17 04:25:51
【问题描述】:
我创建了如下的结帐会话:
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)})
我还使用条纹仪表板创建了一个产品并拥有产品 ID。现在如何在上述结帐会话中传递该产品 ID,以便我的产品图像和价格信息将显示在结帐页面中。在上面我已经手动传递了产品名称价格。我想直接将它与我从条带仪表板创建的产品链接。我该怎么做?
【问题讨论】:
-
我想你可能是这个意思,对吧? stripe.com/docs/payments/checkout/…