Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -116,19 +118,27 @@ 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(
adaptivePricingAllowed = adaptivePricingAllowed,
paymentElementConfiguration = paymentElementConfiguration.build(),
currencySelectorElementConfiguration = currencySelectorElementConfiguration.build(),
shippingAddressElementConfiguration = shippingAddressElementConfiguration.build(),
expressCheckoutElementConfiguration = expressCheckoutElementConfiguration.build(),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
Comment on lines +22 to +23

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we won't ship with this type, but I just wanted to include something in the configuration to get started with


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,
)
}
}
Loading