#bruno - Subscriptions

1 messages · Page 1 of 1 (latest)

smoky nymph
#

HI 👋

wet token
#

Hi there!

smoky nymph
#

Okay so the customer uses are card that requires 3DS authentication (requires_action) and you want to add another card instead?

wet token
#

Yes.

smoky nymph
#

In that case I would use a new SetupIntent and then set the PM that gets created as the default for invoices for that customer

wet token
#

Hm, okay. Actually I'm doing that already. But then immediately after setting a payment method as the default I try paying the open invoice (related to requires_action PaymentIntent).

#

The problem is: when I use a card that errors (for example 4000008260003178 - errors with 'insufficient funds) - I'm getting an error when attempting to immediately pay that open invoice.

#

I know I kinda expanded my scenario here, but do you know of a solution for that?

smoky nymph
#

Sorry but now that's kind of really confusing

#

Can you explain exactly what you are doing (in chronological order) and what you expect to happen?

wet token
#

Ok, gimme a second to write it all out then.

#
  • I'm using a 4000002760003184 card when creating a new subscription. The customer confirms the payment online.
  • I'm using Test clocks and advance the time to 1 month + 1 day in the future. At this point another recurring PaymentIntent is created. It's status is requires_action, and the accompanying invoice is not paid.
  • The app user is brought online and they see a message "Please confirm card payment" in my app. Instead of confirming the payment with an existing card, the user wants to add another card.
  • When adding a new card the customer uses 4000008260003178 card number. On the backend, I'm creating SetupIntent for setting up a new card. On the frontend I use stripe.confirmCardSetup(...).
  • After successful stripe.confirmCardSetup() on the backend I'm setting up the payment method to be the default payment method for all invoices.
          Stripe::Customer.update(customer_remote_id, {
            invoice_settings: {
              default_payment_method: remote_id
            }
          })
  • After this, on the backend I attempt paying the invoice associated with PaymentIntent which requires_action status. This way the customer's open invoice is paid immediately after they add a new card to their account.
    This last step errors because 4000008260003178 card is used.

Hopefully the above steps explain what I'm trying to do: I want to attach the new card to the existing Stripe customer AND also pay the open invoice with requires_action PaymentIntent. Ideally, the card would not get attached to the customer AT ALL, if the requires_action PaymentIntent is not paid.

Do you have any advice for the above scenario?

wet token
#

@smoky nymph just curious, do you have any thoughts on the above? Thanks!

smoky nymph
#

Yeah sorry, it's been busy

#

If you never want to try confirming cards that result in a requires_action status, I think you'll get caught in a SetupIntent loop

wet token
#

Hm, and by "SetupIntent loop" you probably mean the scenario I explained above, right?

smoky nymph
#

Well if you keep using test cards that require authorization for each charge

smoky nymph
#

Okay so let me step back once again because I think I got lost there. In your use case you would not want the PM to attach in the first place? So even in the initial scenario? But banks can request additional authentication at any time for any reason they want. That's why we make the test cards that require additional authentication even if they are set up for off-session payments.

chilly wigeon
#

Hello! I'm taking over and catching up...

#

To clarify, is my understanding correct that you want to avoid attaching PaymentMethods to Customers when the initial payment fails for a reason other than authentication being required? In your example the specific reason is insufficient funds, but you also want to include other declines in that scenario, right?

chilly wigeon
#

@wet token You still there?

wet token
#

Hi @chilly wigeon , yes I'm here. Let me answer your question.

#

To clarify, is my understanding correct that you want to avoid attaching PaymentMethods to Customers when the initial payment fails for a reason other than authentication being required?...
Yes, that's correct. I want to avoid attaching PaymentMethod to Customer in this case because of 'insufficient funds' error, but also include other declines.

#

And also, ideally the invoice related to requires_action PaymentIntent would be paid if the card is attached successfully (and there are no errors).

chilly wigeon
wet token
#

Ok, that makes sense.

chilly wigeon