#sowmyans-flutter-auth-capture

1 messages Β· Page 1 of 1 (latest)

proper root
proper root
#

So sorry - completely forgot to circle back to this!

#

To start off - yes, it's totally fine to do separate auth and capture with digital wallets like google and apple pay

white hamlet
#

Thanks yes ie what was documented. But in our case we need to use the saved cards, documentation is not giving clarity on how to find the default paymenthod if we have multiple payment methods for the same customer? Also not clarifying how we can do the same for apple wallet and google pay scenarios. It would be great if we have the documentation for flutter as well here same as react-native : https://stripe.com/docs/payments/save-and-reuse?platform=android&ui=payment-sheet#charge-saved-payment-method

torpid oyster
#

Hello, karbi had to step out. Catching up here...

#

So to be clear those remaining questions are mostly with displaying those on the front end with flutter-stripe correct?

#

Or is this a question of how to look those up server side?

white hamlet
#

Thanks, if we can get directions on how we can give a similar user experience and payment to the users as uber/Lyft and accomplish the hold and capture method using stripe + flutter is what we are looking for.

torpid oyster
#

Though those won't typically be set automatically, they have to be set explicitly via the API, dashboard, or customer portal

white hamlet
#

Ok thanks, regarding the question on building the payment experience as uber/Lyft using flutter. Can you provide any guidelines on it, please?

torpid oyster
#

What part of that are you looking for clarification on? I see we have covered how to hold funds on a payment method and how to look up a customer's default payment method, are you trying to figure out how to use those together? Or are you asking about some other aspect of that flow?

white hamlet
#

Mostly around how to implement the user experience on the flutter (cilent) side with stripe. e.g how we can get the authorization hold on the fund from the flutter, how to make a default payment method from the flutter (to attach it part of the customer). how to save the card and use it without asking the user to authorize each time when we make hold before the service etc. It seems you have good doc on react-native but couldn't find any for flutter, specifically for the scenarios mentioned

torpid oyster
#

I can't help with the client side aspects of that but can certainly point the way on the server side parts

torpid oyster
#

Apologies, never followed up on that. After reading through your description again, I am still a bit unclear on where you are stuck. Are you already collecting the Payment Method details and are trying to figure out how to re-use them when holding funds?

white hamlet
#

Thanks again for your help here. It seems the flutter stripe plugin is not providing the capabilities that we are looking for. Yes, we still don't have clarity on how to move forward with it for Stripe as the payment gateway. Seems Lyft is using Stripe and we are looking for exactly how Lyft implemented in their mobile app. We just need to know how to do this in flutter using the flutter stripe plugin.

limpid garnet
#

Hello! I'm taking over, catching up now...

#

As far as I know what you're asking about should be possible, although I can't be sure as Flutter isn't officially supported by Stripe and you're using a third-party library. What specific functionality in the Lyft app are you having trouble implementing with Flutter?

white hamlet
#

Got it , it seems Stripe is funding this open source project and it will be great if we can fill any feature parities. https://opencollective.com/flutter_stripe , we are looking for the rider payment experience like, onboarding payment options, have the option to use the default payment option for each ride, ability to change the default payment for each ride, authorize the payment to hold an estimate amount and capture the actual amount after the ride. With the stripe flutter plugin , it is not allowing us to authorize the payment using a default payment method without user clicking on the paymentsheet where as in Lyft it authorize the default card.

limpid garnet
#

The Payment Intent would be created on your server and have an existing PaymentΒ Method attached to it.

crimson mica
#

How we can attach an existing payment method while we are creating the payment intent of the customer has multiple payment intents ? How do we know customers preferred payment method with the flutter plug-in ? Also, how we can do the same with wallet like Apple Pay or google pay ?

limpid garnet
#

How we can attach an existing payment method while we are creating the payment intent of the customer has multiple payment intents ?
You would do this on your server by creating or updating a Payment Intent with payment_method set to an existing Payment Method: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method
How do we know customers preferred payment method with the flutter plug-in ?
There are a lot of ways to do this. Many people use metadata or set the invoice_settings.default_payment_method on a Customer and reference that: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
Also, how we can do the same with wallet like Apple Pay or google pay ?
That's a very broad question, can you be more specific?

vivid glen
#

catching up ~

white hamlet
# limpid garnet > How we can attach an existing payment method while we are creating the payment...

Our first challenge is flutter stripe package is not setting up the customer's default payment method, here are more details: https://github.com/flutter-stripe/flutter_stripe/discussions/512 , since we dont have the access the customer's preferred payment methods in the client not sure how we can make it work. Regarding the apple wallet, in order to get the payment details in the server it seems we need setup intent and it seems stripe doesn't support apple wallet and google pay for the same as per this issue https://github.com/flutter-stripe/flutter_stripe/issues/426

GitHub

When adding multiple cards all of them are listed in the customer's payment methods but not one of them is set as default. Is there a way to set it as a default? (flutter shows the payment ...

GitHub

As the title mentions can one use the PaymentSheet with a SetupIntent to save a card via GooglePay / ApplePay? I've got GooglePay installed on my device, added the required xml entry, and s...

vivid glen
#

Generally the setting up customer default payment method step should be done on server as Rubeus mentioned. I don't have a flutter project setup on my side, let me quick reference from other platform/libraries

white hamlet
#

Also need to confirm the apple wallet/google pay support for the same. Didnt get the clarity from the documentation, only the details what we have is from the github issue shared above

vivid glen
#

So, every client libraries doesn't support setting up Customer current method as default, because it's not possible to call from client. And to do what you want, you would need to listen to webhook events on server. When a PaymentIntent is confirmed by client, you will receive a payment_intent.succeeded

