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..1479686c84f --- /dev/null +++ b/paymentsheet/src/main/java/com/stripe/android/checkout/ExpressCheckoutElement.kt @@ -0,0 +1,40 @@ +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 + +@CheckoutSessionPreview +@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) +class ExpressCheckoutElement internal constructor() { + + @Composable + fun Content() { + 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, + ) + } +}