Hello, Apple Developer Community!
I am attempting to test a user upgrade scenario from an existing monthly subscription to a yearly subscription, applying a Promotional Offer within the sandbox environment.
When trying to process the transaction, I consistently receive the following errors from StoreKit:
<SKPaymentQueue: 0x...>: Payment completed with error: Error Domain=ASDServerErrorDomain Code=3903 "Unable to Purchase" UserInfo={NSLocalizedFailureReason=Unable to Purchase, client-environment-type=Sandbox, AMSServerErrorCode=3903, storefront-country-code=USA}
[...]: Finishing transaction <SKPaymentTransaction: 0x...> with no identifier
Additionally, the standard dialog shown to the user displays: Unable to Purchase Contact the developer for more information. [Environment: Sandbox]
My Implementation Details: Scenario: The user has an active monthly subscription and attempts to upgrade to a yearly subscription with a Promotional Offer (discount). Signature Generation: I use a custom backend written in Go to generate the signature, nonce, and timestamp. The code follows Apple’s documentation requirements, including proper encoding and formatting.
Client (iOS): On the Swift side, I correctly initialize the SKPaymentDiscount and add it to the SKMutablePayment before adding the payment to the queue. The applicationUsername property is used and matches on both server and client sides.
What I Have Already Verified and Ruled Out:
-
New Test Accounts: I have created multiple fresh sandbox tester accounts in different regions (USA, Canada, Germany) and used them.
-
Time Synchronization: The time on my server and the test device is synchronized.
-
Parameters: Bundle ID, Product ID, and Offer ID match exactly with the configurations in App Store Connect.
-
App Store Connect Agreements: The Paid Applications Agreement is active.
-
Testing Environment: Testing is conducted on a physical device (iPhone), not a simulator.
It seems the issue may not be related to my code but rather a potential glitch within the Apple sandbox environment itself when processing complex upgrade requests with a promotional offer.
Has anyone encountered a similar issue when testing Promotional Offers? I would appreciate any help or guidance.