Skip to content

Commit 26fde07

Browse files
Merge pull request #451 from checkout/hotifx/rename-paymentviewcontroller
Rename PaymentViewController
2 parents 65c2f97 + cfccc83 commit 26fde07

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

Source/UI/PaymentForm/Factory/PaymentFormFactory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public enum PaymentFormFactory {
1919
supportedSchemes: configuration.supportedSchemes)
2020
viewModel.preventDuplicateCardholderInput()
2121

22-
let viewController = PaymentViewController(viewModel: viewModel)
22+
let viewController = FramesPaymentViewController(viewModel: viewModel)
2323
viewModel.cardTokenRequested = completionHandler
2424
logger.log(.paymentFormInitialised(environment: configuration.environment))
2525
if #available(iOS 13.0, *) {

Source/UI/PaymentForm/ViewController/PaymentViewController.swift renamed to Source/UI/PaymentForm/ViewController/FramesPaymentViewController.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ protocol PaymentViewControllerDelegate: AnyObject {
1111
}
1212

1313
// swiftlint:disable file_length
14-
final class PaymentViewController: UIViewController {
14+
final class FramesPaymentViewController: UIViewController {
1515

1616
// MARK: - Variables
1717

@@ -173,7 +173,7 @@ final class PaymentViewController: UIViewController {
173173

174174
// MARK: View Model Integration
175175

176-
extension PaymentViewController {
176+
extension FramesPaymentViewController {
177177
private func setupViewModel() {
178178
delegate = self.viewModel as? PaymentViewControllerDelegate
179179
updateBackgroundViews()
@@ -323,7 +323,7 @@ extension PaymentViewController {
323323

324324
// MARK: Setup Views
325325

326-
extension PaymentViewController {
326+
extension FramesPaymentViewController {
327327
private func setupViewsInOrder() {
328328
setupScrollView()
329329
setupStackView()
@@ -387,43 +387,43 @@ extension PaymentViewController {
387387
}
388388
}
389389

390-
extension PaymentViewController: SelectionButtonViewDelegate {
390+
extension FramesPaymentViewController: SelectionButtonViewDelegate {
391391
func selectionButtonIsPressed() {
392392
delegate?.addBillingButtonIsPressed(sender: navigationController)
393393
}
394394
}
395395

396-
extension PaymentViewController: BillingFormSummaryViewDelegate {
396+
extension FramesPaymentViewController: BillingFormSummaryViewDelegate {
397397
func summaryButtonIsPressed() {
398398
delegate?.editBillingButtonIsPressed(sender: navigationController)
399399
}
400400
}
401401

402-
extension PaymentViewController: ExpiryDateViewDelegate {
402+
extension FramesPaymentViewController: ExpiryDateViewDelegate {
403403
func update(result: Result<ExpiryDate, ValidationError.ExpiryDate>) {
404404
delegate?.expiryDateIsUpdated(result: result)
405405
}
406406
}
407407

408-
extension PaymentViewController: CardholderDelegate {
408+
extension FramesPaymentViewController: CardholderDelegate {
409409
func cardholderUpdated(to cardholderInput: String) {
410410
delegate?.cardholderIsUpdated(value: cardholderInput)
411411
}
412412
}
413413

414-
extension PaymentViewController: SecurityCodeViewDelegate {
414+
extension FramesPaymentViewController: SecurityCodeViewDelegate {
415415
func update(securityCode: String) {
416416
delegate?.securityCodeIsUpdated(to: securityCode)
417417
}
418418
}
419419

420-
extension PaymentViewController: ButtonViewDelegate {
420+
extension FramesPaymentViewController: ButtonViewDelegate {
421421
func selectionButtonIsPressed(sender: UIView) {
422422
delegate?.payButtonIsPressed()
423423
}
424424
}
425425

426-
extension PaymentViewController: UIScrollViewDelegate {
426+
extension FramesPaymentViewController: UIScrollViewDelegate {
427427
func scrollViewDidScroll(_ scrollView: UIScrollView) {
428428
let contentOffsetY = scrollView.contentOffset.y + scrollView.adjustedContentInset.top
429429

Tests/UI/Factory/FramesFactoryTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class FramesFactoryTests: XCTestCase {
3030
let formConfig = PaymentFormConfiguration(apiKey: "", environment: .sandbox, supportedSchemes: [.visa], billingFormData: billingForm)
3131
let formStyle = PaymentStyle(paymentFormStyle: paymentFormStyle, billingFormStyle: billingFormStyle)
3232
let viewController = PaymentFormFactory.buildViewController(configuration: formConfig, style: formStyle) { _ in }
33-
let paymentViewController = try XCTUnwrap(viewController as? PaymentViewController)
33+
let paymentViewController = try XCTUnwrap(viewController as? FramesPaymentViewController)
3434
let viewModel = try XCTUnwrap(paymentViewController.viewModel)
3535

3636
XCTAssertNotNil(paymentViewController.viewModel)

Tests/UI/PaymentForm/PaymentViewControllerTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Checkout
1010
@testable import Frames
1111

1212
class PaymentViewControllerTests: XCTestCase {
13-
var viewController: PaymentViewController!
13+
var viewController: FramesPaymentViewController!
1414
var viewModel: DefaultPaymentViewModel!
1515
let delegate = PaymentViewControllerMockDelegate()
1616
let stubCheckoutAPIService = StubCheckoutAPIService()
@@ -34,7 +34,7 @@ class PaymentViewControllerTests: XCTestCase {
3434
paymentFormStyle: DefaultPaymentFormStyle(),
3535
billingFormStyle: DefaultBillingFormStyle(),
3636
supportedSchemes: [.discover, .mada])
37-
viewController = PaymentViewController(viewModel: viewModel)
37+
viewController = FramesPaymentViewController(viewModel: viewModel)
3838
}
3939

4040
func testPaymentViewsHierarchy() {
@@ -155,7 +155,7 @@ class PaymentViewControllerTests: XCTestCase {
155155
paymentFormStyle: nil,
156156
billingFormStyle: nil,
157157
supportedSchemes: [])
158-
let testVC = PaymentViewController(viewModel: testViewModel)
158+
let testVC = FramesPaymentViewController(viewModel: testViewModel)
159159

160160
let expect = expectation(description: "Free up main thread in case UI work influences outcome")
161161
testVC.viewDidLoad()
@@ -183,7 +183,7 @@ class PaymentViewControllerTests: XCTestCase {
183183
paymentFormStyle: nil,
184184
billingFormStyle: nil,
185185
supportedSchemes: [])
186-
let testVC = PaymentViewController(viewModel: testViewModel)
186+
let testVC = FramesPaymentViewController(viewModel: testViewModel)
187187

188188
XCTAssertTrue(testLogger.addCalledWithMetadataPairs.isEmpty)
189189
XCTAssertTrue(testLogger.logCalledWithFramesLogEvents.isEmpty)

0 commit comments

Comments
 (0)