#crisscrosschris

1 messages · Page 1 of 1 (latest)

pliant jayBOT
flint nacelle
#

Hello

#

When threads go inactive for some time then they get closed.

loud thunder
#

Ah gotcha

flint nacelle
#

Can you summarize the issue you are experiencing?

loud thunder
#

yeah, basically stripe UI allows users to add multiple payment methods and select the one they want, but doesn't keep track of which one they selected

#

Unless I'm missing something, you should flag this internally bc it seems like a major oversight

flint nacelle
#

What do you mean exactly by "doesn't keep track of which one they selected"?

#

Are you using the custom flow here?

loud thunder
flint nacelle
#

Ah you are saving cards to set up for payment in the future.

#

Yeah so you are still going to need your customer to indicate which payment method they want you to charge.

#

So when you store them you assign some indicator on your end either through metadata or in your database.

#

How does the future charge come about here?

#

Like what is the use-case exactly?

loud thunder
#

It's a betting todo app where I'm bundling and charges fines at the end of the week

#

So they need to set up a credit card in order to bet money

#

The issue is the pre-built Stripe UI allows users to save multiple PMs & select a default one, but it doesn't give me any way to know which one they selected as the default one

flint nacelle
#

I don't think it lets you set a default at all?

#

That really isn't a thing outside of Subscriptions/Invoices

#

And that isn't something that is handled on the client

#

Regardless, when your customer opens the sheet they have two choices -- they either select a PM they have already set up in which case no new card is added or they add a new one.

#

You will know after the promise resolves by listing PMs which of these is the case.

#

You would still show on your client which card is going to get charged.

loud thunder
#

Yep

#

that's what i do

flint nacelle
#

So if they add a new one then you likely want to show the new one added as the one that will get charged in the future.

loud thunder
#

however, the UI has this little check at the bottom right and u can select between the different saved cards

#

when they switch to the 2nd visa and click set up, I can't detect that

flint nacelle
#

Right, that is because this is the same UI that was built initially as a payment UI

#

I see your point -- it is a flow that can definitely be improved.

#

I'm happy to submit feedback on it.

#

That said, for now, you have a couple options.

#

First, you can just not pass an ephemeral key at all here and we won't show the already-saved PMs. You would just do this in your own UI instead

#

Actually... what happens to the SetupIntent if you choose one that has already been saved?

#

Does it not get confirmed again?

loud thunder
#

Here's the setup intent object. It doesn't appear to store the selected payment method?

  "id": "seti_1Nk7RMCNzspyvGyf1KTmOKoP",
  "object": "setup_intent",
  "application": null,
  "automatic_payment_methods": null,
  "cancellation_reason": null,
  "client_secret": "seti_1N**********************_******_***************************2fqn",
  "created": 1693236800,
  "customer": "cus_ORFsXyE09aqu6l",
  "description": null,
  "flow_directions": null,
  "last_setup_error": null,
  "latest_attempt": null,
  "livemode": false,
  "mandate": null,
  "metadata": {
  },
  "next_action": null,
  "on_behalf_of": null,
  "payment_method": null,
  "payment_method_options": {
    "card": {
      "mandate_options": null,
      "network": null,
      "request_three_d_secure": "automatic"
    }
  },
  "payment_method_types": [
    "card"
  ],
  "single_use_mandate": null,
  "status": "requires_payment_method",
  "usage": "off_session"
}```
flint nacelle
#

That is after you re-selected one of the previously saved PMs and hit "Set up"

#

?

loud thunder
#

yeah

#

Whenever "Set up" is clicked there's never a default method stored in this object

flint nacelle
#

Can you perform another test real quick where you select one of the already-saved PaymentMethods and click "set up" and then provide me the SetupIntent ID?

loud thunder
#
{
  "id": "seti_1NkB4ZCNzspyvGyfsXmmqVtO",
  "object": "setup_intent",
  "application": null,
  "automatic_payment_methods": null,
  "cancellation_reason": null,
  "client_secret": "seti_1N**********************_******_***************************F45D",
  "created": 1693250763,
  "customer": "cus_ORFsXyE09aqu6l",
  "description": null,
  "flow_directions": null,
  "last_setup_error": null,
  "latest_attempt": null,
  "livemode": false,
  "mandate": null,
  "metadata": {
  },
  "next_action": null,
  "on_behalf_of": null,
  "payment_method": null,
  "payment_method_options": {
    "card": {
      "mandate_options": null,
      "network": null,
      "request_three_d_secure": "automatic"
    }
  },
  "payment_method_types": [
    "card"
  ],
  "single_use_mandate": null,
  "status": "requires_payment_method",
  "usage": "off_session"
}
flint nacelle
#

That re-confirmed a previously set up PaymentMethod

#

Are you sure you are looking at the correct SetupIntent?

#

The one associated to the client secret that you are using to initialize Payment Sheet?

loud thunder
#

but that looks very promising

#

i'm noticing when i switch it the object's PM id changes

flint nacelle
#

After presentPaymentSheet() resolves you should be able to retrieve the SetupIntent and know which PaymentMethod was selected.

loud thunder
#

Ok I'll tackle that and come back if I need help

#

Thx for the help!!

#

Really appreciate it