I am building a Saas project. This system has several pricing plans. The first-time users should pay an additional amount of money. This money is charged only once per account and is not required anymore after the user paid once regardless of the purchased plan. It seems Stripe have no such option. And if I use the normal checkout method and subscription method together, the user should pay twice the first time. This is bad for the user experience. I would be appreciate if you could help me to solve this problem. In addition, I am using Django React for the project.
CodePudding user response:
I think You can create a field in your models.py to keep that if the user paid the money once, It will change to True, It will be False default.
when user is paying you can change this field to True and next times you can check if this field is not True, You have handle pay processing for first time.
CodePudding user response:
When creating the subscription you can use add_invoice_items
to have one-time items added to the first invoice only:
stripe.Subscription.create(
customer="{{ CUSTOMER_ID }}",
items=[{
'price': '{{ RECURRING_PRICE_ID }}'
}],
add_invoice_items=[{
'price': '{{ PRICE_ID }}'
}],
payment_behavior="default_incomplete",
)