#DopeScott-requires_payment_method

1 messages · Page 1 of 1 (latest)

orchid loom
#

Is this a one-off payment?

#

Default payment methods only work for subscriptions

narrow carbon
#

Subscription, though now I noticed it failed a 3d

#
2) Subscription update to plan B => Update failed to plan B - 3d failed (new paymentIntent/secret)
3) Update tried again - requires_payment_method (new paymentIntent/secret)
#

There was a "will retry to charge after x amount of days"

#

So I guess that's at the fault?

#

It said that subscription will try to attempt to charge at a later date, so I can't run Subrsciption.update(..)? with intent to try to pay for it again?

#

Or how can I make it so re-attempts aren't made? But monthly payments are still collected, just that if they fail there isn't a re-attempt.

orchid loom
#

I am not immediately sure. 3DS failures should result in requires_action not requires_payment_method.

#

Do you have the ID of the subscription that this happened for?

narrow carbon
#

Ah, I deleted it to try new one...

orchid loom
#

The subscription or the PaymentMethod?

narrow carbon
#

Subscription

orchid loom
#

Do you still have the ID? We may still be able to look in to it even with it being deleted

narrow carbon
#

Also, maybe question on the side, how do I add metadata to webhooks? Cause, I only create subscriptions and update them with metadata object, but it seems to be {} when I receive the webhooks.

narrow carbon
# narrow carbon Also, maybe question on the side, how do I add metadata to webhooks? Cause, I on...
                mutableMapOf<String, Any>(
                    "items" to arrayOf(mutableMapOf(
                        "id" to curSubscription.items.data[0].id,
                        "price" to "plan_HC9PRfcFjXJN4R"  //plan_HC9SrLv67Abae4
                    )
                    ),
                    "proration_behavior" to "always_invoice",
                    "metadata" to mutableMapOf("slUserId" to request.userId, "planId" to "plan_HC9PRfcFjXJN4R"),
                    "expand" to arrayOf("latest_invoice.payment_intent")
                )
            )``` I do as such, is it supposed to carry the metadata to webhook?
#

Ah "payment_intent_data.metadata" instead of just metadata attached to sub?

vast linden
#

Hey there 👋 please bear with while I work on getting caught up here

#

The metadata should stay on the object where it was specified, so it won't move from the subscription to the payment intent.

narrow carbon
#

All good, you can answer whenever. How could I add the metadata from subscription so I receive it back in the following after success webbook?

vast linden
#

What events are you listening to? If you're listening to subscription events then I'd expect it already be there.

narrow carbon
#

invoice.payment_succeeded

#

I think it works fine with subscription.create() but not .update()

vast linden
#

So if you're receiving an invoice object in the event, then I wouldn't expect your subscription metadata to be present. The invoice object should have a reference to the subscription object though, and if you retrieve the invoice while passing in an expand argument to expand the subscription then you should be able to locate the metadata you're looking for.

narrow carbon
#

I see, thanks I'll look into it

vast linden
#

@narrow carbon was going back through this thread and wanted to confirm what the outstanding question is. Is it that you want to disable retries for failed payments?

narrow carbon
#

Well, they seem to bug out, at least in that case the 3d failed

#

It's like you can't create new invoice and re-try?

vast linden
narrow carbon
#

It's off