@@ -11,14 +11,12 @@ import com.stripe.android.customersheet.FakeStripeRepository
1111import com.stripe.android.isInstanceOf
1212import com.stripe.android.lpmfoundations.paymentmethod.IntegrationMetadata
1313import com.stripe.android.model.ClientAttributionMetadata
14- import com.stripe.android.model.ConfirmPaymentIntentParams
1514import com.stripe.android.model.PaymentIntentCreationFlow
1615import com.stripe.android.model.PaymentMethod
1716import com.stripe.android.model.PaymentMethodCreateParamsFixtures
1817import com.stripe.android.model.PaymentMethodFixtures
1918import com.stripe.android.model.PaymentMethodSelectionFlow
2019import com.stripe.android.model.SetupIntent
21- import com.stripe.android.model.StripeIntent
2220import com.stripe.android.paymentelement.confirmation.ConfirmationDefinition
2321import com.stripe.android.paymentelement.confirmation.ConfirmationHandler
2422import com.stripe.android.paymentelement.confirmation.PaymentMethodConfirmationOption
@@ -178,7 +176,7 @@ class CustomerSheetConfirmationInterceptorTest {
178176
179177 val interceptCall = createSetupIntentInterceptCalls.awaitItem()
180178 assertThat(interceptCall.intent).isEqualTo(setupIntent)
181- assertThat(interceptCall.confirmationOption. paymentMethod).isEqualTo(paymentMethod)
179+ assertThat(interceptCall.paymentMethod).isEqualTo(paymentMethod)
182180 }
183181
184182 @Test
@@ -351,7 +349,7 @@ class CustomerSheetConfirmationInterceptorTest {
351349 block : suspend Scenario .() -> Unit ,
352350 ) = runTest {
353351 val stripeRepository = FakeStripeRepository (paymentMethodCreationResult)
354- val setupIntentInterceptor = FakeIntentConfirmationInterceptor (setupInterceptAction)
352+ val setupIntentInterceptor = FakeCustomerSheetSetupIntentConfirmationInterceptor (setupInterceptAction)
355353 val attachPaymentMethodInterceptor = FakeCustomerSheetAttachPaymentMethodInterceptor (attachInterceptAction)
356354 val setupIntentInterceptorFactory = FakeSetupIntentInterceptorFactory (setupIntentInterceptor)
357355 val attachPaymentMethodInterceptorFactory =
@@ -387,7 +385,8 @@ class CustomerSheetConfirmationInterceptorTest {
387385 val interceptor : CustomerSheetConfirmationInterceptor ,
388386 val createSetupIntentInterceptorFactoryCalls : Turbine <FakeSetupIntentInterceptorFactory .CreateCall >,
389387 val createAttachPaymentMethodInterceptorFactoryCalls : Turbine <Unit >,
390- val createSetupIntentInterceptCalls : Turbine <FakeIntentConfirmationInterceptor .InterceptCall >,
388+ val createSetupIntentInterceptCalls :
389+ Turbine <FakeCustomerSheetSetupIntentConfirmationInterceptor .InterceptCall >,
391390 val createAttachPaymentMethodInterceptCalls :
392391 Turbine <FakeCustomerSheetAttachPaymentMethodInterceptor .InterceptCall >,
393392 )
@@ -412,53 +411,44 @@ class CustomerSheetConfirmationInterceptorTest {
412411 }
413412
414413 class InterceptCall (
415- val intent : StripeIntent ,
414+ val intent : SetupIntent ,
416415 val paymentMethod : PaymentMethod ,
417416 )
418417 }
419418
420- private class FakeIntentConfirmationInterceptor (
419+ private class FakeCustomerSheetSetupIntentConfirmationInterceptor (
421420 private val interceptAction : ConfirmationDefinition .Action <IntentConfirmationDefinition .Args >,
422- ) : IntentConfirmationInterceptor {
421+ ) : CustomerSheetSetupIntentInterceptor {
423422 val interceptCalls = Turbine <InterceptCall >()
424423
425424 override suspend fun intercept (
426- intent : StripeIntent ,
427- confirmationOption : PaymentMethodConfirmationOption .New ,
428- shippingValues : ConfirmPaymentIntentParams .Shipping ?
429- ): ConfirmationDefinition .Action <IntentConfirmationDefinition .Args > {
430- throw IllegalStateException (" Should call new payment method path in interceptor tests" )
431- }
432-
433- override suspend fun intercept (
434- intent : StripeIntent ,
435- confirmationOption : PaymentMethodConfirmationOption .Saved ,
436- shippingValues : ConfirmPaymentIntentParams .Shipping ?
425+ intent : SetupIntent ,
426+ paymentMethod : PaymentMethod ,
437427 ): ConfirmationDefinition .Action <IntentConfirmationDefinition .Args > {
438428 interceptCalls.add(
439429 InterceptCall (
440430 intent = intent,
441- confirmationOption = confirmationOption ,
431+ paymentMethod = paymentMethod ,
442432 )
443433 )
444434
445435 return interceptAction
446436 }
447437
448438 class InterceptCall (
449- val intent : StripeIntent ,
450- val confirmationOption : PaymentMethodConfirmationOption . Saved ,
439+ val intent : SetupIntent ,
440+ val paymentMethod : PaymentMethod ,
451441 )
452442 }
453443
454444 private class FakeSetupIntentInterceptorFactory (
455- private val interceptor : IntentConfirmationInterceptor
445+ private val interceptor : CustomerSheetSetupIntentInterceptor
456446 ) : CustomerSheetSetupIntentInterceptor.Factory {
457447 val createCalls = Turbine <CreateCall >()
458448
459449 override fun create (
460450 clientAttributionMetadata : ClientAttributionMetadata
461- ): IntentConfirmationInterceptor {
451+ ): CustomerSheetSetupIntentInterceptor {
462452 createCalls.add(CreateCall (clientAttributionMetadata))
463453
464454 return interceptor
0 commit comments