node-iap-utils

1.0.3 • Public • Published

node-iap-utils - In-App Purchase Receipts validation on App Store

This package provides a simple function to validate IAP Receipts on App Store

installation

npm i --save node-iap-utils

usage

import iapReceiptValidator from 'node-iap-utils';
 
const password = 'b212549818ff42ecb65aa45c'; // Shared Secret from iTunes connect
const production = false; // use sandbox or production url for validation
const validateReceipt = iapReceiptValidator(password, production);
 
async validate(receiptData) {
    try {
        const validationData = await validateReceipt(receiptData);
 
        // check if Auto-Renewable Subscription is still valid
        // validationData['latest_receipt_info'][0].expires_date > today
    } catch(err) {
        console.log(err.valid, err.error, err.message)
    }
}

Drop-in Replacement for iap-receipt-validator that works as a NodeJS app.

Package Sidebar

Install

npm i node-iap-utils

Weekly Downloads

1

Version

1.0.3

License

ISC

Last publish

Collaborators

  • nomadgraphix