diff --git a/Demo/Application/Features/PayPalWebCheckoutViewController.swift b/Demo/Application/Features/PayPalWebCheckoutViewController.swift index dbf1fdbe2d..218abf5e48 100644 --- a/Demo/Application/Features/PayPalWebCheckoutViewController.swift +++ b/Demo/Application/Features/PayPalWebCheckoutViewController.swift @@ -141,8 +141,8 @@ class PayPalWebCheckoutViewController: PaymentButtonBaseViewController { ) let billingCycle = BTPayPalBillingCycle( - billingInterval: .month, - billingIntervalCount: 1, + interval: .month, + intervalCount: 1, numberOfExecutions: 12, sequence: 9, startDate: "2024-04-06T00:00:00Z", diff --git a/Sources/BraintreePayPal/BillingAgreementMetadata/BTPayPalBillingCycle.swift b/Sources/BraintreePayPal/BillingAgreementMetadata/BTPayPalBillingCycle.swift index 7ff72f9681..6ab7061365 100644 --- a/Sources/BraintreePayPal/BillingAgreementMetadata/BTPayPalBillingCycle.swift +++ b/Sources/BraintreePayPal/BillingAgreementMetadata/BTPayPalBillingCycle.swift @@ -5,7 +5,7 @@ public struct BTPayPalBillingCycle { // MARK: - Private Properties - private let billingInterval: BillingInterval + private let interval: BillingInterval /// The interval at which the payment is charged or billed. public enum BillingInterval: String { @@ -15,7 +15,7 @@ public struct BTPayPalBillingCycle { case year = "YEAR" } - private let billingIntervalCount: Int + private let intervalCount: Int private let numberOfExecutions: Int @@ -31,24 +31,24 @@ public struct BTPayPalBillingCycle { /// Initialize a `BTPayPalBillingCycle` object. /// - Parameters: - /// - billingInterval: The number of intervals after which a subscriber is charged or billed. - /// - billingIntervalCount: The number of times this billing cycle gets executed. For example, if the `billingInterval` is DAY with an `billingIntervalCount` of 2, the subscription is billed once every two days. Maximum values {DAY -> 365}, {WEEK, 52}, {MONTH, 12}, {YEAR, 1}. + /// - intervalCount: The number of intervals after which a subscriber is charged or billed. + /// - intervalCount: The number of times this billing cycle gets executed. For example, if the `intervalCount` is DAY with an `intervalCount` of 2, the subscription is billed once every two days. Maximum values {DAY -> 365}, {WEEK, 52}, {MONTH, 12}, {YEAR, 1}. /// - numberOfExecutions: The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999). Regular billing cycles can be executed infinite times (value of 0) or a finite number of times (value between 1 and 999). /// - sequence: The sequence of the billing cycle. Starting value 1 and max value 100. All billing cycles should have unique sequence values. /// - startDate: The date and time when the billing cycle starts, in Internet date and time format `YYYY-MM-DDT00:00:00Z`. If not provided the billing cycle starts at the time of checkout. If provided and the merchant wants the billing cycle to start at the time of checkout, provide the current time. Otherwise the `startDate` can be in future. /// - isTrial: The tenure type of the billing cycle. In case of a plan having trial cycle, only 2 trial cycles are allowed per plan. /// - pricing: The active pricing scheme for this billing cycle. Required if `trial` is false. Optional if `trial` is true. public init( - billingInterval: BillingInterval, - billingIntervalCount: Int, + interval: BillingInterval, + intervalCount: Int, numberOfExecutions: Int, sequence: Int?, startDate: String?, isTrial: Bool, pricing: BTPayPalBillingPricing? ) { - self.billingInterval = billingInterval - self.billingIntervalCount = billingIntervalCount + self.interval = interval + self.intervalCount = intervalCount self.numberOfExecutions = numberOfExecutions self.sequence = sequence self.startDate = startDate @@ -61,8 +61,8 @@ public struct BTPayPalBillingCycle { func parameters() -> [String: Any] { var parameters: [String: Any] = [:] - parameters["billing_frequency"] = billingIntervalCount - parameters["billing_frequency_unit"] = billingInterval.rawValue + parameters["billing_frequency"] = intervalCount + parameters["billing_frequency_unit"] = interval.rawValue parameters["number_of_executions"] = numberOfExecutions parameters["trial"] = isTrial diff --git a/UnitTests/BraintreePayPalTests/BTPayPalVaultRequest_Tests.swift b/UnitTests/BraintreePayPalTests/BTPayPalVaultRequest_Tests.swift index b483adc8f7..1389cd7e1d 100644 --- a/UnitTests/BraintreePayPalTests/BTPayPalVaultRequest_Tests.swift +++ b/UnitTests/BraintreePayPalTests/BTPayPalVaultRequest_Tests.swift @@ -92,8 +92,8 @@ class BTPayPalVaultRequest_Tests: XCTestCase { ) let billingCycle = BTPayPalBillingCycle( - billingInterval: .month, - billingIntervalCount: 13, + interval: .month, + intervalCount: 13, numberOfExecutions: 12, sequence: 9, startDate: "test-date",