how to fix return bad return status on requestPurchaseAsync(storeId)

Jean-François Faure 0 Reputation points
2023-11-08T17:40:59.2966667+00:00

In JavaScript, the code to purchase an in-app item is:

	storeContext.requestPurchaseAsync(storeId).done(function (result) {
		if (result.extendedError) {
			inAppTools.Error(result.extendedError);
				return;
			}
// The Store module to purchase is not loaded and the  extendedError = 0 and the result.Status = 2

the result.status is 2, value which is not listed in the status codes error. The default message recommanded by microsoft in this cas is: "Product was not purchased due to an unknown error ." I do not find any message from Microsoft that says the purchase protocol has been modified. Where could be the error ? Knowing the storeID has been checked and is correct? Thank you for your help.

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
1,008 questions
Microsoft Partner Center
Microsoft Partner Center
A Microsoft website for partners that provides access to product support, a partner community, and other partner services.
1,030 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.