#WEIRDLEMON - Default Payment Method

1 messages · Page 1 of 1 (latest)

gusty jay
covert wedge
#

oh, alright

#

One more thing

#

Doing this will change the default card selected in the paymentSheet UI? In react native

gusty jay
#

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.

covert wedge
#

Let me share a few screenshots?

#

That might help

#
  1. 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

gusty jay
#

Okay. Does setting it as I described above not do that?

covert wedge
#

trying that

#

I am not getting any paymentMethod as default in a customer's invoice settings

gusty jay
#

What do you mean?

covert wedge
#

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

covert wedge
#

So, I'm just confused

#

How is this being handled

gusty jay
#

It's probably selecting the most recent one since no default is set.

covert wedge
#

That definitely helps!

#

Let me try your method real quick to check if this works

#

Thanks Rubeus!