#anishsubedi1_83944
1 messages ยท Page 1 of 1 (latest)
This is the customer portal:
You'd set up a configuration to enable payment method updates: https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-payment_method_update-enabled
looking into it
Are you sure to change credit card info in subscription (not payout) we need to use customer portal?
Yes that is the Customer Portal, if you create and link to a Customer Portal session that should be the same thing that the page links to
a the Above pic is from Employer account; where we can go into each customer, and get that share payment update link and send them.
We are doing subscriptions directly through API (Create customer first the directly then create subscription).
Can this "payment update link" also be provided to user directly api? Like getting direct "payment update link" which opens stripe customer platform.
Yes, the guide that synthrider linked to earlier shows how to create these links with the API https://stripe.com/docs/customer-management/integrate-customer-portal
looking into it.
can we hide/delete this renew or cancel subscription button from here?
Only allowing them to update card. We are allowing cancel sub/ renew through our portal directly.
Hi ๐
I'm stepping in as @ebon stratus needs to go. You can configure what your customers can do in the Portal using the Configuration API
https://stripe.com/docs/api/customer_portal/configurations/create#create_portal_configuration-features
But we didn't use "Create a portal configuration" api.
How did you create the Customer Portal?
This server is focused on developers coding integrations with Stripe APIs so our advice tends to default to suggesting API solutions
We did not create Customer Portal.
Whenever user wants to subscribe to our Platform. We do following:
- Create a unique customer through stripe API for that customer // Or, if stripe_Customer_id already exist in our database use that
- Create a subscription for that customer
That's all.
Now, to allow users to update credit card on their subscription. We are trying to use this:
const getCusotmerPortal = async () => {
const stripe = require('stripe')(
'"',
);
const session = await stripe.billingPortal.sessions.create({
customer: detail.userPaymentProfile.payVendorCustomerId,
return_url: 'http://localhost:8080/#/user/profile',
});
window.open(session.url);
return;
};
Okay that stripe.BillingPortal is the Customer Portal in our docs (sometimes our naming isn't clear)
So you used this API: https://stripe.com/docs/api/customer_portal/sessions/create
But one of the optional parameters for that API call is the ID of a configuration object. https://stripe.com/docs/api/customer_portal/configurations/create
So you can create a Configuration object that customizes what is available to your customers and then use the ID of that configuration when you create the Billing Portal
We used simple this:
"// create a stripe customer
const customer = await stripe.customers.create({
name: name,
email: email,
});
No that's not what I"m talking about
It's the other part of your code
const session = await stripe.billingPortal.sessions.create({
customer: detail.userPaymentProfile.payVendorCustomerId,
return_url: 'http://localhost:8080/#/user/profile',
});
this part creates a Customer (Biling) Portal
We have not used this.
Then where are you seeing the Cancel Plan button? What is creating that interface?
their I will repeat my question just to be clear:
Whenever user wants to subscribe to our Platform. We do following:
a. Create a unique customer through stripe API for that customer // Or, if stripe_Customer_id already exist in our database use that
const customer = await stripe.customers.create({
name: name,
email: email,
});
b. Create a subscription for that customer
const subscription = await stripe.subscriptions.create({
customer: customerId,
items: [{ price: priceId }],
})
That's all.
Now, we want to allow users to update credit card details on their exisitng subscriptions.
Then you would use the Billing (Customer) Portal
That is the interface Stripe provides for those features.
Yea, that means use this right?
const getCusotmerPortal = async () => {
const stripe = require('stripe')(
'"',
);
const session = await stripe.billingPortal.sessions.create({
customer: detail.userPaymentProfile.payVendorCustomerId,
return_url: 'http://localhost:8080/#/user/profile',
});
window.open(session.url);
return;
};
Yes. Except that, in order to implement the functionality you want, you will need to create a Configuration object and pass that ID when creating the BillingPortal session
Oh okay. And, this configuration will be applied to all the customers?
const configuration = await stripe.billingPortal.configurations.create({
features: {
customer_update: {
allowed_updates: ['email', 'tax_id'],
enabled: true,
},
invoice_history: {enabled: true},
},
business_profile: {
privacy_policy_url: 'https://example.com/privacy',
terms_of_service_url: 'https://example.com/terms',
},
});```
The configuration species the features you want to be available for a specific portal session. If you want all your customers to have the same features then you can use the same configuration ID for all your billing portal sessions.
But if you want to offer some customers different features you can create separate configuration objects and use those IDs
basically, create configuration and pass to customer object. And, finally portal will open based on that configuration. ?
No, you pass the configuration when you create each Billing Portal session, not each Customer
You are very welcome, it is why we are here ๐