diff --git a/README.md b/README.md index a3022092..956147d3 100644 --- a/README.md +++ b/README.md @@ -305,7 +305,7 @@ After setting the total amount the matching breakdown string for the set Afterpa ### Intro Text Setting `introText` is optional, will default to `or` and must be of type `AfterpayIntroText`. -Can be any of `or`, `orTitle`, `pay`, `payTitle`, `make`, `makeTitle`, `payIn`, `payInTitle`, `in`, `inTitle` or `NONE` (no intro text). +Can be any of `or`, `orTitle`, `pay`, `payTitle`, `make`, `makeTitle`, `payIn`, `payInTitle`, `in`, `inTitle` or `empty` (no intro text). Intro text will be rendered lowercase unless using an option suffixed with `Title` in which case title case will be rendered. ```swift diff --git a/Sources/Afterpay/Model/PriceBreakdown.swift b/Sources/Afterpay/Model/PriceBreakdown.swift index 5d6ad8a5..8fb7d951 100644 --- a/Sources/Afterpay/Model/PriceBreakdown.swift +++ b/Sources/Afterpay/Model/PriceBreakdown.swift @@ -38,7 +38,7 @@ struct PriceBreakdown { if let formattedPayment = formattedPayment, inRange { badgePlacement = .end - string = String(format: Strings.fourPaymentsFormat, introText.rawValue, formattedPayment) + string = String(format: Strings.fourPaymentsFormat, introText.rawValue, formattedPayment).trimmingCharacters(in: .whitespaces) } else if let formattedMinimum = formattedMinimum, let formattedMaximum = formattedMaximum { badgePlacement = .start string = String(format: Strings.availableBetweenFormat, formattedMinimum, formattedMaximum) diff --git a/Sources/Afterpay/Resources/IntroText.swift b/Sources/Afterpay/Resources/IntroText.swift index ded513ed..aa8dec48 100644 --- a/Sources/Afterpay/Resources/IntroText.swift +++ b/Sources/Afterpay/Resources/IntroText.swift @@ -9,15 +9,15 @@ import Foundation public enum AfterpayIntroText: String { - case NONE = "" - case make = "make " - case makeTitle = "Make " - case pay = "pay " - case payTitle = "Pay " - case `in` = "in " - case inTitle = "In " - case or = "or " - case orTitle = "Or " - case payIn = "pay in " - case payInTitle = "Pay in " + case empty = "" + case make = "make" + case makeTitle = "Make" + case pay = "pay" + case payTitle = "Pay" + case `in` = "in" + case inTitle = "In" + case or = "or" + case orTitle = "Or" + case payIn = "pay in" + case payInTitle = "Pay in" } diff --git a/Sources/Afterpay/Resources/Strings.swift b/Sources/Afterpay/Resources/Strings.swift index 5442e461..b83c421b 100644 --- a/Sources/Afterpay/Resources/Strings.swift +++ b/Sources/Afterpay/Resources/Strings.swift @@ -21,7 +21,7 @@ enum Strings { static let availableBetweenFormat = "available for orders between %@ - %@" static let availableUpToFormat = "available for orders up to %@" - static let fourPaymentsFormat = "%@4 interest-free payments of %@ with" + static let fourPaymentsFormat = "%@ 4 interest-free payments of %@ with" // MARK: - Accessible Strings