#GiovanniV - Payment Sheet Error

1 messages ยท Page 1 of 1 (latest)

whole bay
#

Hi ๐Ÿ‘‹
Can you share the code you use to initialize the Payment Sheet?

spare ore
#

I'm using Stripe 22.6.0.

#

var paymentConfiguration = PaymentSheet.Configuration()
paymentConfiguration.merchantDisplayName = "xxxx"
paymentConfiguration.allowsDelayedPaymentMethods = true
paymentConfiguration.apiClient.publishableKey = stripeAPIKey

            paymentConfiguration.appearance.colors.background = DesignSystem.background
            paymentConfiguration.appearance.colors.componentBackground = DesignSystem.ctaBackground
            paymentConfiguration.appearance.colors.text = DesignSystem.text
            paymentConfiguration.appearance.colors.textSecondary = DesignSystem.secondaryText
            paymentConfiguration.appearance.colors.primary = DesignSystem.digitalBlue
            paymentConfiguration.appearance.cornerRadius = 12

            paymentConfiguration.customer = PaymentSheet.CustomerConfiguration(id: $0.customer_id, ephemeralKeySecret: $0.ephemeral_key)

            self.paymentSheet = PaymentSheet(setupIntentClientSecret: $0.client_secret, configuration: paymentConfiguration)
            self.paymentSheet?.present(from: presenter) { paymentSheetResult in
rotund mural
#

Hey @spare ore ๐Ÿ‘‹ I asked you about which exact doc you were following last time and you just gave us a slack link

#

do you have more details here? This looks like the exact same question as last time with no extra information

spare ore
#

Yes, if you look at that doc and my code.

They're basically exactly the same.

Only difference being the setup payment intent API call cause it's obviously different endpoints.

#

as you recomended

rotund mural
#

PaymentSheet.CustomerConfiguration I don't see this anywhere in that guide but I see ``` var configuration = PaymentSheet.Configuration()
configuration.merchantDisplayName = "Example, Inc."

    let paymentSheet = PaymentSheet(
        paymentIntentClientSecret: paymentIntentClientSecret,
        configuration: configuration)``` for example
#

are we looking at different docs?

spare ore
#

let me check

rotund mural
#

Are you an experienced iOS developer too or just piecing things around? No judgment here, I'm not a good iOS developer but that will help me grasp the situation

spare ore
#

There are minor differences like merchantDisplayName is "XXXX" and extra configuration for appearance, but it's the same code.

The other difference is I'm not using paymentIntent constructor because I'm just adding a payment method. I'm not trying to actually make a payment.

#

var paymentConfiguration = PaymentSheet.Configuration()
paymentConfiguration.merchantDisplayName = "XXXX"
paymentConfiguration.allowsDelayedPaymentMethods = true
paymentConfiguration.apiClient.publishableKey = stripeAPIKey

#

It's there in my code.

rotund mural
#

I don't really follow you, you share a doc that does look qite different. For example let paymentSheet = PaymentSheet( paymentIntentClientSecret: paymentIntentClientSecret, configuration: configuration) this is how you pass the secret, your code is completely different (and about setupIntent which is not that doc?)

#

I'm trying to figure out what doc you are really following

spare ore
#

the flow is setup_intent, not payment_intent

rotund mural
spare ore
#

OK I think I have a mix of APIs I will check and get back to you guys I appreciate all your help

rotund mural
#

sure thing! start with that new doc