'My app is collecting a lot of StoreKit underlyingErrors: AMSErrorDomain Code=305 Purchase Failed, what might be the reasons?

The issue occurs in production, couldn't reproduce it in Sandbox. Full example of underlyingError I get:

Error Domain=SKErrorDomain
Code=0
"An unknown error occurred"
UserInfo={
    NSLocalizedDescription=An unknown error occurred,
    NSUnderlyingError=0x282db1230 {
        Error Domain=ASDErrorDomain
        Code=504
        "The operation couldn’t be completed. (ASDErrorDomain error 504.)"
        UserInfo={
            NSLocalizedDescription=The operation couldn’t be completed. (ASDErrorDomain error 504.),
            NSUnderlyingError=0x282db0780 {
                Error Domain=AMSErrorDomain
                Code=305
                "Purchase Failed"
                UserInfo={
                    NSLocalizedDescription=Purchase Failed,
                    NSLocalizedFailureReason=Server canceled the purchase
                }
            }
        }
    }
};

What might be the reasons for it? Is there really something I can do to resolve it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source