#greggles_integration-subscription
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- greggles_error, 16 hours ago, 49 messages
- greggles_error, 1 day ago, 7 messages
๐ 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/1257736673094139967
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
looking
@quaint agate I don't think we have any specific doc that fits your exact need sorry. The closest would be https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=subscription I think
Hi, one thing I've been confused about is that it's been suggested that I render the payment element after finalizing the invoice, but I need to render the address element first in order to set up the invoice so I don't have the client secret at that point.
Would this imply I need a multi-page checkout?
greggles_integration-subscription
Thank you, that's pretty much the integration I'm using but it's limiting the payment elements that can be used to credit card, Google Pay, US Bank Account, and CashApp. We'd like to use the full range available to us and we'd like to take advantage of automatic payment methods.
You need to make sure you enable the right payment methods in https://dashboard.stripe.com/settings/billing/invoice as they are controlled separately for Invoicing and Billing
I did confirm that, yes but the only payment methods that show are the ones I listed above.
So what payment methods are you missing? Can you give me a concrete example of one you expect to show for your exact mode, currency and amount?
Alipay and Wechat pay are two that don't show.
In my conversation yesterday with TwoShoes, they suggested
I'd recommend switching to creating/finalizing the Invoice before rendering the Payment Element, that way you can pass its client secret in with the Payment Element and use whatever your Invoice's billing settings are.
Right now I'm having to specify the 4 payment methods above explicitly because not specifuing them produces errors when using some of the automaticly generated ones.
Which brings me back to my original question. I need to render the address element first in order to create the customer object and the invoice for the products. Creating the invoice produces the payment intent and client secret, right?
Yes in that case you would have to
have to use a multi page check out?
I don't think we care much about whether you do a multi-page check out or not. That's really up to you. But yes you need to render things sequentially
Let me be more explicit. In the docs instantiating stripe elements looks like this
const options = {
appearance: appearance,
'mode': 'payment',
amount: 9995,
'currency': 'usd'
};
const addressOptions = {
mode: 'billing',
};
const elements = stripe.elements(options);
const paymentElement = elements.create('payment');
const addressElement = elements.create('address', addressOptions);
So you'd instantiate elements first using whatever options we'd need, then render the element. However I don't have the client secret to use in the options when instantiating const elements when I need to create the address element. Follow?
You can use https://docs.stripe.com/js/elements_object/update later once you have what you need. Or you can use a separate instance of Elements at that point to create/mount PaymentElement
So I can add the client secret using elements.update?
The doc doesn't mention that as a parameter.
No sorry in that case do a separate elements. Sorry I know you're looking for firm guidance but I've never seen anyone do what you are trying to do. Right now you're just testing so try to iterate quickly for a few minutes to get to the result you are after
OK, sorry, let me start over and go back to my original question. I'm selling both subscriptions and one-off products, separately on different pages. I'm looking for a step-by-step integration guide. I'm happy to use what most people do if it makes it easier.
We have no step by step integration guide that works for your specific use-case sorry. That's what I explained earlier. So you have to adapt for the Subscription part and do it differently to match your needs
@lethal lantern is taking over if you have a follow up question!
๐
No one uses the address and payment elements to collect information and pay for subscription products? I don't understand.
What is a typical use case? Only collecting payments but not connecting those payment to products? Sorry, not trying to be flippant or dense.
@here anyone there?
Sorry, was reading the thread.
I didn't want to cover what's already been covered.
No one uses the address and payment elements to collect information and pay for subscription products?
Yes, they do, but we don't have a specific end-to-end guide for it. People build custom solutions for this using various parts of Stripe.
What is a typical use case? Only collecting payments but not connecting those payment to products? Sorry, not trying to be flippant or dense.
The most typical use case would be to send your customer to Checkout and have Checkout collect all the information required and create a Subscription, but it sounds like you want a much more custom solution than that.
If I understand correctly, you want to collect address details with the Address Element, then create a Subscription with those address details, then have your Customer pay for the Subscription's first Invoice with the Payment Element, and you want all of that to happen on a single payment page. Is that correct?
Thanks, and sorry to @ ya.
That's mostly correct. We'd prefer a single page but if a multi page solution opens up more payment methods for us we're flexible.
The custom solutions is what I'm confused about. The guides seem geared to using individual components and I'm confused about how to connect them to get what I'm after.
One thing I'm specifically wondering about is if you must use the Adress Element? It seems like it would be easier for you to collect the address info you want using regular HTML form fields, then pass that data to the API.
While not necessary, I used it to leverage Stripe's validation and autofill features. It seemed designed to work well with the payment element. Now it seems really difficult.
It's difficult for your specific use case, because you have the requirement of using the elements out of their intended order.
The Payment Element and Address Element at designed to be shown on the same page at the same time under a single Elements instance, and all of the information is intended to be gathered and used at the same time.
Yes. We need address information first to be able to determine if tax is needed or not. I wouldn't think that is out of the ordinary.
You want to break that up, and gather the address info first, then use that to create the Subscription/Invoice/Payment Intent that will be used by the Payment Element.
Your use case is not out of the ordinary. Using the Address Element and Payment Element for this use case in this way is out of the ordinary.
Sorry, I think I'm dense. What would be a typical checkout process? I'm sure I can adapt our flow to what's ordinary if I had a step-by-step guide.
It depends on what you mean by "typical checkout process". Do you mean a typical checkout process for Subscription payments or something else?
Yes, let's start with that.
That is exactly what I'm looking for.
And to sell a one-off payment product? I'd need to use invoicing, correct?
You can use a one-off Invoice, but you don't need to. You could bypass Invoices entirely and create a Payment Intent directly.
We have our products and prices already defined in the dashboard.
Or you could create a Checkout Session.
How do I connect the product to the payment intent? This is where it gets murky for me.
You don't, Payment Intents are low-level payment objects that don't have a concept of Products, Prices, line items, etc. Have a look at this short video: https://docs.stripe.com/payments-api/tour#payment-objects
Thank you for this. Can you keep the channel open while I digest this?
We close idle threads after about 15 minutes or so, but if you come back and this thread is closed you can always ask a new question using the buttons in #help.
roger. thanks