stripe-paymentspsd2

Is there an equivalent to the default source, when using SetupIntent & PaymentIntent?


With the Sources API, every customer had a default_source, but when using SetupIntent (in order to be compliant with the PSD2/SCA directive), there doesn't seem to be any direct equivalent.

So my question is, how this can be properly represented API-side (without using metadata)?

The payment_methods listing seems to have a property called preferred for the card (which seems to be what I am looking for), but so far I have not found out, how to get/set this property.


Solution

  • There is no direct equivalent to the default_source for Payment Methods and the newer APIs like Setup Intents and Payment Intents. The closest thing is invoice_settings.default_payment_method, but it only applies to Invoices.

    To answer your question directly, you have three choices:

    1. Set and use the value of invoice_settings.default_payment_method, specifying the Payment Method stored there explicitly for each Setup and Payment Intent
    2. Specify the default Payment Method in metadata as you suggested
    3. Store the default on your end in your own database

    Regarding the preferred property, if you're referring to card.networks.preferred that is the preferred card network of the card in question and is not relevant to your question.