#dilkw

1 messages · Page 1 of 1 (latest)

wraith lynx
#

hello @fickle onyx, can you share the paymentIntent id?

#

it'd look like pi_123

fickle onyx
#

pi_3JhrxkERyqAJHa2o17NpXiE7

wraith lynx
fickle onyx
#

I use this method paymentSession.presentPaymentMethodSelection(null); to start the card selection page

#

It looks like this through the Charles tool

wraith lynx
#

based off your screenshot, Stripe is returning the correct data, you'll probably need to check your code to see why you're not displaying that payment method in your page

fickle onyx
#

Just now I started the card selection page and requested after clicking Add card, but when I first started the card selection page, no card information was displayed.

#

Can you tell me that the normal process is the next step to get the card information on the card selection list page?

wraith lynx
#

@fickle onyx the customer id in your screenshot is different from all the other customer ids before

#

can you verify if you're using the same customer id as the one you can created a card for previously?

#

if you attach a card to customer_A, you will only see the card previously attached if you make the request to list all payment methods for customer_A

#

if you're requesting for customer_B which you had not attached a card before, then you would not see any cards when you attempt to list the payment methods for customer_B

fickle onyx
#

Before I start the card selection page, I will request the interface server to call createEphemeralKey to return customer_id.

wraith lynx
#

alright, and then does that customer in the screenshot already have a payment method attached?

fickle onyx
#

I don’t know this. I see that the customer_Id returned by createEphemeralKey is different every time.

#

The step of createEphemeralKey is done on the server. What parameters are needed in this step?

crisp juniper
#

see that the customer_Id returned by createEphemeralKey is different every time
then you're creating a new customer(you wrote that backend code right?)

#

What parameters are needed in this step?
the customer ID and an API version

fickle onyx
#

I didn’t write the backend code

crisp juniper
#

Note that you need a customer authentication system in the backend at some point — like you need to be able to map a user of the app to a Stripe customer cus_xxx object and use that Customer in the calls for the ephemeral key when that user is using the app instead of creating new ones.

That's why the example at https://glitch.com/edit/#!/remix/stripe-mobile-payment-sheet notes that it's just a sample and creates a new customer each time, in production you need to replace that with some authentication to re-use customers

fickle onyx
#

Our process:

  1. The server creates paymentIntent and returns client_secret.
  2. Start PaymentMethodActivity, which is the card selection page, request the server interface createEphemeralKey, return customer, and get the card list.
  3. The client creates ConfirmPaymentIntentParams according to client_secret, and then confirm().
  4. Notify the server to capture after confirm is complete
#

So, should this be a problem with the createEphemeralKey step of the backend?

crisp juniper
#

what you describe sounds totally normal and correct!

fickle onyx
#

Instead of recreating cus_xxx, what should I do?

crisp juniper
#

Note that you need a customer authentication system in the backend at some point — like you need to be able to map a user of the app to a Stripe customer cus_xxx object and use that Customer in the calls for the ephemeral key when that user is using the app instead of creating new ones.

fickle onyx
#

Also, where should I see if the user has tied the card?

crisp juniper
#

what does 'tied' mean?

fickle onyx
#

It is all the cards that the user has bound.

crisp juniper
fickle onyx
#

ok

#

Hold on, please keep in touch, I will try to communicate with the backend