stripe / stripe-terminal-ios

Stripe Terminal iOS SDK
https://stripe.com/docs/terminal/sdk/ios
Other
104 stars 65 forks source link

[HELP] A required parameter was invalid or missing. Collecting a PaymentMethod for a Paymentintent 'on_behalf_of' a Connected Account requires providing that Connected Account's ID in 'SCPLocalMobileConnectionConfigu- ration #314

Closed Maks273 closed 4 months ago

Maks273 commented 4 months ago

I keep getting this error on Terminal.shared.collectPaymentMethod(paymentIntent). I assume it's API issue. Any suggetions please?

Screenshot 2024-07-18 at 09 43 22
Maks273 commented 4 months ago

Tried the approach from doc https://docs.stripe.com/terminal/features/connect?terminal-sdk-platform=ios#destination-payment-intents but it's not possible to set the values

Screenshot 2024-07-18 at 10 06 01
bric-stripe commented 4 months ago

sorry, that doc has typos 😞 we'll get that fixed up. You just need to set the params on the builder before building. Once built its a read only object. Updated snippet:

        let params = try PaymentIntentParametersBuilder(amount: 1000,
                                                    currency: "gbp")
            .setOnBehalfOf("connected account id")
            .setTransferDataDestination("connected account id")
            .setApplicationFeeAmount(200)
            .build()
bric-stripe commented 4 months ago

the docs snippet has been updated. Re-open if still running in to trouble.