Skip to content

Commit c808c1d

Browse files
authored
[Payments] Add WooPayments IPP support for Puerto Rico (#14972)
2 parents f55a87c + 6430c38 commit c808c1d

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
22.0
55
-----
6+
- [*] Payments: Puerto Rico is now available in the list of countries that are supported by In-Person Payments, when using WooPayments [https://github.com/woocommerce/woocommerce-ios/pull/14972]
67
- [*] Product Form: Fix crash related to picking photos [https://github.com/woocommerce/woocommerce-ios/pull/15275]
78
- [internal] Assign `siteID` and `productID` to image product upload statuses. [https://github.com/woocommerce/woocommerce-ios/pull/15196]
89
- [*] Payments: Improved payment views' adaptability to larger accessibility font sizes [https://github.com/woocommerce/woocommerce-ios/pull/15328].

Yosemite/Yosemite/Model/Payments/CardPresentPaymentsConfiguration.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,21 @@ public struct CardPresentPaymentsConfiguration: Equatable {
6262
contactlessLimitAmount: nil,
6363
minimumOperatingSystemVersionForTapToPay: .init(majorVersion: 16, minorVersion: 0, patchVersion: 0)
6464
)
65+
case .PR:
66+
self.init(
67+
countryCode: country,
68+
paymentMethods: [.cardPresent],
69+
currencies: [.USD],
70+
paymentGateways: [WCPayAccount.gatewayID],
71+
supportedReaders: [.chipper, .stripeM2],
72+
supportedPluginVersions: [
73+
.init(plugin: .wcPay, minimumVersion: "9.0.0")
74+
],
75+
minimumAllowedChargeAmount: NSDecimalNumber(string: "0.5"),
76+
stripeSmallestCurrencyUnitMultiplier: 100,
77+
contactlessLimitAmount: nil,
78+
minimumOperatingSystemVersionForTapToPay: .init(majorVersion: 16, minorVersion: 0, patchVersion: 0)
79+
)
6580
case .CA:
6681
self.init(
6782
countryCode: country,

Yosemite/YosemiteTests/Model/CardPresentConfigurationTests.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ class CardPresentConfigurationTests: XCTestCase {
1515
assertEqual([.chipper, .stripeM2, .appleBuiltIn], configuration.supportedReaders)
1616
}
1717

18+
// MARK: - Puerto Rico Tests
19+
func test_configuration_for_PR() throws {
20+
let configuration = CardPresentPaymentsConfiguration(country: .PR)
21+
XCTAssertTrue(configuration.isSupportedCountry)
22+
XCTAssertEqual(configuration.currencies, [.USD])
23+
XCTAssertEqual(configuration.paymentGateways, [Constants.PaymentGateway.wcpay])
24+
XCTAssertEqual(configuration.paymentMethods, [.cardPresent])
25+
XCTAssertEqual(configuration.supportedPluginVersions, [.init(plugin: .wcPay, minimumVersion: "9.0.0")])
26+
assertEqual([.chipper, .stripeM2], configuration.supportedReaders)
27+
// The `purchaseCardReaderUrl` for PR doesn't exist. On lack of country code, the URL redirection falls back to the M2 reader
28+
}
29+
1830
// MARK: - Canada Tests
1931
func test_configuration_for_Canada() throws {
2032
let configuration = CardPresentPaymentsConfiguration(country: .CA)

0 commit comments

Comments
 (0)