#monobot-Subscription
1 messages · Page 1 of 1 (latest)
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.
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?
What's your old integration like? Are you using Checkout or Elements?
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
No worries at all. Is this Direct Pay from a different payment processor?
no, everything is in stripe
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
You will not see anyting unless you sign in
https://api.sanctions.io
acct_1HHbKtLRvTdp0n7H
api.sanctions.io is an API to retrieve quality sanctions and PEP data
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?
When an existing user clicks to the subscription link they arrive to stripe with info like this one
What kind of link is it? do you have a URL?
hm, I have a feeling that this is the customer billing portal.
Thanks. this is customer billing portal
Did you enable payment_method_update (https://stripe.com/docs/api/customer_portal/configurations/create?lang=curl#create_portal_configuration-features-payment_method_update) feature in the portal configuration?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
I don't think you need to perform migration unless you are importing customer data from a different payment processor.
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,
},
],
)
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Please remove your API key in the message, thanks
It's still an API key and discord is a public place.
done
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
Nice, You can manage the payment methods now by opening the same customer billing portal link
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.
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.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Many thanks!
Let me digest everything, we can now close this.
No problem. feel free to come back if you have any questions!
❤️