Skip to content

Commit

Permalink
Merge pull request #508 from checkout/release/4.3.1
Browse files Browse the repository at this point in the history
Release 4.3.1
  • Loading branch information
aashna-narula-cko authored Jan 23, 2024
2 parents c921e31 + 7ee3593 commit 347e873
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 11 deletions.
11 changes: 10 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions .github/partial-readmes/MakeItYourOwn.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion Frames.podspec
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Constants/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions Source/UI/PaymentForm/Model/PaymentStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

public struct PaymentStyle {
let paymentFormStyle: PaymentFormStyle
let billingFormStyle: BillingFormStyle
let billingFormStyle: BillingFormStyle?

/**
Define the payment form UI Styling
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" */ = {
Expand Down
2 changes: 1 addition & 1 deletion iOS Example Frame/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion iOS Example Frame/iOS Example Frame/Factory/Factory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 347e873

Please sign in to comment.