Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stripe-fire

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stripe-fire - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

security/rules.json

2

package.json
{
"name": "stripe-fire",
"version": "0.2.0",
"version": "0.2.1",
"description": "A Node.js module that handles Stripe API calls when data is added to a Firebase reference.",

@@ -5,0 +5,0 @@ "main": "lib/stripe-fire.js",

@@ -9,5 +9,6 @@ # StripeFire

StripeFire uses the following APIs:
* [Stripe API](https://stripe.com/docs/api/node)
* [Firebase API](https://www.firebase.com/docs/web/api/)
- [Stripe API](https://stripe.com/docs/api/node)
- [Firebase API](https://www.firebase.com/docs/web/api/)
## Installation

@@ -26,7 +27,8 @@

Each object accepts `ref`, `callback`, `accessToken`, and `alterRequest` parameters.
* `ref` *(required)*: An instance of a Firebase object or a string that points to a Firbase reference
* `callback` *(optional)*: A function which is called **after** a child is added to the specified reference *and* the API request is sent to Stripe; the function accepts two parameters: an error object and the Stripe object if the request is successful
* `accessToken` *(optional)*: A string or function which returns an access token to be sent with the Stripe API request (used for Stripe Connect); the function accepts one parameter: the data set in the Firebase child
* `alterRequest` *(optional)*: A function which is called **before** a request is sent to Stripe; the function accepts one parameter: the data set in the Firebase child
- `ref` *(required)*: An instance of a Firebase object or a string that points to a Firbase reference
- `callback` *(optional)*: A function which is called **after** a child is added to the specified reference *and* the API request is sent to Stripe; the function accepts two parameters: an error object and the Stripe object if the request is successful
- `accessToken` *(optional)*: A string or function which returns an access token to be sent with the Stripe API request (used for Stripe Connect); the function accepts one parameter: the data set in the Firebase child
- `alterRequest` *(optional)*: A function which is called **before** a request is sent to Stripe; the function accepts one parameter: the data set in the Firebase child
The reference should contain children which are all similar Stripe objects. Note the children names can be anything so long as they exist in parent objects.

@@ -198,3 +200,3 @@ For example, a refund child named `order1234` should have a corresponding charge child named `order1234`. This allows StripeFire to be agnostic about Stripe object ids.

// IMPORTANT: since id is reserved for retrieving objects this cannot be set in Firebase before being sent to Stripe
plan.id = plan.name;
planData.id = planData.name;
return planData;

@@ -213,2 +215,24 @@ });

});
```
## Security Reference
Make sure to secure Firebase with the proper rules to protect the Stripe data. Checkout the [Firebase Security API](https://www.firebase.com/docs/security/) for more details.
To easily get started building Firebase rules you can use the [Blaze Security Compiler](https://www.firebase.com/docs/security/).
```bash
$ npm install blaze_compiler
```
A sample [rules.yml](security/rules.yml) file has been provided as a boilerplate.
## Contributing
If you'd like to contribute to StripeFire, you'll need to run the following commands to get your environment set up:
```bash
$ git clone https://github.com/davidcaseria/StripeFire.git
$ cd StripeFire # go to the StripeFire directory
$ npm install -g mocha # globally install mocha test framework
$ npm install # locally install all dependencies
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc