#oscarcodes

1 messages ยท Page 1 of 1 (latest)

blazing crestBOT
nova charm
#

Hello ๐Ÿ‘‹
Give me a second to look

swift cloud
#

Thank you

nova charm
#

If you click on the "X", does it take you back to the app?

swift cloud
#

It does, but fails to add the bank account details

nova charm
#

I see. Are you testing on the emulator or a real device?

swift cloud
#

On an emulator

nova charm
#

Have you tried on a real device to see if it behaves differently?

swift cloud
#

I have not, I can do that now

#

yeah same issue

#

on physical device

nova charm
#

Interesting.. Are you using the same exact code from our guide?

swift cloud
#

For jetpack compose we use the following

`val stripeLauncher = rememberLauncherForActivityResult(
contract = PaymentSheetContract(),
onResult = {
when (it) {
is PaymentSheetResult.Failed,
is PaymentSheetResult.Canceled -> {
viewModel.send(PaymentMethodAction.PaymentMethodsStripeKeysClear)
}

            is PaymentSheetResult.Completed -> {
                viewModel.send(PaymentMethodAction.PaymentMethodUpdated)
                viewModel.send(PaymentMethodAction.PaymentMethodsStripeKeysClear)
                viewModel.viewModelScope.launch {
                    viewModel.load(forceRefresh = true)
                }
            }
        }
    }
)`
nova charm
#

When you click on the CTA, does it hit the .Completed condition in your code at all?

I'm not super familiar with Jetpack compose myself

swift cloud
#

It does not hit any success or error conditions

#

Also nothing in the logcat is indicative of an error

#

The code above is similar to the following documented callback

fun onPaymentSheetResult(paymentSheetResult: PaymentSheetResult) { when(paymentSheetResult) { is PaymentSheetResult.Canceled -> { print("Canceled") } is PaymentSheetResult.Failed -> { print("Error: ${paymentSheetResult.error}") } is PaymentSheetResult.Completed -> { // Display for example, an order confirmation screen print("Completed") } } }

nova charm
#

Gotcha. And can you share the code you're using to present PaymentSheet?

swift cloud
#
                    PaymentSheetContract.Args.createSetupIntentArgs(
                        clientSecret = viewAction.setupIntentInformation.customerIntentSecret,
                        config = PaymentSheet.Configuration(
                            merchantDisplayName = viewAction.setupIntentInformation.merchantName,
                            customer = PaymentSheet.CustomerConfiguration(
                                id = viewAction.setupIntentInformation.customerId,
                                ephemeralKeySecret = viewAction.setupIntentInformation.customerEpheralSecret,
                            ),
                            allowsDelayedPaymentMethods = true,
                            allowsPaymentMethodsRequiringShippingAddress = true
                        )
                    )
                )```
nova charm
#

Can you share the SetupIntent ID too?

Also what version of the SDK are you running?

swift cloud
#

setupIntentId - seti_1Nk5dbKA296nhejwPBvo3x41_secret_OX9xAOfK5w3UgJ1vlvXQEe47V0rVpAu

#

stripe = "20.25.5"

nova charm
#

stripeLauncher.launch is equivalent to what? flowController.configureWithPaymentIntent. ?

swift cloud
#
        contract = PaymentSheetContract(),
        onResult = {
            when (it) {
                is PaymentSheetResult.Failed,
                is PaymentSheetResult.Canceled -> {
                    viewModel.send(PaymentMethodAction.PaymentMethodsStripeKeysClear)
                }

                is PaymentSheetResult.Completed -> {
                    viewModel.send(PaymentMethodAction.PaymentMethodUpdated)
                    viewModel.send(PaymentMethodAction.PaymentMethodsStripeKeysClear)
                    viewModel.viewModelScope.launch {
                        viewModel.load(forceRefresh = true)
                    }
                }
            }
        }
    )```
#

It's a request to start an activity for result

nova charm
#

Where are you using flowController.configureWithPaymentIntent? I mean what would be jetpack compose == to that

swift cloud
#

I'm fairly confident the equivalent is

stripeLauncher.launch( PaymentSheetContract.Args.createSetupIntentArgs( clientSecret = viewAction.setupIntentInformation.customerIntentSecret, config = PaymentSheet.Configuration( merchantDisplayName = viewAction.setupIntentInformation.merchantName, customer = PaymentSheet.CustomerConfiguration( id = viewAction.setupIntentInformation.customerId, ephemeralKeySecret = viewAction.setupIntentInformation.customerEpheralSecret, ), allowsDelayedPaymentMethods = true, allowsPaymentMethodsRequiringShippingAddress = true ) ) )

nova charm
#

Hmm the reason I am asking is because I am not sure if you're using the flowcontroller flow or just the regular paymentsheet flow.

swift cloud
#

Ok thank you, can you explain the difference please

#

And why this is important for context

blazing crestBOT
nova charm
#

The flowcontroller flow allows you to complete payment/setup in your own UI
https://stripe.com/docs/payments/save-and-reuse?platform=android&ui=payment-sheet#flowcontroller

So you'd likely need to deal with UI handling to a degree

When the customer finishes, the sheet is dismissed and calls the paymentOptionCallback passed earlier in create. Implement this method to update your UI with the returned paymentOption.
https://stripe.com/docs/payments/save-and-reuse?platform=android&ui=payment-sheet#flowcontroller:~:text=collect payment details.-,When,-the customer finishes

swift cloud
#

So are you suggesting that the reason the success webview hangs is because this isn't configured in our app?

nova charm
#

yes

#

exactly

#

Since there are no errors, crashes and it doesn't even hit the result block

swift cloud
#

There is no documentation of how this would work in Jetpack compose

rich lily
#

Hi ๐Ÿ‘‹

#

I'm taking over as @nova charm had to go.

#

You are correct that our Android code examples currently do not utilize Jetpack Compose

swift cloud
#

For example, the create() function for the flowController is only practical for usage in fragments or activities

#

Hi Snufkin

#

Can I just verify that So are you suggesting that the reason the success webview hangs is because this isn't configured in our app? is truly the issue?

rich lily
#

Well if @nova charm didn't see any errors in your account logs and you aren't seeing any errors logged from the Stripe SDK, that would strongly suggest this is where the issue lies.

#

Is none of the code in your onResult block firing?

swift cloud
#

That's right, none are firing

#

except for credit cards, that works well

#

Just connecting with my team, please keep this thread

rich lily
#

We have to archive threads after a period of inactivity but you can always come back and ask again

swift cloud
#

That's fair, I won't be long

#

Do you have any examples of payment sheet with jetpack compose

rich lily
#

No we do not