From 43e82dc286a498e1e53c4ae232ffc8387cb25792 Mon Sep 17 00:00:00 2001 From: "Bruno R. Nunes" <77990083+brnunes-stripe@users.noreply.github.com> Date: Tue, 11 Oct 2022 11:59:02 -0700 Subject: [PATCH] Enable Link (#5692) --- CHANGELOG.md | 6 ++++++ .../stripe/android/link/LinkPaymentLauncher.kt | 2 +- .../paymentsheet/model/PaymentSelection.kt | 15 ++++++--------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20e00ca2c00..ef00aa0e7a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## XX.XX.XX - 2022-XX-XX +## 20.15.0 - 2022-10-11 + +### PaymentSheet + +* [ADDED][5692](https://github.com/stripe/stripe-android/pull/5692) Enable Link as a payment method. + ## 20.14.1 - 2022-10-03 This release expands the `payment_method` field on ACH requests and fixes a formatting error in `CardInputWidget`, `CardMultilineWidget`, and `CardFormView`. diff --git a/link/src/main/java/com/stripe/android/link/LinkPaymentLauncher.kt b/link/src/main/java/com/stripe/android/link/LinkPaymentLauncher.kt index 9e1627515e3..c71122a550b 100644 --- a/link/src/main/java/com/stripe/android/link/LinkPaymentLauncher.kt +++ b/link/src/main/java/com/stripe/android/link/LinkPaymentLauncher.kt @@ -203,7 +203,7 @@ class LinkPaymentLauncher @Inject internal constructor( @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) companion object { - val LINK_ENABLED = BuildConfig.DEBUG + const val LINK_ENABLED = true val supportedFundingSources = SupportedPaymentMethod.allTypes } } diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/model/PaymentSelection.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/model/PaymentSelection.kt index bbdb3977fd7..af703319d96 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/model/PaymentSelection.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/model/PaymentSelection.kt @@ -8,8 +8,7 @@ import com.stripe.android.model.CardBrand import com.stripe.android.model.ConsumerPaymentDetails import com.stripe.android.model.PaymentMethod import com.stripe.android.model.PaymentMethodCreateParams -import com.stripe.android.paymentsheet.paymentdatacollection.ach.TransformToBankIcon -import com.stripe.android.paymentsheet.ui.getCardBrandIcon +import com.stripe.android.paymentsheet.R import kotlinx.parcelize.IgnoredOnParcel import kotlinx.parcelize.Parcelize @@ -84,16 +83,14 @@ sealed class PaymentSelection : Parcelable { @IgnoredOnParcel @DrawableRes - val iconResource = when (paymentDetails) { - is ConsumerPaymentDetails.Card -> paymentDetails.brand.getCardBrandIcon() - is ConsumerPaymentDetails.BankAccount -> - TransformToBankIcon(paymentDetails.bankName) - } + val iconResource = R.drawable.stripe_ic_paymentsheet_link @IgnoredOnParcel val label = when (paymentDetails) { - is ConsumerPaymentDetails.Card -> paymentDetails.last4 - is ConsumerPaymentDetails.BankAccount -> paymentDetails.last4 + is ConsumerPaymentDetails.Card -> + "····${paymentDetails.last4}" + is ConsumerPaymentDetails.BankAccount -> + "····${paymentDetails.last4}" } }