https://github.com/sibelius/iap-receipt-validator
Validate In-App Purchases (IAP) on App Store using fetch and es6/7
https://github.com/sibelius/iap-receipt-validator
iap in-app-receipt
Last synced: 19 days ago
JSON representation
Validate In-App Purchases (IAP) on App Store using fetch and es6/7
- Host: GitHub
- URL: https://github.com/sibelius/iap-receipt-validator
- Owner: sibelius
- License: mit
- Created: 2016-06-20T11:04:15.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-25T08:05:07.000Z (over 2 years ago)
- Last Synced: 2025-04-30T15:23:52.079Z (19 days ago)
- Topics: iap, in-app-receipt
- Language: JavaScript
- Size: 315 KB
- Stars: 99
- Watchers: 6
- Forks: 25
- Open Issues: 38
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iap-receipt-validation - In-App Purchase Receipts validation on App Store
This package provides a simple function to validate IAP Receipts on App Store
## installation
```sh
npm i --save iap-receipt-validator
```## usage
```js
import iapReceiptValidator from 'iap-receipt-validator';const password = 'b212549818ff42ecb65aa45c'; // Shared Secret from iTunes connect
const isProduction = false; // true = prod, false = sandbox
const validateReceipt = iapReceiptValidator(password, isProduction);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)
}
}
```---
kickstarted by [npm-boom][npm-boom][npm-boom]: https://github.com/reergymerej/npm-boom