#

(Server) Create a PI -> (Client) confirm a PIT -> (Server) listen to webhook, catch the payment_intent.succeeded, take the PaymentMethodId and CustomerId and set as default to the Customer

#

how to get the paymentmethod_id while creating the payment_intent in the server using flutter stripe
You can't yet, because only after PaymentIntent is confirmed, you will have the PaymentMethod Id

white hamlet
#

Thanks for the info, when we use flutter stripe package the default payment sheet is showing default payment method in the client but that is not the default payment method in the customer object.

#

ie the screenshot from the flutter payment sheeet after adding the payment methods. Here client can choose different methods, now while processing the payment in the server we dont have this information as it was only in the client

vivid glen
#

Is 3155 actually the default payment method? Could you give me the Customer Id for a quick look?

white hamlet
#

nope by default when we use flutter stripe package it is adding all card payment methods for the customer but none of them selected as default in the stirpe side

#

default source / invoice default soure all are null by default

#

so here when we follow this , (Server) Create a PI -> (Client) confirm a PIT -> (Server) listen to webhook, catch the payment_intent.succeeded, take the PaymentMethodId and CustomerId and set as default to the Customer, since we are doing this in the backend how do we know the succeeded payment method is the preferred payment method for the client ?

#

if we have multiple payment methods

#

if we can know how this can be done in ios / android also would be good. As I have mentioned earlier, our payment model is going to be exactly like how uber and lyft. if we can know how this can be achieved using stripe and flutter would be great

vivid glen
#

In the event payment_intent.succeeded you should have only one PaymentMethod which is used to confirmed that PaymentIntent

#

When you customer has multiple PaymentMethods, he/she still only be able to use 1 of them to confirm a specific PaymentIntent

white hamlet
#

ok, so each time when the user change the card in the flutter stripe paymentsheet and they confirm that will trigger webhook which can be indication that user changing their default payment method from the client?

vivid glen
#
  • it will indicates what PaymentMethod they have used from client, and you would want to set that PaymentMethod as default for them, or not. It's up to you as the merchant πŸ™‚
white hamlet
#

gotit thanks πŸ™‚

white hamlet
#

So are we missing that webhook notification and set the payment intent information in that documentation>

vivid glen
#

Oh so you are using SetupIntent?

white hamlet
#

yes

vivid glen
#

Similarly you will have the setup_intent.created which contains the PaymentMethodId

white hamlet
#

also our payment intent is getting created like this , https://stripe.com/docs/payments/capture-later#authorize-only , that article says the below but not sure how to do it technically, "Before continuing to capture, attach a payment method with card details to the PaymentIntent, and authorize the card by confirming the PaymentIntent. You can do this by setting the payment_method and confirm fields on the PaymentIntent"

Separate authorization and capture to create a charge now, but capture funds later.

#

if you can help on clarifying that would be helpful too

#

From both client and server side what we need to do for ""Before continuing to capture, attach a payment method with card details to the PaymentIntent, and authorize the card by confirming the PaymentIntent. You can do this by setting the payment_method and confirm fields on the PaymentIntent"
"

vivid glen
#

I see, you can simply follow the previous SetupIntent guide (https://stripe.com/docs/payments/save-and-reuse), and from step 5 of "Charge the saved payment method later", you append an extra parameter of capture_method: 'manual' then call the Capture API later

#

In that step 5, you are (creating + confirming) at the same time, already specifying a Payment Method

white hamlet
#

Ok thanks, so in step 5, how exactly the server is getting the PAYMENT_METHOD_ID? curl https://api.stripe.com/v1/payment_intents \

-d amount=1099
-d currency=usd
-d customer="{{CUSTOMER_ID}}"
-d payment_method="{{PAYMENT_METHOD_ID}}"
-d off_session=true
-d confirm=true

#

sorry for my ignorance with all these basic questions as I am brand new to strip SDK πŸ™‚

vivid glen
#

(please redact your key, this is a public forum)

#

Within the same guide, before step 4 and 5, on server listen to the setup_intent.created, take the Payment Method Id and Customer Id, then set the PaymentMethod Id as the default payment method. Then in step 5, instead of listing Payment Method Id as the guide says, you can simply find the default one

white hamlet
#

Aweosome thank you so much, i think that is waht puzzling me πŸ™‚ , I think it was not clear in the documentation

#

Now for the setup intent can you confirm if apple wallet and google pay supported ? https://github.com/flutter-stripe/flutter_stripe/issues/426 , since I couldnt find this information in any stripe documentation it would be great if you can validaet it

GitHub

As the title mentions can one use the PaymentSheet with a SetupIntent to save a card via GooglePay / ApplePay? I've got GooglePay installed on my device, added the required xml entry, and s...

#

also it is clear that we can get this as a paymentmethod in the backend as we are seeing only cards added as a payment_method not apple wallet cards

vivid glen
#

Yeah good question. You were correct that on backend/webhook we only see the PaymentMethodId, but I have a feeling that SetupIntent wouldn't support those wallet, because SetupIntent is for you to seamlessly charge your customer without their needs to be online, but ApplePay/GooglePay was designed to takes customer's authentication (face/fingerprint) for every payments πŸ€”

#

let me try it

crimson mica
#

Thank you πŸ™

vivid glen
#

I have tried around, and sorry I think ApplePay/GooglePay isn't compatible with SetupIntent, as mentioned in the issue above πŸ™‡β€β™‚οΈ

crimson mica
vivid glen
#

Sorry my bad! Yes it's setup_intent.succeeded indeed!