Skip to content

Commit

Permalink
UI Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NQuinn27 committed Dec 13, 2024
1 parent ab63aa2 commit dd6a283
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ extension MerchantHeadlessCheckoutAvailablePaymentMethodsViewController {
print("\n\nMERCHANT APP\n\(#function)\nerror: \(err)\ncheckoutData: \(String(describing: checkoutData))")
self.logs.append(#function)
self.primerError = err
self.checkoutData = checkoutData
self.hideLoadingOverlay()

if let lastViewController = navigationController?.children.last {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ extension MerchantHeadlessCheckoutStripeAchViewController: PrimerHeadlessUnivers
func primerHeadlessUniversalCheckoutDidFail(withError err: any Error, checkoutData: PrimerCheckoutData?) {
print("\n\nMERCHANT APP\n\(#function)\nerror: \(err)\ncheckoutData: \(String(describing: checkoutData))")
logs.append(#function)
presentResultsVC(checkoutData: nil, error: err)
presentResultsVC(checkoutData: checkoutData, error: err)
}

func primerHeadlessUniversalCheckoutDidReceiveAdditionalInfo(_ additionalInfo: PrimerCheckoutAdditionalInfo?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ extension PrimerHeadlessUniversalCheckout {
private(set) var resumePaymentId: String?
private var webViewController: SFSafariViewController?
private var webViewCompletion: ((_ authorizationToken: String?, _ error: PrimerError?) -> Void)?
private var achMandateCompletion: ((Result<Void, PrimerError>) -> Void)?

lazy var createResumePaymentService: CreateResumePaymentServiceProtocol = {
CreateResumePaymentService(paymentMethodType: paymentMethodType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,14 @@ Make sure you call the decision handler otherwise the SDK will hang.
}

func handleSuccessfulFlow() {
let categories = self.config.paymentMethodManagerCategories
PrimerUIManager.dismissOrShowResultScreen(type: .success,
paymentMethodManagerCategories: categories ?? [])
if let paymentMethodType = config.internalPaymentMethodType,
paymentMethodType == .stripeAch {
PrimerUIManager.showResultScreen(for: paymentMethodType, error: nil)
} else {
let categories = self.config.paymentMethodManagerCategories
PrimerUIManager.dismissOrShowResultScreen(type: .success,
paymentMethodManagerCategories: categories ?? [])
}
}

func handleFailureFlow(errorMessage: String?) {
Expand Down

0 comments on commit dd6a283

Please sign in to comment.