#Yashish

1 messages · Page 1 of 1 (latest)

terse jacinthBOT
kindred tartan
urban jungle
#

i want to ask the customer in stripes are created by looking which detail
1 the email used during the payment
2 cards used during payment
3 name on the card used during the payment

if i do again the transaction with same detail then a new customer will be created or not

if not then what details does the stripe look for when creating the customer

kindred tartan
#

if i do again the transaction with same detail then a new customer will be created or not
Yes, a new customer with the same details will be created

urban jungle
#

so on every transaction a new customer is created

#

whether it is for subscription buy or renewal of the subscription or update the subscription plan

kindred tartan
kindred tartan
#

What is the issue you are facing exactly here ?

kindred tartan
#

That's not clear sorry, could you please provide an example of what you are trying to achieve ?

urban jungle
#

1.in stripe, the first time when I buy a subscription plan at that time a new user is created ?

  1. when a customer tries to update its subscription plan at that time a new customer is created ?

if the customer are created then on what bases they are being created
1 the email used during the payment
2 cards used during payment
3 name on the card used during the payment

kindred tartan
#

1.in stripe, the first time when I buy a subscription plan at that time a new user is created ?
How are you creating a Subscription ? please share more details.

#
  1. when a customer tries to update its subscription plan at that time a new customer is created ?
    Nope.
urban jungle
#

i am working in python

first creating the plan
plan = stripe.Plan.create( amount=50000, currency='usd', interval='month', product={ 'name': 'Test advance plan' }, nickname='test product advance', metadata={'plan_id':"test_advance_id"} )

then through the plan user can buy the subscription

plan = stripe.Plan.retrieve(subscription_plan.stripe_plan_id) stripe_session = stripe.checkout.Session.create( success_url=domain + '/payments/stripe-success?session_id={CHECKOUT_SESSION_ID}', cancel_url=domain + '/payments/stripe-failed/', mode='subscription', line_items=[{ 'price': plan.id, 'quantity': 1, }], customer_email=user_id.email, # customer_email='the_just_email@gmail.com', metadata={'user_id': (request.user).id, 'plan_id': subscription_plan.id, 'plan_name': subscription_plan.plan_name }, )

kindred tartan
urban jungle
#

still unable to get the clear idea

kindred tartan
#

What part exactly ?

urban jungle
#

i will need to look further in it

#

can you tell how can i create a plan for 4 month interval?

#

plan = stripe.Plan.create( amount=self.plan_price, currency='usd', interval='month', product={ 'name': 'Test advance plan' }, nickname='test product advance', metadata={'plan_id':"test_advance_id"} )

#

or

#

plan = stripe.Plan.create( amount=self.plan_price, currency='usd', interval='month', interval_count=4, product={ 'name': 'Test advance plan' }, nickname='test product advance', metadata={'plan_id':"test_advance_id"} )

kindred tartan
#

Between, you should be using prices instead of Plans. Plans are deprecated.

kindred tartan
urban jungle
kindred tartan
#

You can use prices with subscriptions.

urban jungle
#

here it is mentioned that
notify your customer and send them to the customer portal to update their payment method.

how can we do this?

kindred tartan
urban jungle
#

in customer portal can we handle it through success and fail urls

or we need to do it with the webhook call

kindred tartan
#

what you mean by success and fail urls?

urban jungle
#

plan = stripe.Plan.retrieve(subscription_plan.stripe_plan_id)
stripe_session = stripe.checkout.Session.create(
success_url=domain + '/payments/stripe-success?session_id={CHECKOUT_SESSION_ID}',
cancel_url=domain + '/payments/stripe-failed/',
mode='subscription',
line_items=[{
'price': plan.id,
'quantity': 1,
}],
customer_email=user_id.email,
# customer_email='the_just_email@gmail.com',
metadata={'user_id': (request.user).id,
'plan_id': subscription_plan.id,
'plan_name': subscription_plan.plan_name
},
)
like this

kindred tartan
#

When using Customer Portal, you can just set a return url, there isn't success or failure urls.

urban jungle
kindred tartan
#

Yes complete your portal setting first.

proud spoke
#

Hi there 👋 jumping in as my teammate needs to step away soon. It does look like you will need to configure your customer portal settings before you can create a portal session, please let me know if that error persists after you've done so.

urban jungle
#

what to configure

proud spoke
#

The settings for the Customer Portal, those settings can be found in your dashboard via the URL provided in the error message.