Skip to content

Commit

Permalink
Swiftlint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NQuinn27 committed Oct 23, 2024
1 parent b081bd3 commit 7b39edc
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,11 @@ extension PrimerHeadlessUniversalCheckout {
if decodedJWTToken.intent?.contains("STRIPE_ACH") == true {
if let sdkCompleteUrlString = decodedJWTToken.sdkCompleteUrl,
let sdkCompleteUrl = URL(string: sdkCompleteUrlString) {

DispatchQueue.main.async {
PrimerUIManager.primerRootViewController?.enableUserInteraction(true)
}

firstly {
sendAdditionalInfoEvent()
}
Expand All @@ -530,7 +530,7 @@ extension PrimerHeadlessUniversalCheckout {
.catch { err in
seal.reject(err)
}

} else {
let err = PrimerError.invalidClientToken(userInfo: .errorUserInfoDictionary(),
diagnosticsId: UUID().uuidString)
Expand Down Expand Up @@ -813,7 +813,7 @@ extension PrimerHeadlessUniversalCheckout {
}
}
}

/**
* Completes a payment using the provided JWT token and URL.
*
Expand All @@ -832,7 +832,7 @@ extension PrimerHeadlessUniversalCheckout {
let apiClient: PrimerAPIClientAchProtocol = PrimerAPIConfigurationModule.apiClient ?? PrimerAPIClient()
let timeZone = TimeZone(abbreviation: "UTC")
let timeStamp = Date().toString(timeZone: timeZone)

let body = Request.Body.Payment.Complete(mandateSignatureTimestamp: timeStamp)
apiClient.completePayment(clientToken: clientToken, url: completeUrl, paymentRequest: body) { result in
switch result {
Expand All @@ -844,7 +844,7 @@ extension PrimerHeadlessUniversalCheckout {
}
}
}

/**
* Sends additional information via delegate `PrimerHeadlessUniversalCheckoutDelegate` if implemented in the headless checkout context.
*
Expand All @@ -862,10 +862,10 @@ extension PrimerHeadlessUniversalCheckout {
seal.fulfill()
return
}

let delegate = PrimerHeadlessUniversalCheckout.current.delegate
let isAdditionalInfoImplemented = delegate?.primerHeadlessUniversalCheckoutDidReceiveAdditionalInfo != nil

guard isAdditionalInfoImplemented else {
let logMessage =
"""
Expand All @@ -874,23 +874,23 @@ extension PrimerHeadlessUniversalCheckout {
"""
logger.warn(message: logMessage)

let message = "Couldn't continue as due to unimplemented delegate method `primerHeadlessUniversalCheckoutDidReceiveAdditionalInfo`"
let message = "Couldn't continue due to unimplemented delegate method `primerHeadlessUniversalCheckoutDidReceiveAdditionalInfo`"
let error = PrimerError.unableToPresentPaymentMethod(paymentMethodType: self.paymentMethodType,
userInfo: .errorUserInfoDictionary(additionalInfo: [
"message": message
]),
diagnosticsId: UUID().uuidString)

seal.reject(error)
return
}

let additionalInfo = ACHMandateAdditionalInfo()
PrimerDelegateProxy.primerDidReceiveAdditionalInfo(additionalInfo)
seal.fulfill()
}
}

/**
* Waits for a response from the ACHMandateDelegate method.
* The response is returned in stripeMandateCompletion handler.
Expand All @@ -914,7 +914,7 @@ extension PrimerHeadlessUniversalCheckout.VaultManager: ACHMandateDelegate {
public func acceptMandate() {
achMandateCompletion?(.success(()))
}

public func declineMandate() {
let error = ACHHelpers.getCancelledError(paymentMethodType: paymentMethodType)
achMandateCompletion?(.failure(error))
Expand Down

0 comments on commit 7b39edc

Please sign in to comment.