From 21dcf071f94cd68a256dd2bb7e283897b7e5dd06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 05:14:28 +0000 Subject: [PATCH 1/2] Bump ktlint from 0.41.0 to 0.42.1 Bumps [ktlint](https://github.com/pinterest/ktlint) from 0.41.0 to 0.42.1. - [Release notes](https://github.com/pinterest/ktlint/releases) - [Changelog](https://github.com/pinterest/ktlint/blob/master/CHANGELOG.md) - [Commits](https://github.com/pinterest/ktlint/compare/0.41.0...0.42.1) --- updated-dependencies: - dependency-name: com.pinterest:ktlint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' From ee61c691d28efecd760fe7bd6d083b62d330de3c Mon Sep 17 00:00:00 2001 From: Michelle Brubaker Date: Mon, 9 Aug 2021 10:53:59 -0400 Subject: [PATCH 2/2] Fix formatting. --- .../DefaultFlowControllerInitializer.kt | 18 +++++++++--------- .../stripe/android/PaymentSessionFixtures.kt | 9 --------- .../view/AddPaymentMethodCardViewTest.kt | 2 +- 3 files changed, 10 insertions(+), 19 deletions(-) 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