diff --git a/build.gradle b/build.gradle index 64f30ac849a..a1890abd448 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,7 @@ ext { kotlinCoroutinesVersion = '1.5.1' composeVersion = '1.0.1' espressoVersion = '3.4.0' - ktlintVersion = '0.41.0' + ktlintVersion = '0.42.1' materialVersion = '1.4.0' daggerVersion = '2.38.1' diff --git a/payments-core/src/main/java/com/stripe/android/paymentsheet/flowcontroller/DefaultFlowControllerInitializer.kt b/payments-core/src/main/java/com/stripe/android/paymentsheet/flowcontroller/DefaultFlowControllerInitializer.kt index 3ffa7933c76..c470ca011e3 100644 --- a/payments-core/src/main/java/com/stripe/android/paymentsheet/flowcontroller/DefaultFlowControllerInitializer.kt +++ b/payments-core/src/main/java/com/stripe/android/paymentsheet/flowcontroller/DefaultFlowControllerInitializer.kt @@ -62,15 +62,15 @@ internal class DefaultFlowControllerInitializer @Inject constructor( ): Boolean { return clientSecret is PaymentIntentClientSecret && paymentSheetConfiguration?.googlePay?.environment?.let { environment -> - googlePayRepositoryFactory( - when (environment) { - PaymentSheet.GooglePayConfiguration.Environment.Production -> - GooglePayEnvironment.Production - PaymentSheet.GooglePayConfiguration.Environment.Test -> - GooglePayEnvironment.Test - } - ) - }?.isReady()?.first() ?: false + googlePayRepositoryFactory( + when (environment) { + PaymentSheet.GooglePayConfiguration.Environment.Production -> + GooglePayEnvironment.Production + PaymentSheet.GooglePayConfiguration.Environment.Test -> + GooglePayEnvironment.Test + } + ) + }?.isReady()?.first() ?: false } private suspend fun createWithCustomer( diff --git a/payments-core/src/test/java/com/stripe/android/PaymentSessionFixtures.kt b/payments-core/src/test/java/com/stripe/android/PaymentSessionFixtures.kt index df234bfd3d2..64ccc19878f 100644 --- a/payments-core/src/test/java/com/stripe/android/PaymentSessionFixtures.kt +++ b/payments-core/src/test/java/com/stripe/android/PaymentSessionFixtures.kt @@ -10,17 +10,14 @@ import com.stripe.android.view.ShippingInfoWidget internal object PaymentSessionFixtures { internal val CONFIG = PaymentSessionConfig.Builder() - // hide the phone field on the shipping information form .setHiddenShippingInfoFields( ShippingInfoWidget.CustomizableShippingField.Line2 ) - // make the address line 2 field optional .setOptionalShippingInfoFields( ShippingInfoWidget.CustomizableShippingField.Phone ) - // specify an address to pre-populate the shipping information form .setPrepopulatedShippingInfo( ShippingInformation( @@ -35,30 +32,24 @@ internal object PaymentSessionFixtures { "4158675309" ) ) - // collect shipping information .setShippingInfoRequired(true) - // collect shipping method .setShippingMethodsRequired(true) - // specify the payment method types that the customer can use; // defaults to PaymentMethod.Type.Card .setPaymentMethodTypes( listOf(PaymentMethod.Type.Card) ) - // only allowed US and Canada shipping addresses .setAllowedShippingCountryCodes( setOf("US", "CA") ) .setBillingAddressFields(BillingAddressFields.Full) .setShouldPrefetchCustomer(true) - // Enable PaymentMethod Deletion from PaymentMethodActivity // This is default behavior .setCanDeletePaymentMethods(true) - .setShippingInformationValidator(FakeShippingInformationValidator()) .setShippingMethodsFactory(FakeShippingMethodsFactory()) .build() diff --git a/payments-core/src/test/java/com/stripe/android/view/AddPaymentMethodCardViewTest.kt b/payments-core/src/test/java/com/stripe/android/view/AddPaymentMethodCardViewTest.kt index fb03b0c5d71..c5c251cdd51 100644 --- a/payments-core/src/test/java/com/stripe/android/view/AddPaymentMethodCardViewTest.kt +++ b/payments-core/src/test/java/com/stripe/android/view/AddPaymentMethodCardViewTest.kt @@ -4,8 +4,8 @@ import android.view.inputmethod.EditorInfo import com.stripe.android.model.PaymentMethodCreateParams import com.stripe.android.model.PaymentMethodCreateParamsFixtures import org.junit.runner.RunWith -import org.mockito.Mockito.`when` import org.mockito.Mockito.verify +import org.mockito.Mockito.`when` import org.mockito.kotlin.mock import org.robolectric.RobolectricTestRunner import kotlin.test.Test