#christian_api

1 messages · Page 1 of 1 (latest)

uneven sluiceBOT
#

đź‘‹ 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.

upbeat lily
#

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?

heady crystal
#

Yes exactly!

upbeat lily
#

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.

heady crystal
#

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.

upbeat lily
#

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.

heady crystal
#

Do you mean collect the payment info directly and use a payment intent. I’m not sure I understand the implementation

upbeat lily
heady crystal
#

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

upbeat lily
#

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.

heady crystal
#

Is this recommended. I am looking for any advice

upbeat lily
#

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.

heady crystal
#

Is there a more simple way?

upbeat lily
#

Not that I can think of, if placing a hold is a requirement.

heady crystal
#

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.

heady crystal
#

We just need to avoid the payment failures at the end of trial. There are so many right now

upbeat lily
#

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?

heady crystal
#

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.

upbeat lily
#

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.

heady crystal
#

We could certainly do that. Why is it 5 days

upbeat lily
#

You'd have to ask Visa why.

heady crystal
#

Ah they only allow hold for 5 days

upbeat lily
#

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.

heady crystal
#

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.

upbeat lily
#

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.

heady crystal
#

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?

upbeat lily
#

That's up to you. You'd have to use some kind of scheduling system on your end.

heady crystal
#

OK, and what do you mean by setting up the payment method for future use?

upbeat lily
#

That's one of the links I shared above.

heady crystal
#

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

upbeat lily
#

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.

heady crystal
#

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

uneven sluiceBOT
upbeat lily
#

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.

heady crystal
#

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.

upbeat lily
heady crystal
#

Would I need anything other than the customer ID and the payment ID to start the subscription after five days?

pine ether
#

đź‘‹ 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

heady crystal
#

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

pine ether
#

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

Use manual capture to temporarily reserve funds without immediately charging the payment method.

heady crystal
#

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

pine ether
#

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

heady crystal
#

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

pine ether
#

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.

heady crystal
#

So how do I charge them. What does the process look like. And what is payment_method_details.card.capture_capture

pine ether
#

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?

heady crystal
#

The hold. How do I capture those funds