#christian_api
1 messages · Page 1 of 1 (latest)
đź‘‹ Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1318733820144648276
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- christian_api, 10 minutes ago, 12 messages
Hello again! So, to clarify, you want to set up a Subscription in Stripe with a 7 day trial, but instead of collecting payment details and then charging them after the trial, you want to place a hold on the funds and capture them at the end of the trial?
Yes exactly!
That's not something we support directly. You can build this, but it will take a non-trivial amount of custom code on your end.
I also wouldn't really recommend implementing it this way. Depending on the specifics of the hold and the exact timing, it's possible the hold might expire before the trial is over.
Visa, for example, only supports five day holds for merchant-initiated transactions: https://docs.stripe.com/payments/place-a-hold-on-a-payment-method
How would you recommend implementing this. We see this on a competitors website and want this functionality
This is in their payment page:
By providing your card information, you allow OddsJam to charge your card for future payments in accordance with its terms. OddsJam will place a hold to verify that your card is valid, this will be removed once your subscription is active.
You can review important information about OddsJam on the https://oddsjam.com/terms.pdf and https://oddsjam.com/privacy.pdf pages.
Like I said, you can do this, I just don't recommend it as it's a lot of work and isn't compatible with all card brands given your specific use case.
The way I would do it is not place a hold at all. I'd collect payment info up front, set it up for future use, then let the system charge them at the end of the trial.
Do you mean collect the payment info directly and use a payment intent. I’m not sure I understand the implementation
No. This is our recommended way to use Subscriptions with Checkout, and is documented in detail in this guide: https://docs.stripe.com/billing/subscriptions/build-subscriptions?platform=web&ui=stripe-hosted
That is our current implementation but we are seeing an alarmingly high amount of failed payments at the end of the trial. The fail codes can be do not honor, insufficient funds and a couple others. Our home was to capture the funds so that when the trial ends we can ensure that the transactions are not going to fail
Gotcha. You can try doing this, but it will be a very different integration with a lot more logic and steps on your end. You can still use Checkout, but you'll be making several other API requests over time behind the scenes, and you'll also run into the Visa hold time being too short for your trial period length.
Is this recommended. I am looking for any advice
If I had to build something like this I would probably use Checkout in payment mode for the amount of the first payment, and with the capture method set to manual so it placed a hold. I'd also configure the Checkout Session to set up the Payment Method for future use. Then if that succeeded I'd schedule something to capture the funds at the end of the trial. Once the capture succeeded I'd then credit the Customer's balance with the amount captured. Then I'd create the Subscription at that point, with no trial (since the trial period already happened) and the Customer's balance would automatically be applied to the Subscription's first Invoice.
And I would test the heck out of it in test mode, because that's a lot of moving pieces.
Is there a more simple way?
Not that I can think of, if placing a hold is a requirement.
Placing a hold is not necessarily a requirement. The only requirement is being able to authorize that the payment at the end of the trial will go through.
Some links to relevant docs:
We just need to avoid the payment failures at the end of trial. There are so many right now
Payments in the future may always fail for a variety of reasons. If you need to make sure the transaction will go through you can either not use a trial period at all and charge immediately or you can place a hold on the funds.
Have you considered not having a trial period?
Or maybe it would help me to understand why it's a big deal if payment fails at the end of the free trial? Don't you cancel their Subscription and thus cut off their access to whatever it is they had the trial for?
Yes we tried this and did not see a high level of conversion. The problem is that it leads to a high level of friction, where at the end of the trial a user is basically forcefully canceled. Even if they weren’t 100% considering canceling.
I was looking into this further. Do you know anything about jotform. They seem to attempt to make it easier here
https://www.jotform.com/answers/15774501-stripe-integration-how-to-enable-pre-authorization
Can you shorten the trial period so it's shorter than five days and less likely to run into hold time limits?
I don't know anything about JotForm, no.
We could certainly do that. Why is it 5 days
You'd have to ask Visa why.
Ah they only allow hold for 5 days
And it's technically a bit less than five days, as noted in the documetnation I linked to.
Another option is to maybe have a cheap trial period instead of a free one?
Well, that wouldn't work that well with Checkout, actually.
Do you mind checking out that jott form link that I sent. I understand if you don’t want to check it out. But it is interesting that they seem to automate pre-authorization.
What do you want me to look at there? That seems to be talking about placing a hold for a one-time payment, with no Subscription/trial involved.
I guess you are right. They probably don’t offer anything for subscription and that would have to be handled on our side.
For the integration that you mentioned earlier. How would I set up the timing so that when the trial ends the subscription starts?
That's up to you. You'd have to use some kind of scheduling system on your end.
OK, and what do you mean by setting up the payment method for future use?
You need to set this option when you create the Checkout Session:
That's one of the links I shared above.
Awesome thank you. The last question that I have is about when I use the checkout session. Would I create a product checkout session and one time payment for that checkout session? Also from there, how would I indicate to users that it is a free trial?
Also, can I just connect a payment to a subscription and start the subscription without a user agreeing to it?
Or is them signing up for the free trial enough to allow us to do this even though we are technically doing it manually
You would need a Product and one-time Price for the Checkout Session, yes. It would not appear to be a free trial in Checkout, because you're placing a hold on funds. When you place a hold it prevents the customer from using those funds for anything else, so it's not really free at that point.
Also, how would a user cancel their subscription during the free trial because they’re technically is not a subscription to cancel at this point
You would need to build a UI on your end for them to do that.
Like I said, this is not trivial and takes a lot of work. It's possible, but not recommended.
Yes, that makes sense. It just seems to have to be done because there is no verification of the credit card when a trial starts. A user can use a debit card with no money and gain access to our site with no risk of ever having to actually spend money. In terms of the automation, how do we attach the payment method to the subscription and automatically start charging them for that subscription with that payment method.
You can set it as the default Payment Method on the Subscription: https://docs.stripe.com/api/subscriptions/update#update_subscription-default_payment_method
Or you can set it as the default for all Invoices on the Customer: https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method
Would I need anything other than the customer ID and the payment ID to start the subscription after five days?
đź‘‹ Taking over this thread
Would I need anything other than the customer ID and the payment ID to start the subscription after five days?
No. You should use the same Customer ID that the payment method is saved.
When you create the subscription directly using Create a Subscription API, Stripe will create Invoice and Payment Intent behind the scene automatically to charge the payments
Awesome. And how will I can I ensure that the trial does not end before the hold expires. Rebeus was saying that it was 5 days but I am seeing elsewhere it is 7 days maximum
In the charge object created from the Checkout Session that holds the funds, the capture deadline will be reflected under payment_method_details.card.capture_before: https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card-capture_before
You should ensure that your trial ends before this by always checking payment_method_details.card.capture_before value to determine how long the hold will expire before creating the subscription trial.
The expiry of the hold is up to the card brands (Visa, MasterCard... etc) and issuing banks. This is the general guideline on how long the fund can be held in various card brands: https://docs.stripe.com/payments/place-a-hold-on-a-payment-method - And yes, Visa specifically only holds the authorisation for 4 days and 18 hours (~5 days) as shared by Rebeus
Do I have the option to make a subscription right then with a 4 day free trial so that I don’t have to automate any ui. Then on cancellation we have a webhook that ensures we don’t collect the payments
Subscription creation should be created by your system as Stripe doesn't create one automatically for you, or cancel the funds that has been held during the trial period
But instead of charging them after free trial is over and creating a subscription then does it make sense for us to create a subscription right then with the free trial
Also, is there a way to set how long to hold the funds for in the checkout session
But instead of charging them after free trial is over and creating a subscription then does it make sense for us to create a subscription right then with the free trial
You can. This will be up to your business decision on how you would like to manage holding the fund and subscription creation
Also, is there a way to set how long to hold the funds for in the checkout session
This is not supported.
So how do I charge them. What does the process look like. And what is payment_method_details.card.capture_capture
What do you mean by how you charge them? Which specific part are you referring to? Placing the hold or actual charge of the subscription?
The hold. How do I capture those funds