Skip to content

Commit

Permalink
Merge branch 'master' into joyceqin-MOBILESDK-2880
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceqin-stripe authored Dec 23, 2024
2 parents 67891b7 + 11105e3 commit c99e2ad
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 25 deletions.
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 Expand Up @@ -542,7 +542,7 @@ struct PaymentSheetTestPlaygroundSettings: Codable, Equatable {
collectEmail: .automatic,
collectPhone: .automatic,
collectAddress: .automatic,
formSheetAction: .confirm,
formSheetAction: .continue,
embeddedViewDisplaysMandateText: .on,
cardBrandAcceptance: .all,
allowsSetAsDefaultPM: .off)
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 @@ -230,6 +230,7 @@ class EmbeddedUITests: PaymentSheetUITestCase {
settings.mode = .paymentWithSetup
settings.uiStyle = .embedded
settings.integrationType = .deferred_csc
settings.formSheetAction = .confirm
settings.customerKeyType = .legacy
settings.customerMode = .new
settings.merchantCountryCode = .FR
Expand Down Expand Up @@ -528,6 +529,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

0 comments on commit c99e2ad

Please sign in to comment.