StoreKit Promotional Offer Purchase Failure - 'Unable to Purchase' Alert in Xcode

Hi everyone,

I'm encountering an issue while testing a subscription purchase with a promotional offer using StoreKit in the Xcode debug environment. I’ve created a subscription in the StoreKit configuration file and added a promotional offer. However, when I attempt to make a purchase with the promotional offer, the process fails, and I receive an alert with the message:

"Unable to purchase" "Contact the developer for more information."

Here’s the error that is printed in the Xcode logs:

Purchase did not return a transaction: Error Domain=ASDErrorDomain Code=3903 "Received failure in response from Xcode" UserInfo={NSDebugDescription=Received failure in response from Xcode, NSUnderlyingError=0x303346b50 {Error Domain=AMSErrorDomain Code=305 "Server Error" UserInfo={NSLocalizedDescription=Server Error, AMSServerErrorCode=3903, AMSServerPayload={
    "cancel-purchase-batch" = 1;
    dialog =     {
        defaultButton = ok;
        explanation = "Contact the developer for more information.\n\n[Environment: Xcode]";
        initialCheckboxValue = 1;
        "m-allowed" = 0;
        message = "Unable to Purchase";
        okButtonString = OK;
    };
    dsid = 17322632127;
    failureType = 3903;
    jingleAction = inAppBuy;
    jingleDocType = inAppSuccess;
    pings =     (
    );
}, AMSURL=http://localhost:49300/WebObjects/MZBuy.woa/wa/inAppBuy, AMSStatusCode=200, NSLocalizedFailureReason=The server encountered an error}}}

Has anyone encountered a similar issue, or does anyone have insights into what might be causing this? I’m using StoreKit 2 methods for handling subscriptions, and this error only occurs when attempting to apply the promotional offer. Any help or suggestions would be greatly appreciated!

Thanks in advance!

You either have an invalid signature or are missing key parameters. Be sure to validate your signature as described in Validate locally and encode the signature.

When using StoreKit Testing in Xcode, you need to provide a Subscription Offers key that you use for signing a subscription offer in the test environment. Use this key instead of your regular key to generate the signature on your server. See Generating a signature for promotional offers and Testing in-app purchases with StoreKit transaction manager in Xcode for more information.

StoreKit Promotional Offer Purchase Failure - 'Unable to Purchase' Alert in Xcode
 
 
Q