From 19b03a1f05d96f4705f6bb36022ee5e9cbaa6fec Mon Sep 17 00:00:00 2001 From: amk Date: Thu, 9 Jul 2026 23:39:06 +0000 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9F=AA=BF]=20Add=20express=20checkout?= =?UTF-8?q?=20element=20API=20shell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirror the shipping address element shape so checkout integrations can configure and access express checkout consistently while implementation remains pending. Store wallet button visibility in config rather than address-specific settings. Committed-By-Agent: goose --- .../android/checkout/CheckoutController.kt | 10 +++++ .../android/checkout/CheckoutPresenter.kt | 4 ++ .../checkout/ExpressCheckoutElement.kt | 38 +++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 paymentsheet/src/main/java/com/stripe/android/checkout/ExpressCheckoutElement.kt diff --git a/paymentsheet/src/main/java/com/stripe/android/checkout/CheckoutController.kt b/paymentsheet/src/main/java/com/stripe/android/checkout/CheckoutController.kt index 9709f39849d..ba6963c234f 100644 --- a/paymentsheet/src/main/java/com/stripe/android/checkout/CheckoutController.kt +++ b/paymentsheet/src/main/java/com/stripe/android/checkout/CheckoutController.kt @@ -91,6 +91,8 @@ class CheckoutController( CurrencySelectorElement.Configuration() private var shippingAddressElementConfiguration: ShippingAddressElement.Configuration = ShippingAddressElement.Configuration() + private var expressCheckoutElementConfiguration: ExpressCheckoutElement.Configuration = + ExpressCheckoutElement.Configuration() fun adaptivePricingAllowed( adaptivePricingAllowed: Boolean @@ -116,12 +118,19 @@ class CheckoutController( this.shippingAddressElementConfiguration = configuration } + fun expressCheckoutElement( + configuration: ExpressCheckoutElement.Configuration + ): Configuration = apply { + this.expressCheckoutElementConfiguration = configuration + } + @Parcelize internal data class State( val adaptivePricingAllowed: Boolean, val paymentElementConfiguration: PaymentElement.Configuration.State, val currencySelectorElementConfiguration: CurrencySelectorElement.Configuration.State, val shippingAddressElementConfiguration: ShippingAddressElement.Configuration.State, + val expressCheckoutElementConfiguration: ExpressCheckoutElement.Configuration.State, ) : Parcelable internal fun build(): State = State( @@ -129,6 +138,7 @@ class CheckoutController( paymentElementConfiguration = paymentElementConfiguration.build(), currencySelectorElementConfiguration = currencySelectorElementConfiguration.build(), shippingAddressElementConfiguration = shippingAddressElementConfiguration.build(), + expressCheckoutElementConfiguration = expressCheckoutElementConfiguration.build(), ) } diff --git a/paymentsheet/src/main/java/com/stripe/android/checkout/CheckoutPresenter.kt b/paymentsheet/src/main/java/com/stripe/android/checkout/CheckoutPresenter.kt index 1644dcc8c94..b88a219aaf0 100644 --- a/paymentsheet/src/main/java/com/stripe/android/checkout/CheckoutPresenter.kt +++ b/paymentsheet/src/main/java/com/stripe/android/checkout/CheckoutPresenter.kt @@ -19,6 +19,10 @@ class CheckoutPresenter internal constructor() { TODO("Not yet implemented") } + fun expressCheckoutElement(): ExpressCheckoutElement { + TODO("Not yet implemented") + } + fun confirm() { TODO("Not yet implemented") } diff --git a/paymentsheet/src/main/java/com/stripe/android/checkout/ExpressCheckoutElement.kt b/paymentsheet/src/main/java/com/stripe/android/checkout/ExpressCheckoutElement.kt new file mode 100644 index 00000000000..6d67d4b9ebb --- /dev/null +++ b/paymentsheet/src/main/java/com/stripe/android/checkout/ExpressCheckoutElement.kt @@ -0,0 +1,38 @@ +package com.stripe.android.checkout + +import android.os.Parcelable +import androidx.annotation.RestrictTo +import com.stripe.android.paymentelement.CheckoutSessionPreview +import com.stripe.android.paymentsheet.PaymentSheet +import kotlinx.parcelize.Parcelize + +@CheckoutSessionPreview +@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) +class ExpressCheckoutElement internal constructor() { + + fun present() { + TODO("Not yet implemented") + } + + @CheckoutSessionPreview + @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) + class Configuration { + private var visibility: PaymentSheet.WalletButtonsConfiguration.Visibility = + PaymentSheet.WalletButtonsConfiguration.Visibility() + + fun visibility( + visibility: PaymentSheet.WalletButtonsConfiguration.Visibility + ): Configuration = apply { + this.visibility = visibility + } + + @Parcelize + internal data class State( + val visibility: PaymentSheet.WalletButtonsConfiguration.Visibility, + ) : Parcelable + + internal fun build(): State = State( + visibility = visibility, + ) + } +} From 69888dc81d55718cd47357c1d57bc7a1b7bef36d Mon Sep 17 00:00:00 2001 From: System Administrator Date: Fri, 10 Jul 2026 13:32:00 -0700 Subject: [PATCH 2/2] Replace present with Content --- .../com/stripe/android/checkout/ExpressCheckoutElement.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paymentsheet/src/main/java/com/stripe/android/checkout/ExpressCheckoutElement.kt b/paymentsheet/src/main/java/com/stripe/android/checkout/ExpressCheckoutElement.kt index 6d67d4b9ebb..1479686c84f 100644 --- a/paymentsheet/src/main/java/com/stripe/android/checkout/ExpressCheckoutElement.kt +++ b/paymentsheet/src/main/java/com/stripe/android/checkout/ExpressCheckoutElement.kt @@ -2,6 +2,7 @@ package com.stripe.android.checkout import android.os.Parcelable import androidx.annotation.RestrictTo +import androidx.compose.runtime.Composable import com.stripe.android.paymentelement.CheckoutSessionPreview import com.stripe.android.paymentsheet.PaymentSheet import kotlinx.parcelize.Parcelize @@ -10,7 +11,8 @@ import kotlinx.parcelize.Parcelize @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) class ExpressCheckoutElement internal constructor() { - fun present() { + @Composable + fun Content() { TODO("Not yet implemented") }