#WEIRDLEMON - Default Payment Method
1 messages · Page 1 of 1 (latest)
Hello! You can make a Payment Method a Customer's default for Invoices by setting invoice_settings.default_payment_method on the Customer: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
oh, alright
One more thing
Doing this will change the default card selected in the paymentSheet UI? In react native
That depends on the specific scenario and Customer. I recommend giving it a try. If it doesn't do what you expect we can provide further help once we have specific details.
Let me share a few screenshots?
That might help
- this is my checkout screen
2 clicking on place your order takes me to :
Payment sheet UI
Now, I want to make sure that the card selected by default in PaymentSheet UI by stripe is the same as shown in the above image fetched by stripe API
Okay. Does setting it as I described above not do that?
trying that
I am not getting any paymentMethod as default in a customer's invoice settings
What do you mean?
When I list all the cards using APIs, I get:
> {
> id: 'pm_1KBD8gIroE9a6cxWEAqRdl07',
> object: 'payment_method',
> billing_details: { address: [Object], email: null, name: null, phone: null },
> card: {
> brand: 'visa',
> checks: [Object],
> country: 'US',
> exp_month: 6,
> exp_year: 2026,
> fingerprint: 'cXvH3zuQtohmfOcD',
> funding: 'credit',
> generated_from: null,
> last4: '4242',
> networks: [Object],
> three_d_secure_usage: [Object],
> wallet: null
> },
> created: 1640588218,
> customer: 'cus_KqbtMBgBtHlJoB',
> livemode: false,
> metadata: {},
> type: 'card'
> },
> {
> id: 'pm_1KAukiIroE9a6cxWiyCBcV5R',
> object: 'payment_method',
> billing_details: { address: [Object], email: null, name: null, phone: null },
> card: {
> brand: 'visa',
> checks: [Object],
> country: 'US',
> exp_month: 4,
> exp_year: 2027,
> fingerprint: 'cXvH3zuQtohmfOcD',
> funding: 'credit',
> generated_from: null,
> last4: '4242',
> networks: [Object],
> three_d_secure_usage: [Object],
> wallet: null
> },
> created: 1640517540,
> customer: 'cus_KqbtMBgBtHlJoB',
> livemode: false,
> metadata: {},
> type: 'card'
> }
> ]
> ```
When I list the Customer using APIs I get
USER===> {
> id: 'cus_KqbtMBgBtHlJoB',
> object: 'customer',
> address: null,
> balance: 0,
> created: 1640517218,
> currency: null,
> default_source: null,
> delinquent: false,
> description: null,
> discount: null,
> email: null,
> invoice_prefix: 'C6E2F03C',
> invoice_settings: { custom_fields: null, default_payment_method: null, footer: null },
> livemode: false,
> metadata: {},
> name: null,
> next_invoice_sequence: 1,
> phone: null,
> preferred_locales: [],
> shipping: null,
> tax_exempt: 'none'
> }
Even though I have 2 cards, invoice_settings.default_payment_method is null
However, a card is pre-selected in paymentSheet UI
So, I'm just confused
How is this being handled
It's probably selecting the most recent one since no default is set.