#monobot-Subscription

1 messages · Page 1 of 1 (latest)

urban scroll
#

Hi there, the easiest way to start Subscription is using Stripe Checkout.

#

You can pass in the customer param when creating the Checkout session and the Checkout will automatically use the customer's info and last used payment_method and prefill the Checkout page.

still light
#

Hey Jack this is what I got for the new customers.
But old customers when clicking there in stripe they got no subscription created and so they can not modify their payment modes or anything.
I would like to migrate current ones to use that subscription method.
So what is the procedure?

urban scroll
#

What's your old integration like? Are you using Checkout or Elements?

still light
#

Sorry for not remembering stripe lingo
I used the direct pay ... so a javascript pop up that manages everything and on success I create the needed things in our database

urban scroll
#

No worries at all. Is this Direct Pay from a different payment processor?

still light
#

no, everything is in stripe

urban scroll
#

Do you have a website so that I can take a look?

#

Also can you share with me your merchant ID? you can find it from the Stripe Dashboard -> Settings ->Account Details

still light
urban scroll
#

Thanks. I can see that you are already using subscription with Checkout.

#

But old customers when clicking there in stripe they got no subscription created and so they can not modify their payment modes or anything. -> I don't quite understand this part, is there a customer ID that I can take a look?

still light
#

When an existing user clicks to the subscription link they arrive to stripe with info like this one

urban scroll
#

What kind of link is it? do you have a URL?

#

hm, I have a feeling that this is the customer billing portal.

still light
#

it is

#

well its the subscription management

#

looking for a link to share

urban scroll
#

Thanks. this is customer billing portal

still light
#

Other customers can modify their payment method yes.
The problem is that this customer has the old checkout system, so there is no subscription in stripe for them.
I was wondering if Is possible that I create the subscription and subscription item for those old customers, and link that to the new product, so its transparent for the user.
Maybe this is what I have to do
https://stripe.com/docs/billing/subscriptions/migrate-subscriptions

Import subscriptions from other sources into Stripe.

urban scroll
#

I don't think you need to perform migration unless you are importing customer data from a different payment processor.

still light
#

Set your secret key. Remember to switch to your live secret key in production.

See your keys here: https://dashboard.stripe.com/apikeys

import stripe
stripe.api_key = "sk_test_51HHbKtLRvTdp -- REDACTED -- o0pSTf528OnNS00UJKOLg9m"

stripe.Subscription.create(
customer="{{CUSTOMER_ID}}",
items=[
{
"price_data": {
"currency": "USD",
"product": "{{PRODUCT_ID}}",
"recurring": {"interval": "month", "interval_count": 3},
"unit_amount": 1000,
},
"quantity": 1,
},
],
)

urban scroll
#

Please remove your API key in the message, thanks

still light
#

this is from your documentation

#

should not be a real api key

urban scroll
#

It's still an API key and discord is a public place.

still light
#

done

urban scroll
#

BTW, I've checked your log of the recent customer billing portal session, the payment_method_update feature of the billing portal configuration is not enabled, and that's why the payment method management is not displayed in the billing portal

still light
#

just modified it, thanks

#

in here:

urban scroll
#

Nice, You can manage the payment methods now by opening the same customer billing portal link

still light
#

Yes, but this is not really the question.
I want to migrate old customers from simple (manual from my system) checkout to the new portal.

urban scroll
#

Are you asking about creating subscriptions for your customers with the existing payment methods so that these customers don't need to go through the checkout flow again?

#

If I understand you correctly, you can use the Subscription API to create the subscription. Pass the customer's payment_method to the default_payment_method param (https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method) and this payment_method will be used for the recurring payments of the subscription.

still light
#

Many thanks!
Let me digest everything, we can now close this.

urban scroll
#

No problem. feel free to come back if you have any questions!

still light
#

❤️