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

Porter/test only dead #4082

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
69d1d70
deleted basic integration api and everything else that prevented build
joyceqin-stripe Sep 27, 2024
bde2343
ui examples builds
joyceqin-stripe Sep 27, 2024
7c993dc
tests build
joyceqin-stripe Sep 27, 2024
53e6373
new .periphery.yml
joyceqin-stripe Sep 27, 2024
9d17fd8
modified .periphery
joyceqin-stripe Sep 27, 2024
8c6ad95
Merge branch 'master' into joyceqin-bideprecation
joyceqin-stripe Sep 30, 2024
46c0b5e
Trigger Build
joyceqin-stripe Sep 30, 2024
bd357ff
Merge branch 'joyceqin-bideprecation' of github.com:stripe/stripe-ios…
joyceqin-stripe Sep 30, 2024
fe4f118
Update .periphery.yml
joyceqin-stripe Sep 30, 2024
d3b3abc
no changes .periphery
joyceqin-stripe Sep 30, 2024
105364d
merge conflict
joyceqin-stripe Sep 30, 2024
6b57a59
periphery detected dead code
joyceqin-stripe Sep 30, 2024
12ff783
Merge branch 'master' into joyceqin-bideprecation
joyceqin-stripe Sep 30, 2024
72c37fa
Merge branch 'master' into joyceqin-bideprecation
joyceqin-stripe Sep 30, 2024
8dc7b16
retain public false
joyceqin-stripe Sep 30, 2024
ed7373f
periphery invalid keys
joyceqin-stripe Sep 30, 2024
edc1956
Merge branch 'master' into joyceqin-bideprecation
porter-stripe Oct 1, 2024
f53ee19
new localized strings
joyceqin-stripe Oct 1, 2024
e4a473f
Merge branch 'joyceqin-bideprecation' of github.com:stripe/stripe-ios…
joyceqin-stripe Oct 1, 2024
41b6d1a
checkout Package.resolved from master
joyceqin-stripe Oct 1, 2024
d062fed
try different schemes .periphery.yml
joyceqin-stripe Oct 1, 2024
bf37ac7
try removing schemes .periphery.yml
joyceqin-stripe Oct 1, 2024
9a65240
added schemes .periphery.yml
joyceqin-stripe Oct 1, 2024
c234ec7
removed periphery detected dead code aside from some declared public
joyceqin-stripe Oct 1, 2024
cde2866
Merge branch 'joyceqin-bideprecation' of github.com:stripe/stripe-ios…
joyceqin-stripe Oct 1, 2024
0b9fb41
Merge branch 'master' into joyceqin-bideprecation
joyceqin-stripe Oct 1, 2024
a91e9a5
removed some detected dead code
joyceqin-stripe Oct 1, 2024
f2d1cf6
trigger build?
joyceqin-stripe Oct 1, 2024
66cf416
remove customerID from STPEphermeralKey
joyceqin-stripe Oct 1, 2024
56262f8
try this
porter-stripe Oct 1, 2024
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
74 changes: 3 additions & 71 deletions .periphery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,98 +6,30 @@
workspace: Stripe.xcworkspace

schemes:
- AllStripeFrameworks
# - IntegrationTester
# - Stripe3DS2
# - Stripe3DS2DemoUI
# - StripeApplePay
# - StripeCameraCore
# - StripeCardScan
- StripeConnect
# - StripeCore
# - StripeFinancialConnections
# - StripeIdentity
# - StripePaymentSheet
# - StripePayments
# - StripePaymentsUI
# - StripeUICore
# - StripeiOS
# - PaymentSheet Example
# - AppClipExample
# - CardImageVerification Example
# - FinancialConnections Example
# - IdentityVerification Example
# - StripeConnect Example
# - Non-Card Payment Examples
# - UI Examples
- AllStripeFrameworks-DeadCodeDetection

targets:
# - AppClipExample
# - AppClipExampleClip
# - AppClipExampleClipTests
# - AppClipExampleClipUITests
# - AppClipExampleTests iOS
# - CardImageVerification Example
# - CardImageVerification ExampleUITests
# - Common
# - FinancialConnections Example
# - FinancialConnectionsUITests
# - IdentityVerification Example
# - IntegrationTester
# - IntegrationTesterUITests
# - Non-Card Payment Examples
# - PaymentSheet Example
# - PaymentSheetLocalizationScreenshotGenerator
# - PaymentSheetUITest
- Stripe3DS2
# - Stripe3DS2Tests
- StripeApplePay
# - StripeApplePayTests
- StripeCameraCore
# - StripeCameraCoreTestUtils
# - StripeCameraCoreTests
- StripeCardScan
# - StripeCardScanTests
- StripeConnect
# - StripeConnect Example
# - StripeConnect ExampleUITests
# - StripeConnectTests
- StripeCore
# - StripeCoreTestUtils
# - StripeCoreTests
- StripeFinancialConnections
# - StripeFinancialConnectionsTests
- StripeIdentity
# - StripeIdentityTests
- StripePaymentSheet
# - StripePaymentSheetTestHostApp
# - StripePaymentSheetTests
- StripePayments
# - StripePaymentsObjcTestUtils
# - StripePaymentsTestHostApp
# - StripePaymentsTestUtils
# - StripePaymentsTests
- StripePaymentsUI
# - StripePaymentsUITests
- StripeUICore
# - StripeUICoreTests
- StripeiOS
# - StripeiOSAppHostedTests
# - StripeiOSTestHostApp
# - StripeiOSTests
# - UI Examples

