voltrue2 / in-app-purchase

A Node.js module for in-App-Purchase for iOS, Android, Amazon and Windows.
http://iap.gracenode.org
Other
1.04k stars 287 forks source link

paymentState not found in subscription validation response #313

Open ManalLiaquat opened 4 years ago

ManalLiaquat commented 4 years ago

Hello! I want paymentState in validation response for auto-renewable subscription, to check that subscription is in a trial period or not. Can I get this object in response as in the official docs.

My Code:

iap.config({
        verbose: true,
        test: true,
        appleExcludeOldTransactions: true, // if you want to exclude old transaction, set this to true. Default is false
        applePassword: ApplePass,
        googlePublicKeyStrLive: GooglePublicKey,
    });

iap.setup((error)=>{
                if (error) {
            console.log("SETEP_ERROR ========>", error);
            return;
        }
                iap.validate(service, receipt, (vError, validationResponse)=>{
                    if(iap.isValidated(validationResponse)){
                             const availablePurcheses = iap.getPurchaseData(validationResponse, {
                ignoreCanceled: false,
                ignoreExpired: false
            });
                     }
                });
});

Similar Issues don't help me! #94 #124

prundianudaniel commented 4 years ago

same here any news on this? @ManalLiaquat ?