Testing Promotional offer purchase in sandbox environment, error reported below:
Purchase did not return a transaction: Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo={NSUnderlyingError=0x282752dc0 {Error Domain=AMSErrorDomain Code=301 "Invalid Status Code" UserInfo={NSLocalizedDescription=Invalid Status Code, AMSURL=https://sandbox.itunes.apple.com/WebObjects/MZBuy.woa/wa/inAppBuy?REDACTED, AMSStatusCode=500, NSLocalizedFailureReason=The response has an invalid status code}}, storefront-country-code=JPN, client-environment-type=Sandbox}
The steps are as follows:
- Receive the nonce, signature, and timestamp from our app server.
- However, the error occurred when I initiated a purchase request.
let result = try await product.purchase(options:[.promotionalOffer(offerID: offerID, keyID: keyID, nonce: nonce, signature: signature, timestamp:timestamp)])
switch result {
case .success(let verificationResult):
switch verificationResult {
case .verified(let transaction):
return .success(transaction)
case .unverified(let transaction, _):
return .unverified(transaction)
}
case .userCancelled:
return .userCancelled
case .pending:
return .pending
@unknown default:
return .other(detail: "unknown error")
}
Is it because promotional offers cannot be tested in the sandbox environment?