#jean_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1253745004938006538
đ Have more to share? Add details, code, screenshots, videos, etc. below.
If it helps, here is how we have embedded the pricing table into our app:
useEffect(() => {
if (userEmail) {
const script = document.createElement('script');
script.src = "https://js.stripe.com/v3/pricing-table.js";
script.async = true;
script.onload = () => {
try {
const stripePricingTable = document.createElement('stripe-pricing-table');
stripePricingTable.setAttribute('pricing-table-id', '...');
stripePricingTable.setAttribute('publishable-key', '...');
stripePricingTable.setAttribute('customer-email', userEmail);
stripePricingTable.setAttribute('success-url', 'https://app.ai/subscription/success');
const container = document.getElementById('stripe-pricing-table-container');
if (!container.querySelector('stripe-pricing-table')) {
container.appendChild(stripePricingTable);
}
} catch (error) {
console.error('Error loading Stripe pricing table:', error);
}
};
script.onerror = () => {
console.error('Error loading Stripe script');
};
document.body.appendChild(script);
}
}, [userEmail]);
checking out via the pricing table works, but the user arrives at this page and then nothing happens, which is awkward.
I want to automatically redirect them to another URL.
When you create the Pricing Table you have the option to send them to either a confirmation page or your own URL
Ah, I missed this. Got it, thank you so much.
Sure thing!
I have another completely unrelated question. Can I ask it here too?
If it's developer-focused, sure
Sort of developer-focused.
Context: Our current pricing offers only paid tiers but with a free trial, asking for credit card (CC) information (so you get subscribed automatically after the trial).
Task: I want to provide our staff and some beta users free access to the app. We solely rely on stripe's API for access management. Ie, to access our app, you have to be an actively subscribed or a trialing user under Stripe's API.
To give some folks free access, I thought the easiest way is to simply give them a 100% discount coupon. This also works, however, it still asks for credit card information.
I saw that there is an option to not ask for CC information, however, then it also won't ask for CC information for users we want to offer a regular free trial and hence do want to ask for their CC info.
Question: Can we disable the collection of CC information only for users whose price to pay is exactly $0?
Also, if you believe there is a better way to give some folks free access besides the 100% discount coupon route, please let me know.
The only way to have an active subscription without collecting CC info is to use a free trial: https://docs.stripe.com/billing/subscriptions/trials#create-free-trials-without-payment
That being said, you can have a really long free trial. I can't actually remember if there's an upper bound for free trials, now that I think about it
Got it. Yeah, we already use the free trial feature but we want to ask regular users for payment information.
Only for staff/friends we want to make an exception.
But the more I think about it, the more I think it's not a big deal if they have to enter CC info too. Would have just been a bit more convenient if they don't.
You would have to know they were staff/friends before they sign up so you could programmatically modify the trial_end on the Subscription at creation time
Got it. I think we will just go ahead with giving them the 100% discount coupon and asking them to provide their CC.
Sure thing!
thank you for your help. have a great weekend!