Skip to content
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

Change default playground & example app layout from horizontal to automatic #4424

Merged
merged 3 commits into from
Dec 23, 2024
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 @@ -54,7 +54,6 @@ class ExampleCheckoutViewController: UIViewController {
configuration.returnURL = "payments-example://stripe-redirect"
// Set allowsDelayedPaymentMethods to true if your business can handle payment methods that complete payment after a delay, like SEPA Debit and Sofort.
configuration.allowsDelayedPaymentMethods = true
configuration.paymentMethodLayout = .horizontal
self.paymentSheet = PaymentSheet(
paymentIntentClientSecret: paymentIntentClientSecret,
configuration: configuration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class ExampleCustomCheckoutViewController: UIViewController {
configuration.customer = .init(
id: customerId, ephemeralKeySecret: customerEphemeralKeySecret)
configuration.returnURL = "payments-example://stripe-redirect"
configuration.paymentMethodLayout = .horizontal
// Set allowsDelayedPaymentMethods to true if your business can handle payment methods that complete payment after a delay, like SEPA Debit and Sofort.
configuration.allowsDelayedPaymentMethods = true
PaymentSheet.FlowController.create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ class ExampleCustomDeferredCheckoutViewController: UIViewController {
configuration.returnURL = "payments-example://stripe-redirect"
// Set allowsDelayedPaymentMethods to true if your business can handle payment methods that complete payment after a delay, like SEPA Debit and Sofort.
configuration.allowsDelayedPaymentMethods = true
configuration.paymentMethodLayout = .horizontal
DispatchQueue.main.async {
PaymentSheet.FlowController.create(
intentConfiguration: self.intentConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class MyCustomBackendModel: ObservableObject {
configuration.returnURL = "payments-example://stripe-redirect"
// Set allowsDelayedPaymentMethods to true if your business can handle payment methods that complete payment after a delay, like SEPA Debit and Sofort.
configuration.allowsDelayedPaymentMethods = true
configuration.paymentMethodLayout = .horizontal
PaymentSheet.FlowController.create(
paymentIntentClientSecret: paymentIntentClientSecret,
configuration: configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class MyBackendModel: ObservableObject {
configuration.returnURL = "payments-example://stripe-redirect"
// Set allowsDelayedPaymentMethods to true if your business can handle payment methods that complete payment after a delay, like SEPA Debit and Sofort.
configuration.allowsDelayedPaymentMethods = true
configuration.paymentMethodLayout = .horizontal
DispatchQueue.main.async {
self.paymentSheet = PaymentSheet(
paymentIntentClientSecret: paymentIntentClientSecret,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ struct PaymentSheetTestPlaygroundSettings: Codable, Equatable {
static func defaultValues() -> PaymentSheetTestPlaygroundSettings {
return PaymentSheetTestPlaygroundSettings(
uiStyle: .paymentSheet,
layout: .horizontal,
layout: .automatic,
mode: .payment,
customerKeyType: .legacy,
integrationType: .normal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class PaymentSheetLocalizationScreenshotGenerator: XCTestCase {
func testAllStrings() {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.customerMode = .new
settings.layout = .horizontal
settings.applePayEnabled = .off
settings.currency = .eur
settings.mode = .payment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ class EmbeddedUITests: PaymentSheetUITestCase {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.mode = .paymentWithSetup
settings.uiStyle = .paymentSheet
settings.layout = .horizontal
settings.customerKeyType = .legacy
settings.formSheetAction = .continue
settings.customerMode = .new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class PaymentSheet_AddressTests: XCTestCase {

func testManualAddressEntry() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.uiStyle = .flowController
settings.shippingInfo = .on

Expand Down Expand Up @@ -96,6 +97,7 @@ US

func testAddressWithDefaults() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.shippingInfo = .onWithDefaults
settings.uiStyle = .flowController

Expand Down Expand Up @@ -132,6 +134,7 @@ US

func testAddressAutoComplete_UnitedStates() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.uiStyle = .flowController
loadPlayground(
app,
Expand Down Expand Up @@ -187,6 +190,7 @@ US
/// This test ensures we don't show auto complete for an unsupported country
func testAddressAutoComplete_NewZeland() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.uiStyle = .flowController
loadPlayground(
app,
Expand Down Expand Up @@ -251,6 +255,7 @@ NZ
func testPaymentSheetFlowControllerUpdatesShipping() {

var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.applePayEnabled = .off
settings.apmsEnabled = .off
settings.linkPassthroughMode = .passthrough
Expand Down Expand Up @@ -340,6 +345,7 @@ NZ
func testManualAddressEntry_phoneCountryDoesPersist() throws {

var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.uiStyle = .flowController
loadPlayground(
app,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class PaymentSheetBillingCollectionUICardTests: PaymentSheetBillingCollectionUIT
func testCard_AllFields_flowController_WithDefaults() throws {

var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .guest
settings.uiStyle = .flowController
settings.currency = .usd
Expand Down Expand Up @@ -111,6 +112,7 @@ class PaymentSheetBillingCollectionLPMUITests: PaymentSheetBillingCollectionUITe
func testLpm_Afterpay_AutomaticFields_WithDefaultAddress() throws {

var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .guest
settings.merchantCountryCode = .US
settings.currency = .usd
Expand Down Expand Up @@ -175,6 +177,7 @@ class PaymentSheetBillingCollectionLPMUITests: PaymentSheetBillingCollectionUITe

func testLpm_Afterpay_AllFields_WithDefaults() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .guest
settings.currency = .usd
settings.merchantCountryCode = .US
Expand Down Expand Up @@ -230,6 +233,7 @@ class PaymentSheetBillingCollectionLPMUITests: PaymentSheetBillingCollectionUITe

func testLpm_Afterpay_MinimalFields_WithDefaults() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .guest
settings.currency = .usd
settings.merchantCountryCode = .US
Expand Down
Loading
Loading