#dulcehc-sub-payment

1 messages · Page 1 of 1 (latest)

distant copper
#

Hi there, mostly you can't. You always need to be prepared for a decline and then to bring your customer back on-session to collect new card details. That said, how are you collecting card details currently? What is the flow?

sour plaza
#

I asked for the card info, I tried to create a subscription. I checked the status if it's equal to "active", then I create a policy (the product the customer is purchasing).

distant copper
#

Does your Subscription have a trial? Or are you attempting to pay the initial PaymentIntent when you are collecting these card details?

#

Can you provide me an example Subscription ID that I can look at?

sour plaza
distant copper
#

Thanks, give me a moment to look

#

Sorry for the delay. Are you sure that is the right PaymentIntent ID? I'm not finding it

#

Ah never mind

#

Bad copy paste

#

Okay so this PaymentIntent was actually blocked by a Radar rule you have in place.

#

You are blocking on CVC failure

sour plaza
#

yes, but it seems that it wasn't validated immediately because the subscription was created

distant copper
sour plaza
#

yes, actually I verified the status, I have this in mi code

#

if (!effectiveDate && subscription.status !== "active") {
throw new InputError("The payment failed");
}

#

but it's passing

#

does this could work? change the Stripe subscription create call to set collection_method=charge_automatically, which I think means it will process the payment at the same time as creating the sub (and presumably return an error on failure)

distant copper
#

No the Sub will be created regardless

#

So if you use error_if_incomplete then the Sub won't be created on payment failuire

sour plaza
#

thanks, I will review the docs and try that