Skip to content

Remove ExperimentalEmbeddedPaymentElementApi. #10705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
@@ -1,5 +1,3 @@
@file:OptIn(ExperimentalEmbeddedPaymentElementApi::class)

package com.stripe.android.paymentsheet.example.playground

import android.content.Intent
Expand Down Expand Up @@ -36,7 +34,6 @@ import com.stripe.android.paymentelement.ConfirmCustomPaymentMethodCallback
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalAnalyticEventCallbackApi
import com.stripe.android.paymentelement.ExperimentalCustomPaymentMethodsApi
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentelement.WalletButtonsPreview
import com.stripe.android.paymentelement.rememberEmbeddedPaymentElement
import com.stripe.android.paymentsheet.ExperimentalCustomerSessionApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import com.stripe.android.model.PaymentMethod
import com.stripe.android.paymentelement.AnalyticEvent
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalAnalyticEventCallbackApi
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentelement.ShippingDetailsInPaymentOptionPreview
import com.stripe.android.paymentsheet.CreateIntentResult
import com.stripe.android.paymentsheet.DelicatePaymentSheetApi
Expand Down Expand Up @@ -58,7 +57,7 @@ import kotlinx.coroutines.withContext
import kotlinx.serialization.json.Json
import java.io.IOException

@OptIn(ExperimentalCustomerSessionApi::class, ExperimentalEmbeddedPaymentElementApi::class)
@OptIn(ExperimentalCustomerSessionApi::class)
internal class PaymentSheetPlaygroundViewModel(
application: Application,
private val savedStateHandle: SavedStateHandle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import android.os.Parcelable
import androidx.compose.runtime.Stable
import com.stripe.android.customersheet.CustomerSheet
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentelement.PaymentMethodOptionsSetupFutureUsagePreview
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.playground.model.CheckoutResponse
Expand Down Expand Up @@ -98,7 +97,6 @@ internal sealed interface PlaygroundState : Parcelable {
return snapshot.paymentSheetConfiguration(this)
}

@OptIn(ExperimentalEmbeddedPaymentElementApi::class)
fun embeddedConfiguration(): EmbeddedPaymentElement.Configuration {
return snapshot.embeddedConfiguration(this)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import com.stripe.android.paymentelement.ConfirmCustomPaymentMethodCallback
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalAnalyticEventCallbackApi
import com.stripe.android.paymentelement.ExperimentalCustomPaymentMethodsApi
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentelement.WalletButtonsPreview
import com.stripe.android.paymentelement.rememberEmbeddedPaymentElement
import com.stripe.android.paymentsheet.CreateIntentResult
Expand All @@ -60,7 +59,6 @@ import com.stripe.android.paymentsheet.example.samples.ui.shared.PaymentMethodSe
import kotlinx.coroutines.launch

@OptIn(
ExperimentalEmbeddedPaymentElementApi::class,
ExperimentalCustomPaymentMethodsApi::class,
ExperimentalAnalyticEventCallbackApi::class,
WalletButtonsPreview::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import androidx.activity.result.contract.ActivityResultContract
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.example.playground.PlaygroundState

@OptIn(ExperimentalEmbeddedPaymentElementApi::class)
internal class EmbeddedPlaygroundOneStepContract : ActivityResultContract<PlaygroundState.Payment, Boolean>() {
override fun createIntent(context: Context, input: PlaygroundState.Payment): Intent {
return EmbeddedPlaygroundActivity.create(context, input)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import android.content.Intent
import android.os.Parcelable
import androidx.activity.result.contract.ActivityResultContract
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.example.playground.PlaygroundState
import kotlinx.parcelize.Parcelize

@OptIn(ExperimentalEmbeddedPaymentElementApi::class)
internal class EmbeddedPlaygroundTwoStepContract :
ActivityResultContract<EmbeddedPlaygroundTwoStepContract.Args, EmbeddedPlaygroundTwoStepContract.Result>() {
override fun createIntent(context: Context, input: Args): Intent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.stripe.android.paymentsheet.example.playground.settings
import com.stripe.android.ExperimentalAllowsRemovalOfLastSavedPaymentMethodApi
import com.stripe.android.customersheet.CustomerSheet
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.playground.PlaygroundState

Expand All @@ -22,7 +21,6 @@ internal object AllowsRemovalOfLastSavedPaymentMethodSettingsDefinition : Boolea
configurationBuilder.allowsRemovalOfLastSavedPaymentMethod(value)
}

@ExperimentalEmbeddedPaymentElementApi
@OptIn(ExperimentalAllowsRemovalOfLastSavedPaymentMethodApi::class)
override fun configure(
value: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.customersheet.CustomerSheet
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.playground.PlaygroundState
import com.stripe.android.paymentsheet.example.playground.activity.AppearanceStore
Expand All @@ -19,7 +18,6 @@ internal object AppearanceSettingsDefinition : PlaygroundSettingDefinition<Unit>
configurationBuilder.appearance(AppearanceStore.state)
}

@ExperimentalEmbeddedPaymentElementApi
override fun configure(
value: Unit,
configurationBuilder: EmbeddedPaymentElement.Configuration.Builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.customersheet.CustomerSheet
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.playground.PlaygroundState

Expand All @@ -20,7 +19,6 @@ internal object AttachBillingDetailsToPaymentMethodSettingsDefinition : BooleanS
configurationData.updateBillingDetails { copy(attachDefaultsToPaymentMethod = value) }
}

@ExperimentalEmbeddedPaymentElementApi
override fun configure(
value: Boolean,
configurationBuilder: EmbeddedPaymentElement.Configuration.Builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.customersheet.CustomerSheet
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.playground.PlaygroundState

Expand Down Expand Up @@ -32,7 +31,6 @@ internal object CardBrandAcceptanceSettingsDefinition :
configurationBuilder.cardBrandAcceptance(value.cardBrandAcceptance)
}

@ExperimentalEmbeddedPaymentElementApi
override fun configure(
value: CardBrandAcceptanceType,
configurationBuilder: EmbeddedPaymentElement.Configuration.Builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.customersheet.CustomerSheet
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.playground.PlaygroundState
import com.stripe.android.paymentsheet.PaymentSheet.BillingDetailsCollectionConfiguration.AddressCollectionMode as CollectionMode
Expand Down Expand Up @@ -33,7 +32,6 @@ internal object CollectAddressSettingsDefinition :
configurationData.updateBillingDetails { copy(address = value) }
}

@ExperimentalEmbeddedPaymentElementApi
override fun configure(
value: CollectionMode,
configurationBuilder: EmbeddedPaymentElement.Configuration.Builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.customersheet.CustomerSheet
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode
import com.stripe.android.paymentsheet.example.playground.PlaygroundState
Expand All @@ -20,7 +19,6 @@ internal object CollectEmailSettingsDefinition : CollectionModeSettingsDefinitio
configurationData.updateBillingDetails { copy(email = value) }
}

@ExperimentalEmbeddedPaymentElementApi
override fun configure(
value: CollectionMode,
configurationBuilder: EmbeddedPaymentElement.Configuration.Builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.customersheet.CustomerSheet
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode
import com.stripe.android.paymentsheet.example.playground.PlaygroundState
Expand All @@ -20,7 +19,6 @@ internal object CollectNameSettingsDefinition : CollectionModeSettingsDefinition
configurationData.updateBillingDetails { copy(name = value) }
}

@ExperimentalEmbeddedPaymentElementApi
override fun configure(
value: CollectionMode,
configurationBuilder: EmbeddedPaymentElement.Configuration.Builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.customersheet.CustomerSheet
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode
import com.stripe.android.paymentsheet.example.playground.PlaygroundState
Expand All @@ -20,7 +19,6 @@ internal object CollectPhoneSettingsDefinition : CollectionModeSettingsDefinitio
configurationData.updateBillingDetails { copy(phone = value) }
}

@ExperimentalEmbeddedPaymentElementApi
override fun configure(
value: CollectionMode,
configurationBuilder: EmbeddedPaymentElement.Configuration.Builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalCustomPaymentMethodsApi
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.playground.PlaygroundState

@OptIn(ExperimentalEmbeddedPaymentElementApi::class, ExperimentalCustomPaymentMethodsApi::class)
@OptIn(ExperimentalCustomPaymentMethodsApi::class)
internal object CustomPaymentMethodsSettingDefinition :
PlaygroundSettingDefinition<CustomPaymentMethodPlaygroundType>,
PlaygroundSettingDefinition.Saveable<CustomPaymentMethodPlaygroundType> by EnumSaveable(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.playground.PlaygroundState
import com.stripe.android.paymentsheet.example.playground.model.CheckoutRequest
Expand Down Expand Up @@ -51,7 +50,6 @@ internal object CustomerSettingsDefinition :
configurationBuilder.customer(playgroundState.customerConfig)
}

@ExperimentalEmbeddedPaymentElementApi
override fun configure(
value: CustomerType,
configurationBuilder: EmbeddedPaymentElement.Configuration.Builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.customersheet.CustomerSheet
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.playground.PlaygroundState
import java.util.UUID
Expand Down Expand Up @@ -38,7 +37,6 @@ internal object DefaultBillingAddressSettingsDefinition :
}
}

@ExperimentalEmbeddedPaymentElementApi
override fun configure(
value: DefaultBillingAddress,
configurationBuilder: EmbeddedPaymentElement.Configuration.Builder,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.playground.PlaygroundState

Expand All @@ -23,7 +22,6 @@ internal object DelayedPaymentMethodsSettingsDefinition : BooleanSettingsDefinit
configurationBuilder.allowsDelayedPaymentMethods(value)
}

@ExperimentalEmbeddedPaymentElementApi
override fun configure(
value: Boolean,
configurationBuilder: EmbeddedPaymentElement.Configuration.Builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ import android.os.Parcelable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import com.stripe.android.paymentelement.AppearanceAPIAdditionsPreview
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.playground.activity.AppearanceStore
import kotlinx.parcelize.Parcelize
import kotlinx.serialization.Serializable
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json

internal object EmbeddedAppearanceSettingsDefinition :
Expand All @@ -29,7 +27,7 @@ internal object EmbeddedAppearanceSettingsDefinition :
return Json.encodeToString(value)
}

@OptIn(ExperimentalEmbeddedPaymentElementApi::class, AppearanceAPIAdditionsPreview::class)
@OptIn(AppearanceAPIAdditionsPreview::class)
override fun setValue(value: EmbeddedAppearance) {
super.setValue(value)
AppearanceStore.state = AppearanceStore.state.copy(
Expand All @@ -44,7 +42,6 @@ internal enum class EmbeddedRow {
FloatingButton
}

@OptIn(ExperimentalEmbeddedPaymentElementApi::class)
@Serializable
@Parcelize
internal data class EmbeddedAppearance(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.example.playground.PlaygroundState

@OptIn(ExperimentalEmbeddedPaymentElementApi::class)
internal object EmbeddedFormSheetActionSettingDefinition :
PlaygroundSettingDefinition<
EmbeddedFormSheetActionSettingDefinition.FormSheetAction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ package com.stripe.android.paymentsheet.example.playground.settings

import android.util.Log
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.example.playground.PlaygroundState

@OptIn(ExperimentalEmbeddedPaymentElementApi::class)
internal object EmbeddedRowSelectionBehaviorSettingsDefinition :
PlaygroundSettingDefinition<
EmbeddedRowSelectionBehaviorSettingsDefinition.RowSelectionBehavior
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.example.playground.PlaygroundState

@OptIn(ExperimentalEmbeddedPaymentElementApi::class)
internal object EmbeddedViewDisplaysMandateSettingDefinition : BooleanSettingsDefinition(
key = "embeddedViewDisplaysMandate",
displayName = "Embedded View Displays Mandate",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.playground.PlaygroundState

Expand Down Expand Up @@ -49,7 +48,6 @@ internal object ExternalPaymentMethodSettingsDefinition :
}
}

@ExperimentalEmbeddedPaymentElementApi
override fun configure(
value: ExternalPaymentMethodType,
configurationBuilder: EmbeddedPaymentElement.Configuration.Builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.customersheet.CustomerSheet
import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.playground.PlaygroundState

Expand All @@ -28,7 +27,6 @@ internal object GooglePaySettingsDefinition : BooleanSettingsDefinition(
}
}

@ExperimentalEmbeddedPaymentElementApi
override fun configure(
value: Boolean,
configurationBuilder: EmbeddedPaymentElement.Configuration.Builder,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.stripe.android.paymentsheet.example.playground.settings

import com.stripe.android.paymentelement.EmbeddedPaymentElement
import com.stripe.android.paymentelement.ExperimentalEmbeddedPaymentElementApi
import com.stripe.android.paymentsheet.PaymentSheet
import com.stripe.android.paymentsheet.example.playground.PlaygroundState
import com.stripe.android.paymentsheet.example.playground.model.CheckoutRequest
Expand Down Expand Up @@ -33,7 +32,6 @@ internal object LinkSettingsDefinition : BooleanSettingsDefinition(
)
}

@OptIn(ExperimentalEmbeddedPaymentElementApi::class)
override fun configure(
value: Boolean,
configurationBuilder: EmbeddedPaymentElement.Configuration.Builder,
Expand Down
Loading
Loading