#drewtester-ios

1 messages · Page 1 of 1 (latest)

fresh flume
#

Hello! Go ahead and ask 👍

edgy patio
#

When displaying the drop in ui on the iOS app we are prompted with a list of payment methods along with a button that says add card that then prompts the user to add card information. Is there a way to directly display the add card info scene and effectively skip the list of payment methods?

fresh flume
#

You're referring to the list of saved payment methods, right?

edgy patio
#

TLDR we want to use the drop in ui just to collect payment information and aren’t really concerned with the result of the setup intetent

#

Yes

fresh flume
#

Is your integration currently using Customer and Ephemeral Keys when setting up the Payment Sheet? I believe if you omit those then we won't show saved payment methods

edgy patio
#

Yes it is and we tried omitting those keys but then the sheet doesn’t show up at all

fresh flume
#

Can you show me what you omitted?

edgy patio
#

When initializing the customer on the payment sheet it takes in a non optional ephemeral key string value as well

fresh flume
#

Can you show me your specific code?

edgy patio
#

It looks like so

 if let configuration = requestState.response {
                    STPAPIClient.shared.publishableKey = configuration.publishableKey

                    guard let id = configuration.stripeCustomerId,
                          let intent = configuration.setupIntent,
                          let ephemeralKey = configuration.ephemeralKey else {
                        return
                    }
                    
                    var paymentSheetConfiguration = PaymentSheet.Configuration()
                    paymentSheetConfiguration.merchantDisplayName = "LLC,"
                    paymentSheetConfiguration.customer = .init(id: id, ephemeralKeySecret: ephemeralKey)
                    paymentSheetConfiguration.allowsDelayedPaymentMethods = true
                    
                    $0.paymentSheet = PaymentSheet(setupIntentClientSecret: intent, configuration: paymentSheetConfiguration)
                }
#

so what we did was change it to paymentSheetConfiguration.customer = .init(id: id, ephemeralKeySecret: "")

#

and that no longer works for the drop in UI

fresh flume
#

You should just remove that line entirely - so don't set paymentSheetConfiguration.customer at all

edgy patio
#

Will that still attach the new payment method to the customer though?

#

Btw giving it a run now!

fresh flume
edgy patio
#

Awesome this is working great, thank you much!