Adyen / adyen-ios

Adyen iOS Drop-in and Components
https://docs.adyen.com/checkout/ios
MIT License
150 stars 120 forks source link

[BUG] Apple Pay - SDK not dismissing PKPaymentAuthorizationViewController #1838

Open guilhermebattaglinrentcars opened 5 days ago

guilhermebattaglinrentcars commented 5 days ago

Describe the bug SDK do not dismiss PKPaymentAuthorizationViewController modal after cancelation or payment error.

To Reproduce Steps to reproduce the behavior:

  1. Try pay with Apple Pay
  2. Tap on X to dismiss the modal
  3. Modal not dismissing

Expected behavior Dismiss modal when tap on the X (close) button

Environment

Relevant source code

paymentAuthorizationViewControllerDidFinish not calling controller dismiss

image
goergisn commented 4 days ago

Hi @guilhermebattaglinrentcars thank you for reporting, we're looking into it 👌

atmamont commented 1 day ago

Hi @guilhermebattaglinrentcars,

We were not able to reproduce the issue. You mentioned the paymentAuthorizationViewControllerDidFinish doesn't dismiss the view controller. Whenever a user cancels the Apple Pay flow, the component calls the delegate using self.delegate?.didFail(with: ComponentError.cancelled, from: self) and then it's up to you to dismiss the controller.

You can check the example of how the error state (user canceled) is handled in the Demo app: https://github.com/Adyen/adyen-ios/blob/v4/Demo/Common/IntegrationExample.swift#L90

Please let us know if it helps or if you have more questions.