diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 1ed315697..852c3e028 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -5,7 +5,16 @@ All notable changes to this project will be documented in this file. #### 4.x Releases -## [4.3.0](https://github.com/checkout/frames-ios/releases/tag/4.2.1) +## [4.3.1](https://github.com/checkout/frames-ios/releases/tag/4.3.1) + +Released on 2024-01-19 + +Updates: + +- Added capability for disabling Billing Address. + + +## [4.3.0](https://github.com/checkout/frames-ios/releases/tag/4.3.0) Released on 2023-11-07 diff --git a/.github/partial-readmes/MakeItYourOwn.md b/.github/partial-readmes/MakeItYourOwn.md index 949b446f4..e43c50c6e 100644 --- a/.github/partial-readmes/MakeItYourOwn.md +++ b/.github/partial-readmes/MakeItYourOwn.md @@ -37,6 +37,12 @@ paymentFormStyle.payButton.text = "Pay £54.63" ``` We wouldn't recommend this approach if you're looking to override many values, since you would need to individually identify and change every property. But it can work for small tweaks. +To deactivate the billing address, include the following code lines within the getDefaultPaymentViewController() function in the Factory.swift file: +```swift + paymentFormStyle.editBillingSummary = nil + paymentFormStyle.addBillingSummary = nil +``` + ### Use Theme In our Demo projects we also demo this approach in `ThemeDemo.swift`. With the Theme, we are aiming to give you a design system that you can use to create the full UI style by providing a small number of properties that we will share across to sub components. Since you might not fully agree with our mapping, you can still individually change each component afterwards (as in the Modify Default example). diff --git a/CheckoutTests/Integration/CheckoutAPIServiceIntegrationTests.swift b/CheckoutTests/Integration/CheckoutAPIServiceIntegrationTests.swift index 7c7f09a9b..dbc820a6e 100644 --- a/CheckoutTests/Integration/CheckoutAPIServiceIntegrationTests.swift +++ b/CheckoutTests/Integration/CheckoutAPIServiceIntegrationTests.swift @@ -139,7 +139,7 @@ final class CheckoutAPIServiceIntegrationTests: XCTestCase { XCTAssertNil(tokenDetails.billingAddress) XCTAssertEqual(tokenDetails.cardCategory, "CONSUMER") XCTAssertEqual(tokenDetails.cardType, "DEBIT") - XCTAssertEqual(tokenDetails.issuer, "WISE PAYMENTS LIMITED") + XCTAssertEqual(tokenDetails.issuer, "CURVE UK LIMITED") XCTAssertEqual(tokenDetails.issuerCountry, "GB") XCTAssertNil(tokenDetails.phone) XCTAssertEqual(tokenDetails.productId, "MDW") diff --git a/Frames.podspec b/Frames.podspec index 2b7d4418e..5dbc218db 100644 --- a/Frames.podspec +++ b/Frames.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Frames" - s.version = "4.3.0" + s.version = "4.3.1" s.summary = "Checkout API Client, Payment Form UI and Utilities in Swift" s.description = <<-DESC Checkout API Client and Payment Form Utilities in Swift. diff --git a/Source/Core/Constants/Constants.swift b/Source/Core/Constants/Constants.swift index 6f52553db..4c1b00052 100644 --- a/Source/Core/Constants/Constants.swift +++ b/Source/Core/Constants/Constants.swift @@ -8,7 +8,7 @@ enum Constants { static let productName = "frames-ios-sdk" - static let version = "4.3.0" + static let version = "4.3.1" static let userAgent = "checkout-sdk-frames-ios/\(version)" enum Logging { diff --git a/Source/UI/PaymentForm/Model/PaymentStyle.swift b/Source/UI/PaymentForm/Model/PaymentStyle.swift index 7193d8464..3a52a64c4 100644 --- a/Source/UI/PaymentForm/Model/PaymentStyle.swift +++ b/Source/UI/PaymentForm/Model/PaymentStyle.swift @@ -9,7 +9,7 @@ import Foundation public struct PaymentStyle { let paymentFormStyle: PaymentFormStyle - let billingFormStyle: BillingFormStyle + let billingFormStyle: BillingFormStyle? /** Define the payment form UI Styling @@ -19,7 +19,7 @@ public struct PaymentStyle { - billingFormStyle: UI Styling for the billing form if the user will interact with the address billing */ public init(paymentFormStyle: PaymentFormStyle, - billingFormStyle: BillingFormStyle) { + billingFormStyle: BillingFormStyle? = nil) { self.paymentFormStyle = paymentFormStyle self.billingFormStyle = billingFormStyle } diff --git a/Source/UI/PaymentForm/ViewController/FramesPaymentViewController.swift b/Source/UI/PaymentForm/ViewController/FramesPaymentViewController.swift index 8fa3b93ae..bb9c7a2b2 100644 --- a/Source/UI/PaymentForm/ViewController/FramesPaymentViewController.swift +++ b/Source/UI/PaymentForm/ViewController/FramesPaymentViewController.swift @@ -344,7 +344,9 @@ extension FramesPaymentViewController { paymentViews.append(securityCodeView) } - if viewModel.paymentFormStyle?.addBillingSummary != nil && viewModel.paymentFormStyle?.editBillingSummary != nil { + if viewModel.billingFormStyle != nil && + viewModel.paymentFormStyle?.addBillingSummary != nil && + viewModel.paymentFormStyle?.editBillingSummary != nil { paymentViews.append(contentsOf: [ addBillingFormButtonView, billingFormSummaryView]) diff --git a/iOS Example Frame SPM/iOS Example Frame Regression Tests/ExpiryDateEdgeCaseTests.swift b/iOS Example Frame SPM/iOS Example Frame Regression Tests/ExpiryDateEdgeCaseTests.swift index f19bf21ec..91a550e06 100644 --- a/iOS Example Frame SPM/iOS Example Frame Regression Tests/ExpiryDateEdgeCaseTests.swift +++ b/iOS Example Frame SPM/iOS Example Frame Regression Tests/ExpiryDateEdgeCaseTests.swift @@ -37,10 +37,11 @@ final class ExpiryDateEdgeCaseTests: XCTestCase { let app = XCUIApplication() app.launchFrames() - let currentMonth = String(Calendar.current.component(.month, from: Date())) + var currentMonth = String(Calendar.current.component(.month, from: Date())) let currentYear = String(Calendar.current.component(.year, from: Date())).suffix(2) let expiryTextField = app.otherElements[AccessibilityIdentifiers.PaymentForm.cardExpiry] + currentMonth = currentMonth.count == 1 ? "0" + currentMonth : currentMonth app.enterText(currentMonth + currentYear, into: expiryTextField) app.tapDoneButton() diff --git a/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.pbxproj b/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.pbxproj index 2f0348cd1..a1fa79bfd 100644 --- a/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.pbxproj +++ b/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.pbxproj @@ -1236,7 +1236,7 @@ repositoryURL = "https://github.com/checkout/frames-ios"; requirement = { kind = exactVersion; - version = 4.3.0; + version = 4.3.1; }; }; 16C3F83E2A7927ED00690639 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */ = { diff --git a/iOS Example Frame/Podfile b/iOS Example Frame/Podfile index 6f293485c..45e5257cf 100644 --- a/iOS Example Frame/Podfile +++ b/iOS Example Frame/Podfile @@ -6,7 +6,7 @@ target 'iOS Example Frame' do use_frameworks! # Pods for iOS Example Custom - pod 'Frames', '4.3.0' + pod 'Frames', '4.3.1' end diff --git a/iOS Example Frame/iOS Example Frame/Factory/Factory.swift b/iOS Example Frame/iOS Example Frame/Factory/Factory.swift index 734d43ae5..a5004d663 100644 --- a/iOS Example Frame/iOS Example Frame/Factory/Factory.swift +++ b/iOS Example Frame/iOS Example Frame/Factory/Factory.swift @@ -36,10 +36,14 @@ enum Factory { let phone = Phone(number: "77 1234 1234", country: country) let billingFormData = BillingForm(name: "Bình Inyene", address: address, phone: phone) - + let billingFormStyle = FramesFactory.defaultBillingFormStyle let paymentFormStyle = FramesFactory.defaultPaymentFormStyle + + // Comment out below lines to hide billing address (Optional) + // paymentFormStyle.editBillingSummary = nil + // paymentFormStyle.addBillingSummary = nil let supportedSchemes: [CardScheme] = [.mada, .visa, .mastercard, .maestro, .americanExpress, .discover, .dinersClub, .jcb]