#nickdnk - Subscription Updates

1 messages ยท Page 1 of 1 (latest)

rapid scroll
#

Hi ๐Ÿ‘‹

fervent marsh
#

Should I pass both on_subscription and a default_payment_method when updating to make it only update if the subscription update succeeds?

hard aurora
#

@fervent marsh it basically does this for you automatically, which we should have done years ago

#

it avoids the flow of
1/ Create an incomplete sub
2/ Confirm the PI for the invoice
3/ manually go and update the customer's or subscription's default PM yourself and don't forget or future payments fail
^ it removes step #3

fervent marsh
#

Okay, so if I don't give the subscription a payment method (use customer default), and I pass on_subscription, what happens?

#

will it just save the payment method (regardless if provided directly or if used via customer default) as the default for the sub?

hard aurora
#

yes, which means when you change it on the customer we will still use the sub's one for future payments on that sub

#

so it's a choice if that's what you want

#

we're planning to add a flow to change the default on the customer in the future, it just came with a lot more edge-cases so we started with on_subscription

fervent marsh
#

That's exactly what I want yes. I'm trying to make Apple Pay cards only save to connected customer objects and subscriptions, but without saving them as "default" for the customer platform object, since they cannot be used again

#

ok

#

So I need the Apple Pay card to stick to the sub even if a new default card (non Apple Pay) is added to the customer

hard aurora
#

Well Apple Pay can kind of be used again

#

so you might be better off just trying those Apple Pay cards anyways ๐Ÿ˜…

fervent marsh
#

It is my understanding that I am not supposed to save them except when used for recurring payments that were authorized via Apple Pay

#

As they decline otherwise

#

(I think)

#

It's a little complicated the setup I have. Basically you can subscribe (as a user) to different Connected accounts, so I'd like to not have a payment method on one Connected account attempt to replicate an Apple Pay card to a different Connected account and then continue a sub there that was never authorized for that card. if that makes sense.

hard aurora
#

yeah I understand, and that's our recommendation too

#

but technically it also mostly kinda works ๐Ÿ˜…

fervent marsh
#

We're seeing quite a lot of declines on subs unfortunately and that might be why

#

So I'm just trying to make Apple Pay follow an "authorize once, pay once" approach

hard aurora
#

gotcha

#

so yeah on_subscription could work for you

fervent marsh
#

The downside here is that the user won't be able to tell which cards a sub is following if they used Apple Pay, as the "show my credit card" endpoint will only list 1 non-Apple Pay card

#

Okay cool

#

which cards a sub is using*

hard aurora
#

yeah you need to expose that default PM from the sub in your UI

fervent marsh
#

Just to clarify so I'm 100% on the same page; I dont pass anything to default_payment_method - just on_subscription and then pay the sub?

hard aurora
#

correct

fervent marsh
#

I know but we don't have a " list of subs"

#

I know I could add the card

#

but yea that's more af a UX problem than a payment one

#

Because I do want the payment method to change for subs that you did not use Apple Pay with if you update your card, so I only want to directly attach the payment method to the sub when Apple Pay is used.

#

Which means I have to create a weird "if payment method == null for sub then send customer default as payment method for this sub" kind of logic, I'd assume

#

I kind of have to pass default_payment_method though, as the Subscription will otherwise just default to the customer default and then set that; I don't want that. I want it to explicitly not use the customer default, because the default is never an Apple Pay card.

hard aurora
#

candidly that one will ~never happen

fervent marsh
#

Cool

hard aurora
#

But I agree we need to improve this. We started using the Mandate API in India for consent collection as they have strict rules on card re-use logic

#

in the future maybe we can model Apple Pay and Google Pay the same and that would allow you to filter with a "valid mandate" for example

#

but our experience is that many users can charge Google Pay and Apple Pay async

fervent marsh
#

async?

#

I was under the impression that Apple Pay could not trigger 3DS

hard aurora
#

I meant that you set it up for subscription A, but then it just works for random one-off payments too

fervent marsh
#

Yeah it does work sometimes

#

But the convenience of Apple Pay should be that you use the phone to pay, not some random non-existent card

#

So that's why I'm trying to not save Apple Pay cards at all

#

(when possible)

fervent marsh
#

Otherwise I don't see how it would not just use the default card

hard aurora
#

that is the right flow

#

I think in your case on_subscription works quite well

#

just if someone actively wants to switch their default PM to a different card, you have to either update the associate subs and unset the default PM or be okay with charging the "wrong card" but saying it's expected

fervent marsh
#

"that is" being with setting default_payment_method and on_subscription both, on both update and sub creation, yes?

#

And yes I'm fine with users being confused about the wrong cards being charged. I care mostly about not having the cards decline

#

They can just email us and we can explain if it does become a problem

fervent marsh
#

Great

#

Last thing. What's the easiest way to remove credit cards on a customer that are not being used for anything (not default, not used as default for a sub). Double-loop everything?

hard aurora
#

yeah double loop or track this in your database I'd say

fervent marsh
#

Okay

#

Sorry one more. https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods says "After you create a PaymentMethod and attach it to a Customer, you can clone that PaymentMethod on a connected account" but also "It is possible to clone PaymentMethods to connected accounts without previously attaching them to Customers" - but it doesn't say how. Do I just omit the "customer" parameter? I'd like to skip saving Apple Pay cards to the platform customer object because it won't ever be needed there.

#

And I assume that if I use the cloned payment method to just attach to a customer object on the connect account, then "However, note that the original PaymentMethod will be consumed, since PaymentMethods that arenโ€™t attached to Customers can only be used once." won't be a problem.

hard aurora
#

Do I just omit the "customer" parameter?
yes, though it only works once

#

So you can't clone it more than once (but you can attach it on the connected account for future reuse on that account yes)

fervent marsh
#

Perfect