UNPKG

types-apple-iap

Version:

Typescript typings for Apple in-app purchases.

60 lines 4.17 kB
"use strict"; // ----------------------------------- // Server to server notification // ----------------------------------- Object.defineProperty(exports, "__esModule", { value: true }); exports.AppleVerifyReceiptSuccessfulStatus = exports.AppleVerifyReceiptErrorCode = exports.AppleServerNotificationType = void 0; /** * The reason that Apple sent you a notification. * * [Reference](https://developer.apple.com/documentation/appstoreservernotifications/notification_type) */ var AppleServerNotificationType; (function (AppleServerNotificationType) { AppleServerNotificationType["CANCEL"] = "CANCEL"; AppleServerNotificationType["DID_CHANGE_RENEWAL_PREF"] = "DID_CHANGE_RENEWAL_PREF"; AppleServerNotificationType["DID_CHANGE_RENEWAL_STATUS"] = "DID_CHANGE_RENEWAL_STATUS"; AppleServerNotificationType["DID_FAIL_TO_RENEW"] = "DID_FAIL_TO_RENEW"; AppleServerNotificationType["DID_RECOVER"] = "DID_RECOVER"; AppleServerNotificationType["DID_RENEW"] = "DID_RENEW"; AppleServerNotificationType["INITIAL_BUY"] = "INITIAL_BUY"; AppleServerNotificationType["INTERACTIVE_RENEWAL"] = "INTERACTIVE_RENEWAL"; AppleServerNotificationType["PRICE_INCREASE_CONSENT"] = "PRICE_INCREASE_CONSENT"; AppleServerNotificationType["REFUND"] = "REFUND"; })(AppleServerNotificationType = exports.AppleServerNotificationType || (exports.AppleServerNotificationType = {})); // ----------------------------------- // Verify receipt // ----------------------------------- /** * All of the statuses that are not successful. Apple was not able to provide back receipt information. * * [Official Apple documentation](https://developer.apple.com/documentation/appstorereceipts/status) * * > Note: There may be many more error codes then these. These are ones that are documented but Apple says that there are also codes in the range 21100-21199 that could be returned. */ var AppleVerifyReceiptErrorCode; (function (AppleVerifyReceiptErrorCode) { AppleVerifyReceiptErrorCode[AppleVerifyReceiptErrorCode["NOT_POST"] = 21000] = "NOT_POST"; AppleVerifyReceiptErrorCode[AppleVerifyReceiptErrorCode["SHOULD_NOT_HAPPEN"] = 21001] = "SHOULD_NOT_HAPPEN"; AppleVerifyReceiptErrorCode[AppleVerifyReceiptErrorCode["INVALID_RECEIPT_OR_DOWN"] = 21002] = "INVALID_RECEIPT_OR_DOWN"; AppleVerifyReceiptErrorCode[AppleVerifyReceiptErrorCode["UNAUTHORIZED"] = 21003] = "UNAUTHORIZED"; AppleVerifyReceiptErrorCode[AppleVerifyReceiptErrorCode["WRONG_SHARED_SECRET"] = 21004] = "WRONG_SHARED_SECRET"; AppleVerifyReceiptErrorCode[AppleVerifyReceiptErrorCode["SERVICE_DOWN"] = 21005] = "SERVICE_DOWN"; AppleVerifyReceiptErrorCode[AppleVerifyReceiptErrorCode["USE_TEST_ENVIRONMENT"] = 21007] = "USE_TEST_ENVIRONMENT"; AppleVerifyReceiptErrorCode[AppleVerifyReceiptErrorCode["USE_PRODUCTION_ENVIRONMENT"] = 21008] = "USE_PRODUCTION_ENVIRONMENT"; AppleVerifyReceiptErrorCode[AppleVerifyReceiptErrorCode["APPLE_INTERNAL_ERROR"] = 21009] = "APPLE_INTERNAL_ERROR"; AppleVerifyReceiptErrorCode[AppleVerifyReceiptErrorCode["CUSTOMER_NOT_FOUND"] = 21010] = "CUSTOMER_NOT_FOUND"; })(AppleVerifyReceiptErrorCode = exports.AppleVerifyReceiptErrorCode || (exports.AppleVerifyReceiptErrorCode = {})); /** * All of the statuses that are successful. Apple is able to return back receipt information when any of these status codes occur. * * > Note: 0 means the receipt is valid. 21006 means it's valid, but the subscription is expired. You will still receive back a receipt decoded in the response with this status code. * * [Official Apple documentation](https://developer.apple.com/documentation/appstorereceipts/status) */ var AppleVerifyReceiptSuccessfulStatus; (function (AppleVerifyReceiptSuccessfulStatus) { AppleVerifyReceiptSuccessfulStatus[AppleVerifyReceiptSuccessfulStatus["SUCCESS"] = 0] = "SUCCESS"; AppleVerifyReceiptSuccessfulStatus[AppleVerifyReceiptSuccessfulStatus["VALID_BUT_SUBSCRIPTION_EXPIRED"] = 21006] = "VALID_BUT_SUBSCRIPTION_EXPIRED"; })(AppleVerifyReceiptSuccessfulStatus = exports.AppleVerifyReceiptSuccessfulStatus || (exports.AppleVerifyReceiptSuccessfulStatus = {})); //# sourceMappingURL=index.js.map