#Hi did you release an update today for
1 messages · Page 1 of 1 (latest)
luca-intent
one sec, let me look
as far as I can tell this is normal enough — you created a Subscription, the card used declined, so the Subscription goes to status:incomplete and the PaymentMethod is detached, you should recover by confirming with a new card.
what's different I suppose is you probably expected a 3D Secure authentication_required decline and the PaymentIntent to go to the requires_action status instead, but here for some reason it was a generic decline. Which I'm trying to figure out since that's the heart of the question. But overall this can happen(if you try with one of the test cards that declines you'd see the same thing).
Oh alright
oh it's because you create the subscription with off_session .
when you do payments off-session we do not progress the state machines the same way we do for on-session, since you're telling us the customer is not there, so there's no point moving to requires_action since the customer is not present to handle the action.
And how do I handle this? As the first time is on_session but all the other times will be off_session
hmm. What does that mean? Like are you talking about recurring payments on a subscription?
because you don't call /v1/subscriptions yourself each month for each recurring payment, if that's what you are doing!
I'm talking about recurring payments on a subscription. I call only the first time subscription::create then each month it get's updated automatically
But I mean the first time the subscription will be created the user will be on_session, and all the other times it will be off_session as it get's updated automatically via Stripe
I create the subscription with this code:
$subscription = \Stripe\Subscription::create([
'customer' => $customer->id,
'default_payment_method' => $token,
'items' => [
[
'price_data' => [
'unit_amount' => $monthlyAmount->asCents(),
'currency' => 'eur',
'product' => $product_id,
'recurring' =>
['interval' => 'month']
],
]
],
"application_fee_percent" => $totalPercentage,
"transfer_data" => [
"destination" => $partnerStripeAccount->getStripeUserId(),
],
"metadata" => $metadata,
"off_session" => true
]);
Should i remove off_session => true ?
I think you're a little lost
that's not how it works though
you create the Subscription once, while the customer is there.
then each month, Stripe automatically creates an Invoice and we charge the customer automatically.
you don't call the API yourself each month to process an off-session payment, which seems to be how you think it works?
you don't need off_session=> true when creating Subscriptions , unless the time when you create the subscription is when the customer is not present(like if somehow you have their payment details already saved and you have an automated function in your backend to start a subscription for them), it's very rarely used in practise.