Adyen / adyen-3ds2-ios

Other
18 stars 12 forks source link

NSInternalInconsistencyException - Directory server root certificates are invalid or nil #34

Closed rokridi closed 7 months ago

rokridi commented 7 months ago

Hello.

I have noticed that the application am working on crashes when user issues a 3DS2 payment after upgrading the SDK to 2.3.3. The crash occurs only with PROD environment, no crash when testing with QA environment.

Crashlytics reports several crashes with this message:

NSInternalInconsistencyException - Directory server root certificates are invalid or nil, providing the Directory server root certificates and public key is required. check [documentation](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce/3d-secure/native

A sample code showing how i start a transaction:


public func transaction(
        serverIdentifier: String,
        publicKey: String,
        messageVersion: String,
        directoryServerRootCertificates: String,
        completion: @escaping (Result<any Adyen3DS2TransactionProtocol, any Error>) -> Void
    ) {
        let parameters = ADYServiceParameters(
            directoryServerIdentifier: serverIdentifier,
            directoryServerPublicKey: publicKey,
            directoryServerRootCertificates: directoryServerRootCertificates
        )
        self.adyService
            .service(parameters: parameters) { service in
                do {
                    try completion(.success(service.transaction(messageVersion: messageVersion)))
                } catch {
                    completion(.failure(error))
                }
            }
    }
robertdalmeida commented 7 months ago

Hi @rokridi - thanks for reporting this issue. Could you please share a psp reference for this issue that you see?

rokridi commented 7 months ago

Hi @robertdalmeida Here is the psp reference BN9H3KQ9332Q4932 Thank you.

robertdalmeida commented 7 months ago

Hi @rokridi, Thank you for sharing the psp. unfortunately, on investigation we find that for this psp we don't get the exception from the sdk and are unable to see the issue. (We are able to start the transaction based on the payload ADYServiceParameters that Adyen sends)

  1. A possibility could be that your backend is filtering characters/any other sort of processing of these parameters when received from Adyen. Which in turn on being sent to the sdk fails. Could you please verify if this is case?
  2. Could you send us a few more psps (to eliminate the possibility that there could be a scenario that the root certificates are nil/empty).
rokridi commented 7 months ago

Hello @robertdalmeida I will ask the backend team and answer you back asap.

rokridi commented 7 months ago

Here are some psp refereces:

I am still waiting for an answer from the backend team regarding you first qustion.

rokridi commented 7 months ago

The backend team says that the data received from Adyen backend is not processed before it is sent to the front end.

robertdalmeida commented 7 months ago

Thank you for sharing the additional psp references and checking the backend. The psps all have the same payload for the root certificates therefore none of these times are we sending an empty payload.

  1. Are you able to reproduce this issue in your environment? As these steps would help us better isolate the root cause of issue.

  2. Do you notice any common patterns with the crashes? For eg: a specific device, iOS version which this may occur, or any other pattern that you may observe with the crash logs. (Note: We don't have visibility of this information).

rokridi commented 7 months ago

Hello @robertdalmeida

Sorry I can't find any common pattern that systematically leads to reproducing this crash. The crash doesn't occur in specific devices or iOS versions

robertdalmeida commented 7 months ago

Hi @rokridi, Thanks for checking. We are working on an updated release of the sdk. Should be available in a week's time.

ggdiez commented 7 months ago

I'm having exactly the same crashes reports on Crashlytics

Fatal Exception: NSInternalInconsistencyException
Directory server root certificates are invalid or nil, providing the Directory server root certificates and public key is required. check [documentation](https://docs.adyen.com/online-payments/classic-integrations/api-integration-ecommerce/3d-secure/native

Waiting for the next version.

ggdiez commented 7 months ago

Hi @robertdalmeida I see that you published new version 2.4.1 and I guess the fix is inside. Do you know when adyen-ios will publish a new version pointed to 2.4.1 of this repo?

robertdalmeida commented 7 months ago

@ggdiez the version from adyen-ios is planned for release around march end.

robertdalmeida commented 7 months ago

Closing this issue as the fix for this has been released in version 2.4.1