#vaios_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1319583622029774922
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Can you tell me more about "hide the Stripes UI screen for selecting a saved payment method", do you have some UI mock ups that I can see to better understand what you want to achieve?
This is screen is displayed when we open the flowcontroller and therea are saved payment methods. Is there a way to avoid this screen
we want to be able to open only this sheet
So you don't want your customer to reuse a saved payment method?
Ok, then you need to build the UI by yourself.
We are already building it. But we want to reuse the way of adding a payment method through Stripe UI
To clarify, so you don't want to use PaymentSheet, instead you want to build your own UI to let your customer to select a saved payment method?
We want to use FlowController/PaymentSheet only for payment method addition
for selecting saved payment method we want to use our custom screen
Ok, then you can use a setup mode payment sheet to collect a payment method, and use your own flow for payment.
can you share link/code? I am not sure that i understood
This changes the flow a lot. As we need to get client secret before confirming the payment. With intent configuration we get it when we confirm
The setup mode payment sheet also support deferred intent flow https://docs.stripe.com/payments/accept-a-payment-deferred?platform=android
we use this flowController.configureWithIntentConfiguration() and the UI with the saved payment methods is displayed
With our current implementation we get the client secrete in this callback
PaymentSheet.FlowController.create(
fragment = fragment,
createIntentCallback = { paymentMethod, shouldSavePaymentMethod ->
val clientSecret = ...
CreateIntentResult.Success(clientSecret = clientSecret)
},
To use setUp intent we need to implement something like that
flowController.configureWithSetupIntent(clientSecret)
Which implies that we should retrieve clientsecret beforehand
Hey! Taking over for my colleague.
Have you had a chance to check this guide?
https://docs.stripe.com/payments/accept-a-payment-deferred?platform=android&type=setup
This is what we have implemented
and we call this flowController.configureWithIntentConfiguration
I suppose that you want me to call this flowController.configureWithSetupIntent
which breaks the flow and needs a lot of refactor
In the guide I shared there is no mention to flowController.configureWithSetupIntent...
You want to collect a PaymentMethod using a SetupIntent without having to create the intent first right ?
Are you passing a Customer Id and an ephemeral Id to the PaymentSheet ?
yeah! we pass both of them
You shouldn't then.
In the guide, there is no mention to send Customer and Ephemeral Key.
Just create the SetupIntent with the Customer Id later.
If i do not pass Customer and Ephemeral Key how the user will be able to save the payment method? ๐
Is there any example on github?
By passing the Customer with the SetupIntent.
Passing the Customer and the Ephemeral Key to the PaymentSheet is optional, it's just for showing preivously saved payment method on the PaymentSheet.
It is optional. If you do not pass it though you do not have the option to save. This was something mentioned on another thread here and this behavior is confirmed on our current poc
We want to display the checkbox but not the saved payment methods
We want to display the checkbox but not the saved payment methods
No you can't achieve that.
Why explcitily you want to have the Checkbox ?
In your case, you'll need simply to collect/save the PaymentMethod via SetupIntent right ? you'll be able to use it in the future by then.
What is the missing feature that you need and requires having that Checkbox ?
We want to have the checkbox in order to not have to implement all the logic on one deliverable
we want to use Stripe's UI for adding the payment method (so the checkbox is needed)
but we want to display saved payment methods on our UI (and not on stripe UI)
We want to have the checkbox in order to not have to implement all the logic on one deliverable
Could you please share more details about this ?
we want to use Stripe's UI for adding the payment method (so the checkbox is needed)
No, you can add/save a payment method without the Checkbox
How the user can select to save a payment method without the Checkbox? ๐ค
That's the usage of SetupIntent.
You'll be setting the Customer at the SetupIntent level.
Have you had the chance to test the flow I'm describing above ? It seems like your current flow by just removing passing the Customer and ephemeral key to the PaymentSheet and pass the Customer to the SetupIntent.
We did it a no card was saved. We asked in discord and the guide us like that
the problem is that setup intent needs the client secret before hand
With our current implementation we get the client secret on confirm. Not on configuring the FlowController
No, you can collect the payment method without creating the SetupIntent at the first place.
The guide I shared with you it's creating the SetupIntent after collecting the PaymentMethod:
https://docs.stripe.com/payments/accept-a-payment-deferred?platform=android&type=setup#android-submit-setup
This is server side. I shared snippets here on what we need to do on sdk that are not aligned with that.
With our current implementation we do this
val flowController = PaymentSheet.FlowController.create(
fragment = fragment,
createIntentCallback = { paymentMethod, shouldSavePaymentMethod ->
// THIS IS WHERE SERVER IS CALLED. this happened on confirm
val clientSecret = ...
CreateIntentResult.Success(clientSecret = clientSecret)
},
)
flowController.configureWithIntentConfiguration() <- NO CLIENT SECRET HERE
After some interactions and maybe some minutes later user presses to pay so we invoke
flowController.confirm()
Which actually triggers the createIntentCallback
With setup intent we need to do this
flowController.configureWithSetupIntent() <- CLIENT SECRET IS NEEDED
This is called way before user presses confirm.
Yes in the createIntentCallback you need to provide a SetupIntent and provide the client secret
At that point you'll need to provide a client secet... but you have collected the PaymentMethod already without the Intent
In your code, you see, you have already the paymentMethod
createIntentCallback = { paymentMethod, shouldSavePaymentMethod ->
We know that... Without customer id and ephemeral key how will the customer change the value of shouldSavePaymentMethod
The checkbox wont be visible
Why you are displaying the PaymentSheet with SetupIntent in this case ?
Common... You are the third guy in this thread and you say the same. We do everything that is described here https://docs.stripe.com/payments/accept-a-payment-deferred
But we do not want to display saved payment methods on Stripe's UI. In order to select the value of shouldSavePaymentMethod the checkbox should be visible.
Is there any way to achieve this behavior
We want to have deferred payments
to collect the payment methods and pay a screen later
No you can't have the Checkbox and not have the saved payment method.
Either have both or nothing.
๐ฆ
Are there any plans to include it?
The options that we have here are to have a fully custom UI?
You can implement the Checkbox in your mobile UI, and let the customer check it before displaying the PaymentSheet.
On that case what value are we going to pass to set up intent for future usage?
The setup_future_usage has three values. off/on/null on the sdk. Why do we have three options? ๐ค
For your use case you'll need off_session
Can you explain more? Because it is a bit unclear what the usage
But you can learn more about on_session here:
https://docs.stripe.com/api/payment_intents/create#create_payment_intent-setup_future_usage
I have read that multiple times and i can not say they are clear
at some point i felt that it has to do with save or not
then i thought that it has to do with subscriptions
i can search/find the documentation ๐
The question is, are you going to charge the Customer using the Save Payment method on session or off session.
Off session means that the customer isn't live in your webite/app, while on session means they are on your app/website.
Is live on app. So we need on_session and not off_session
and if the user does not want to save, we just pass null right?
I think i have a solution. A last step is missing.
If i want to save a credit card to pay only when the user is online i use on_session for futureUsage
If i do not want to save a credit card i use null for futureUsage
Right?
correct