Skip to content

Commit ef16234

Browse files
Expose embedded state and FormSheetAction.
1 parent b8d855f commit ef16234

3 files changed

Lines changed: 24 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## XX.XX.XX - 20XX-XX-XX
44

5+
### PaymentSheet
6+
* [ADDED][10720](https://github.com/stripe/stripe-android/pull/10720) `EmbeddedPaymentElement` now supports customizing `FormSheetAction` and a 2 step flow (similar to `PaymentSheet.FlowController`).
7+
58
## 21.11.1 - 2025-04-22
69

710
### PaymentSheet

paymentsheet/api/paymentsheet.api

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,8 @@ public final class com/stripe/android/paymentelement/EmbeddedPaymentElement {
588588
public final fun configure (Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration;Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$Configuration;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
589589
public final fun confirm ()V
590590
public final fun getPaymentOption ()Lkotlinx/coroutines/flow/StateFlow;
591+
public final fun getState ()Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$State;
592+
public final fun setState (Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$State;)V
591593
}
592594

593595
public final class com/stripe/android/paymentelement/EmbeddedPaymentElement$Builder {
@@ -620,6 +622,7 @@ public final class com/stripe/android/paymentelement/EmbeddedPaymentElement$Conf
620622
public final fun defaultBillingDetails (Lcom/stripe/android/paymentsheet/PaymentSheet$BillingDetails;)Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$Configuration$Builder;
621623
public final fun embeddedViewDisplaysMandateText (Z)Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$Configuration$Builder;
622624
public final fun externalPaymentMethods (Ljava/util/List;)Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$Configuration$Builder;
625+
public final fun formSheetAction (Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$FormSheetAction;)Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$Configuration$Builder;
623626
public final fun googlePay (Lcom/stripe/android/paymentsheet/PaymentSheet$GooglePayConfiguration;)Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$Configuration$Builder;
624627
public final fun link (Lcom/stripe/android/paymentsheet/PaymentSheet$LinkConfiguration;)Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$Configuration$Builder;
625628
public final fun paymentMethodOrder (Ljava/util/List;)Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$Configuration$Builder;
@@ -651,6 +654,14 @@ public final class com/stripe/android/paymentelement/EmbeddedPaymentElement$Conf
651654
public static final field $stable I
652655
}
653656

657+
public final class com/stripe/android/paymentelement/EmbeddedPaymentElement$FormSheetAction : java/lang/Enum {
658+
public static final field Confirm Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$FormSheetAction;
659+
public static final field Continue Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$FormSheetAction;
660+
public static fun getEntries ()Lkotlin/enums/EnumEntries;
661+
public static fun valueOf (Ljava/lang/String;)Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$FormSheetAction;
662+
public static fun values ()[Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$FormSheetAction;
663+
}
664+
654665
public final class com/stripe/android/paymentelement/EmbeddedPaymentElement$PaymentOptionDisplayData {
655666
public static final field $stable I
656667
public fun equals (Ljava/lang/Object;)Z
@@ -686,6 +697,16 @@ public abstract interface class com/stripe/android/paymentelement/EmbeddedPaymen
686697
public abstract fun onResult (Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$Result;)V
687698
}
688699

700+
public final class com/stripe/android/paymentelement/EmbeddedPaymentElement$State : android/os/Parcelable {
701+
public static final field $stable I
702+
public static final field CREATOR Landroid/os/Parcelable$Creator;
703+
public final fun describeContents ()I
704+
public fun equals (Ljava/lang/Object;)Z
705+
public fun hashCode ()I
706+
public fun toString ()Ljava/lang/String;
707+
public final fun writeToParcel (Landroid/os/Parcel;I)V
708+
}
709+
689710
public final class com/stripe/android/paymentelement/EmbeddedPaymentElement$State$Creator : android/os/Parcelable$Creator {
690711
public fun <init> ()V
691712
public final fun createFromParcel (Landroid/os/Parcel;)Lcom/stripe/android/paymentelement/EmbeddedPaymentElement$State;

paymentsheet/src/main/java/com/stripe/android/paymentelement/EmbeddedPaymentElement.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ class EmbeddedPaymentElement @Inject internal constructor(
6262
*
6363
* Use this to instantly configure an [EmbeddedPaymentElement], likely from the state of another Activity.
6464
*/
65-
@get:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
66-
@set:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
6765
var state: State? by stateHelper::state
6866

6967
/**
@@ -411,7 +409,6 @@ class EmbeddedPaymentElement @Inject internal constructor(
411409
* their payment method details. The sheet has a button at the bottom. [formSheetAction] controls the action
412410
* the button performs.
413411
*/
414-
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
415412
fun formSheetAction(formSheetAction: FormSheetAction): Builder = apply {
416413
this.formSheetAction = formSheetAction
417414
}
@@ -446,7 +443,6 @@ class EmbeddedPaymentElement @Inject internal constructor(
446443
* can perform.
447444
*/
448445
@ExperimentalEmbeddedPaymentElementApi
449-
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
450446
enum class FormSheetAction {
451447

452448
/**
@@ -571,7 +567,6 @@ class EmbeddedPaymentElement @Inject internal constructor(
571567
/**
572568
* A [Parcelable] state used to reconfigure [EmbeddedPaymentElement] across activity boundaries.
573569
*/
574-
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
575570
@ExperimentalEmbeddedPaymentElementApi
576571
@Poko
577572
@Parcelize

0 commit comments

Comments
 (0)