#thomas-android-paymentsheet

1 messages ยท Page 1 of 1 (latest)

finite rivetBOT
gaunt pasture
#

Hello again! We were just talking about this recently, correct?

warm iris
#

No, I haven't messaged in several months.

gaunt pasture
#

Is that your teammate in the other thread?

pine cove
#

Yes, I'm the team mate

gaunt pasture
#

I think the answer to your question is in that other thread; I recommend you read through it and then if you have any additional questions after that let me know!

warm iris
#

Ah, my bad! Missed that message.

finite rivetBOT
warm iris
#

@gaunt pasture I read through the thread, but you don't seem to explain how this edit payment sheet is powered for the sample project.

#

Can you please elaborate?

#

cc @pine cove

gaunt pasture
#

For which sample project?

warm iris
#

Your sample project?

#

Reference the video that I attached.

gaunt pasture
#

Is that the sample project in the Android repo?

warm iris
#

It's in the Android repo, correct. The run configuration is called paymentsheet-example

gaunt pasture
#

The source code for that entire example is at the link above.

weary karma
#

thomas-android-paymentsheet

warm iris
#

I understand where the source code is. After forking the repo, I'm having trouble getting the edit payment sheet to display again and I was wondering if you could help explain how that sheet is powered?

weary karma
#

I think the first step here would be to look at the logs and figuring out what error(s) you get exactly

warm iris
#

No errors, I'm just unable to get the existing payments up again like in the video. Can you reproduce on your end?

weary karma
#

I'm going to need a lot more details from you to help you though

#

The android app requires a running server/back-end that provides the right information. Do you have that up and running? What exact part of the app is working already?

warm iris
#

I sat that up awhile ago, but maybe it's broken now. Can you link the docs for setting that up?

Here's what works:

  1. Tap "Playground"
  2. Tap "Reload Paymentsheet"
  3. Tap Checkout

When I do that, I'm able to add a payment method successfully. Then, unlike in the video, I'm unable to see the payment I just added.

weary karma
#

Are you using CustomerSheet?

warm iris
#

I'm using a PaymentSheet

#
                paymentSheet.presentWithSetupIntent(
                    setupIntentClientSecret = clientSecret,
                    configuration = makeConfiguration()
                )
#

Oh I got it to display using these options

#

So in the sample project, I've just confirmed that you can view existing payments, edit and delete them using:

       paymentSheet.presentWithSetupIntent(
                    setupIntentClientSecret = clientSecret,
                    configuration = makeConfiguration()
                )

This is the same thing that is used to add a payment for the first time. Does this make sense?

weary karma
#

I'm sorry I don't really understand what you're asking at all right now ๐Ÿ˜…

weak trench
#

๐Ÿ‘‹ hopping in here to help

#

@warm iris Are you still having issues getting this to work with presentWithPaymentIntent? You're just working off the sample app, right?

warm iris
#

Sorry for the confusion, I'm just trying to get definitive guidance about opening a payment sheet for setting up deferred payments. We won't a user to be able to add, edit, and delete payment methods.

In another thread with my colleague, it was suggested that you have two use different sheets for creating and editing, but it seems you don't have to do that using the above code.

#

This was the advice in the other thread with my colleague. This seems wrong based on the sample project.

#

Is my query clear?

weak trench
#

You're just trying to use SetupIntents to save payment methods to be charged later, right? I believe you should be able to do that with the PaymentSheet + SetupIntents as long as you're creating ephemeral keys and have customer set when you create the SetupIntent

warm iris
#

That's right! So to be absolutely clear, we shouldn't have two open different sheets depending on whether or not they've already added a payment method, correct?

weak trench
#

correct!

#

But you would need two different calls depend on whether you were using a paymentIntent vs a setupIntent (but they'd both be using the PaymentSheet)

warm iris
#

For deferred payment, shouldn't we always use setupIntent?

#

(To be clear, we only want to save payment methods to be charged later.)

weak trench
#

Yeah if you didn't want to collect payment immediately you'd just be using setup intents

#

Also give me a minute - I wasnt to check something about the ability to edit existing payment methods

warm iris
#

Thank you!

weak trench
#

When you say "edit" a PaymentMethod - what specific functionality are you hoping for?

warm iris
#

Selecting a primary payment method and deleting payment methods. Ideally, they wouldn't be able to delete their last payment method, but that's a nice to have.

weak trench
#

So we allow you to delete payment methods, but not "select a primary" from the payment sheet

warm iris
#

Okay gotcha, so they can add N number of payment methods, but there's no concept of a primary method. Is that correct?

weak trench
#

That concept does exist within stripe (it's invoice_settings.default_payment_method on the Customer), it's just not something you can manage through the PaymentSheet

warm iris
#

Okay, thank you! You've been so helpful. One last question: Can I confirm there's no built-in way of preventing them from deleting their last payment method?

weak trench
#

checking on that piece now (I'm pretty sure the answer is no, but doesnt hurt to check)

#

yeah as far as I can tell there's no way to to prevent them from deleting the last one

finite rivetBOT