Comparing version 3.0.1 to 3.0.2
@@ -12,3 +12,3 @@ const extpay = ExtPay('ureview') | ||
} else { | ||
// extpay.openTrialPage() | ||
extpay.openTrialPage() | ||
extpay.openPaymentPage() | ||
@@ -15,0 +15,0 @@ } |
importScripts('ExtPay.js') | ||
const extpay = ExtPay('ureview') | ||
const extpay = ExtPay('monthly-to-yearly-test-3') | ||
extpay.startBackground(); | ||
@@ -30,3 +30,3 @@ | ||
chrome.storage.local.get('foo', function() { | ||
const extpay = ExtPay('derp-extension'); | ||
const extpay = ExtPay('monthly-to-yearly-test-3') | ||
@@ -33,0 +33,0 @@ extpay.getUser().then(function(user) { |
@@ -1,2 +0,2 @@ | ||
const extpay = ExtPay('ureview') | ||
const extpay = ExtPay('monthly-to-yearly-test-3') | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
const extpay = ExtPay('ureview') | ||
const extpay = ExtPay('monthly-to-yearly-test-3') | ||
@@ -3,0 +3,0 @@ |
{ | ||
"name": "extpay", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "The JavaScript library for https://extensionpay.com - payments for browser extensions, no server needed.", | ||
"main": "./dist/ExtPay.common.js", | ||
"module": "./dist/ExtPay.module.js", | ||
"browser": "./dist/ExtPay.js", | ||
"unpkg": "./dist/ExtPay.js", | ||
@@ -9,0 +8,0 @@ "jsdelivr": "./dist/ExtPay.js", |
# ExtPay.js — Payments in browser extensions | ||
The JavaScript library for [ExtensionPay.com](https://extensionpay.com), a service to easily add payments to browser extensions without running your own server backend. | ||
The JavaScript library for [ExtensionPay.com](https://extensionpay.com), a service to easily add payments to browser extensions. | ||
```js | ||
// Example code | ||
// your-extension/background.js | ||
const extpay = ExtPay('your-extension-id'); | ||
extpay.startBackground(); | ||
extpay.getUser().then(user => { | ||
if (user.paid) { | ||
// ... | ||
} else { | ||
extpay.openPaymentPage() | ||
} | ||
}) | ||
``` | ||
Below are directions for using this library in your browser extension. If you learn better by example, you can also view the code for a **[sample extension](sample-extension-mv3/)**. This library uses [Mozilla's webextension-polyfill library](https://github.com/mozilla/webextension-polyfill) internally for compatability across browsers which means it should work on almost all modern browsers. | ||
@@ -197,3 +212,3 @@ | ||
Note: please read the [detailed docs on subscriptions here](/docs/how_subscriptions_work.md). | ||
Note: please read the **[detailed docs on subscriptions here](/docs/how_subscriptions_work.md)**. | ||
@@ -200,0 +215,0 @@ |
# [ExtensionPay.com](https://extensionpay.com) Sample Extension | ||
This is the [ExtensionPay](https://extensionpay.com) Manifest v3 sample extension. Use this as a template or minimal example of how to use the [ExtPay JavaScript library](../) in your extension. | ||
This is the [ExtensionPay](https://extensionpay.com) Manifest v3 sample extension. Use this as a template or minimal example of how to use the [ExtPay JavaScript library](/README.md) in your extension. | ||
To play with this extension, install it and click the extension icon to open the popup. | ||
### To install on Chrome | ||
Open [chrome://extensions/](chrome://extensions/) and make sure `Developer Mode` is enabled in the top right corner. Then click the `Load unpacked` button and navigate to the sample extension folder. Once installed, click the extension's icon ("E") in the browser's top right toolbar to see popup.html. (It may be in the "puzzle piece" menu.) | ||
### Change the extension ID to test payments | ||
You'll need to sign up for an account and register an extension on [ExtensionPay.com](https://extensionpay.com) to test payments. | ||
Once you've done that, change the extension ID from `sample-extension` to your extension's ID in `background.js` and `popup.js`. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
261
22
4230666