#Nrupal Patel

1 messages · Page 1 of 1 (latest)

bronze rampartBOT
faint lintel
#

I don't understand the question. Can you clarify

narrow cape
#

sure

#

I subscribed to one plan on May 1 for a month, and I upgraded my subscription on May 15.

I received payment via a Stripe checkout session.

for  exmple,

I can subscribe to the 99-dollar plan for one month. after upgrading my subscription, which is a 199-dollar plan.

However, I have only received $99 in payment. so I can manage it during a Stripe checkout session.

faint lintel
#

Are you asking whether you can use Checkout to do upgrades for existing Subscriptions?

narrow cape
#

yes

faint lintel
narrow cape
#

how can I do after completed checkout session payment.

faint lintel
#

Do what?

#

You have a couple options:

  • Build your own UI and utilise the API to handle the Subscription upgrades as you need.
  • Use the hosted customer portal solution that allows customers to manage their Subscription on a Stripe UI (similar to Checkout).
narrow cape
#

I have three plans for one month: 99 dollars, 199 dollars, and 299 dollars.

First, on March 1, I paid 99 dollars for a subscription for one month.

After 15 days on March 15, I upgraded my subscription to 199 dollars.

but I have to pay only 99 dollars. March 1, using the Stripe checkout session API.

So, first and foremost, I must obtain payment using Stripe's session API.

How can I do that?

faint lintel
#

I was under impression you'd already collected initial payment via Checkout, no?

narrow cape
#

but it was only 99 dollars. but I have to get extra money to upgrade my subscription.

faint lintel
narrow cape
#

first i created subscription,
checkout_session = stripe.checkout.Session.create(
payment_method_types=["card"],
line_items=[
{
"price": plan_id,
"quantity": 1,
},
{
"price_data": {
"currency": "usd",
# additional amount in cents to Convert in doller
"unit_amount": adspend_amount * 100,
"product_data": {
"name": "Additional charges Based on Ad-spend",
},
},
"quantity": 1,
},
],
mode="subscription",
customer=stripe_customer_id,
success_url=url_hp.CHECKOUT_PAYMENT_SUCCESS_URL,
cancel_url=url_hp.CHECKOUT_PAYMENT_CANCEL_URL,
)
after i modify it
subscription = stripe.Subscription.retrieve(subscription_id)
upgrade_plan = stripe.Subscription.modify(
subscription_id,
proration_behavior="always_invoice",
items=[
{
"id": subscription["items"]["data"][0].id,
"price": price_id,
}
],
cancel_at_period_end=True,
)
but I want first completed payment using stripe checkout session for next modification.
or it is auto debit from customer account.