-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement `payment_method_remove_last` for `PaymentSheet` * Add tests for `payment_method_remove_last`
- Loading branch information
1 parent
046fe32
commit b77bce8
Showing
21 changed files
with
600 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...d/paymentsheet/example/playground/settings/CustomerSessionRemoveLastSettingsDefinition.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.stripe.android.paymentsheet.example.playground.settings | ||
|
||
import com.stripe.android.paymentsheet.example.playground.model.CheckoutRequest | ||
import com.stripe.android.paymentsheet.example.playground.model.FeatureState | ||
|
||
internal object CustomerSessionRemoveLastSettingsDefinition : BooleanSettingsDefinition( | ||
defaultValue = true, | ||
displayName = "Customer Session Remove Last Payment Method", | ||
key = "customer_session_payment_method_remove" | ||
) { | ||
override fun createOptions( | ||
configurationData: PlaygroundConfigurationData | ||
) = listOf( | ||
PlaygroundSettingDefinition.Displayable.Option("Enabled", true), | ||
PlaygroundSettingDefinition.Displayable.Option("Disabled", false), | ||
) | ||
|
||
override fun configure(value: Boolean, checkoutRequestBuilder: CheckoutRequest.Builder) { | ||
if (value) { | ||
checkoutRequestBuilder.paymentMethodRemoveLastFeature(FeatureState.Enabled) | ||
} else { | ||
checkoutRequestBuilder.paymentMethodRemoveLastFeature(FeatureState.Disabled) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.