retain_public: true
retain_public: false
retain_objc_accessible: false
retain_objc_annotated: true
retain_objc_protocols: true

retain_ibaction: true
retain_iboutlet: true
retain_ibinspectable: true
verbose: true

build_arguments:
- -destination
- 'generic/platform=iOS Simulator'


Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<key>isShown</key>
<true/>
<key>orderHint</key>
<integer>3</integer>
<integer>0</integer>
</dict>
<key>AppClipExampleClip.xcscheme_^#shared#^_</key>
<dict>
<key>isShown</key>
<true/>
<key>orderHint</key>
<integer>4</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>isShown</key>
<true/>
<key>orderHint</key>
<integer>6</integer>
<integer>2</integer>
</dict>
</dict>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>isShown</key>
<true/>
<key>orderHint</key>
<integer>7</integer>
<integer>3</integer>
</dict>
</dict>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>isShown</key>
<true/>
<key>orderHint</key>
<integer>8</integer>
<integer>4</integer>
</dict>
</dict>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>isShown</key>
<true/>
<key>orderHint</key>
<integer>10</integer>
<integer>6</integer>
</dict>
</dict>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>isShown</key>
<true/>
<key>orderHint</key>
<integer>11</integer>
<integer>7</integer>
</dict>
</dict>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>isShown</key>
<true/>
<key>orderHint</key>
<integer>26</integer>
<integer>22</integer>
</dict>
</dict>
</dict>
Expand Down
153 changes: 2 additions & 151 deletions Example/UI Examples/UI Examples/Source/BrowseViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@ import UIKit
@testable import Stripe
@_spi(STP) import StripePaymentsUI

class BrowseViewController: UITableViewController, STPAddCardViewControllerDelegate,
STPPaymentOptionsViewControllerDelegate, STPShippingAddressViewControllerDelegate
class BrowseViewController: UITableViewController
{

enum Demo: Int {
static var count: Int = 11
static var count: Int = 8

case STPPaymentCardTextField
case STPPaymentCardTextFieldWithCBC
case STPPaymentOptionsViewController
case STPPaymentOptionsFPXViewController
case STPShippingInfoViewController
case STPAUBECSFormViewController
case STPCardFormViewController
case STPCardFormViewControllerCBC
Expand All @@ -36,9 +32,6 @@ class BrowseViewController: UITableViewController, STPAddCardViewControllerDeleg
switch self {
case .STPPaymentCardTextField: return "Card Field"
case .STPPaymentCardTextFieldWithCBC: return "Card Field (CBC)"
case .STPPaymentOptionsViewController: return "Payment Option Picker"
case .STPPaymentOptionsFPXViewController: return "Payment Option Picker (With FPX)"
case .STPShippingInfoViewController: return "Shipping Info Form"
case .STPAUBECSFormViewController: return "AU BECS Form"
case .STPCardFormViewController: return "Card Form"
case .STPCardFormViewControllerCBC: return "Card Form (CBC)"
Expand All @@ -52,9 +45,6 @@ class BrowseViewController: UITableViewController, STPAddCardViewControllerDeleg
switch self {
case .STPPaymentCardTextField: return "STPPaymentCardTextField"
case .STPPaymentCardTextFieldWithCBC: return "STPPaymentCardTextField"
case .STPPaymentOptionsViewController: return "STPPaymentOptionsViewController"
case .STPPaymentOptionsFPXViewController: return "STPPaymentOptionsViewController"
case .STPShippingInfoViewController: return "STPShippingInfoViewController"
case .STPAUBECSFormViewController: return "STPAUBECSFormViewController"
case .STPCardFormViewController: return "STPCardFormViewController"
case .STPCardFormViewControllerCBC: return "STPCardFormViewController (CBC)"
Expand All @@ -65,13 +55,6 @@ class BrowseViewController: UITableViewController, STPAddCardViewControllerDeleg
}
}

let customerContext: MockCustomerContext = {
let keyManager = STPEphemeralKeyManager(
keyProvider: MockKeyProvider(),
apiVersion: STPAPIClient.apiVersion,
performsEagerFetching: true)
return MockCustomerContext(keyManager: keyManager, apiClient: .shared)
}()
let themeViewController = ThemeViewController()

override func viewDidLoad() {
Expand Down Expand Up @@ -121,47 +104,6 @@ class BrowseViewController: UITableViewController, STPAddCardViewControllerDeleg
let navigationController = UINavigationController(rootViewController: viewController)
navigationController.navigationBar.stp_theme = theme
present(navigationController, animated: true, completion: nil)
case .STPPaymentOptionsFPXViewController:
let config = STPPaymentConfiguration()
config.fpxEnabled = true
config.requiredBillingAddressFields = .none
config.appleMerchantIdentifier = "dummy-merchant-id"
config.cardScanningEnabled = true
let viewController = STPPaymentOptionsViewController(
configuration: config,
theme: theme,
customerContext: self.customerContext,
delegate: self)
let navigationController = UINavigationController(rootViewController: viewController)
navigationController.navigationBar.stp_theme = theme
present(navigationController, animated: true, completion: nil)
case .STPPaymentOptionsViewController:
let config = STPPaymentConfiguration()
config.requiredBillingAddressFields = .none
config.appleMerchantIdentifier = "dummy-merchant-id"
config.cardScanningEnabled = true
let viewController = STPPaymentOptionsViewController(
configuration: config,
theme: theme,
customerContext: self.customerContext,
delegate: self)
let navigationController = UINavigationController(rootViewController: viewController)
navigationController.navigationBar.stp_theme = theme
present(navigationController, animated: true, completion: nil)
case .STPShippingInfoViewController:
let config = STPPaymentConfiguration()
config.requiredShippingAddressFields = [.postalAddress]
let viewController = STPShippingAddressViewController(
configuration: config,
theme: theme,
currency: "usd",
shippingAddress: nil,
selectedShippingMethod: nil,
prefilledInformation: nil)
viewController.delegate = self
let navigationController = UINavigationController(rootViewController: viewController)
navigationController.navigationBar.stp_theme = theme
present(navigationController, animated: true, completion: nil)
case .STPAUBECSFormViewController:
let viewController = AUBECSDebitFormViewController()
viewController.theme = theme
Expand Down Expand Up @@ -193,95 +135,4 @@ class BrowseViewController: UITableViewController, STPAddCardViewControllerDeleg
}
}

// MARK: STPAddCardViewControllerDelegate

func addCardViewControllerDidCancel(_ addCardViewController: STPAddCardViewController) {
dismiss(animated: true, completion: nil)
}

func addCardViewController(
_ addCardViewController: STPAddCardViewController,
didCreatePaymentMethod paymentMethod: STPPaymentMethod,
completion: @escaping STPErrorBlock
) {
dismiss(animated: true, completion: nil)
}

// MARK: STPPaymentOptionsViewControllerDelegate

func paymentOptionsViewControllerDidCancel(
_ paymentOptionsViewController: STPPaymentOptionsViewController
) {
dismiss(animated: true, completion: nil)
}

func paymentOptionsViewControllerDidFinish(
_ paymentOptionsViewController: STPPaymentOptionsViewController
) {
dismiss(animated: true, completion: nil)
}

func paymentOptionsViewController(
_ paymentOptionsViewController: STPPaymentOptionsViewController,
didFailToLoadWithError error: Error
) {
dismiss(animated: true, completion: nil)
}

// MARK: STPShippingAddressViewControllerDelegate

func shippingAddressViewControllerDidCancel(
_ addressViewController: STPShippingAddressViewController
) {
dismiss(animated: true, completion: nil)
}

func shippingAddressViewController(
_ addressViewController: STPShippingAddressViewController,
didFinishWith address: STPAddress,
shippingMethod method: PKShippingMethod?
) {
self.customerContext.updateCustomer(withShippingAddress: address, completion: nil)
dismiss(animated: true, completion: nil)
}

func shippingAddressViewController(
_ addressViewController: STPShippingAddressViewController,
didEnter address: STPAddress,
completion: @escaping STPShippingMethodsCompletionBlock
) {
let upsGround = PKShippingMethod()
upsGround.amount = 0
upsGround.label = "UPS Ground"
upsGround.detail = "Arrives in 3-5 days"
upsGround.identifier = "ups_ground"
let upsWorldwide = PKShippingMethod()
upsWorldwide.amount = 10.99
upsWorldwide.label = "UPS Worldwide Express"
upsWorldwide.detail = "Arrives in 1-3 days"
upsWorldwide.identifier = "ups_worldwide"
let fedEx = PKShippingMethod()
fedEx.amount = 5.99
fedEx.label = "FedEx"
fedEx.detail = "Arrives tomorrow"
fedEx.identifier = "fedex"

DispatchQueue.main.asyncAfter(deadline: .now() + 0.6) {
if address.country == nil || address.country == "US" {
completion(.valid, nil, [upsGround, fedEx], fedEx)
} else if address.country == "AQ" {
let error = NSError(
domain: "ShippingError", code: 123,
userInfo: [
NSLocalizedDescriptionKey: "Invalid Shipping Address",
NSLocalizedFailureReasonErrorKey: "We can't ship to this country.",
])
completion(.invalid, error, nil, nil)
} else {
fedEx.amount = 20.99
completion(.valid, nil, [upsWorldwide, fedEx], fedEx)
}
}
}

}
Loading
Loading