# flow-stripe-component

> Stripe components designed to work with Flow SDK

Latest version **0.1.5** (published 2019-03-10) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install flow-stripe-component
pnpm add flow-stripe-component
yarn add flow-stripe-component
bun add flow-stripe-component
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2019-03-10 |
| First published | 2018-12-26 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 26.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Hackerbay Inc. |
| Maintainers | hackerbayadmin |
| Keywords | stripe, flow |

## Links

- npm: https://www.npmjs.com/package/flow-stripe-component
- Repository: https://github.com/FlowAppPlatform/flow-stripe-component
- Homepage: https://github.com/FlowAppPlatform/flow-stripe-component#readme
- Issues: https://github.com/FlowAppPlatform/flow-stripe-component/issues
- npm.io page: https://npm.io/package/flow-stripe-component

## Dependencies (5)

- [q](https://npm.io/package/q.md) ^1.5.1
- [stripe](https://npm.io/package/stripe.md) ^6.12.1
- [cross-env](https://npm.io/package/cross-env.md) ^5.2.0
- [card-validator](https://npm.io/package/card-validator.md) ^5.1.0
- [flow-platform-sdk](https://npm.io/package/flow-platform-sdk.md) ^1.3.1

## Recent versions

- 0.1.5 (latest) — 2019-03-10
- 0.1.3 — 2019-02-15
- 0.1.1 — 2018-12-26

## README

# Flow Stripe component
The component is designed using Flow SDK and implements Stripe's features.

*To get started, install the package in your NodeJS project*

```
npm i flow-stripe-component --save
```

*Use the component as below*

```javascript
// require the component
const Component = require('flow-stripe-component');

// create instance of the Charge component for example
const component = new Component.Charge();
```

*Provide stripe secret key*

```javascript
// this is routed to Stripe right away, we never store these
component.getProperty('secret_key').data = 'Your_Stripe_Secret_Key';
```

*Provide card details*

```javascript
// this is a test card, be sure to use your own
component.getProperty('card_number').data = '4242424242424242';
component.getProperty('cvc').data = '123';
component.getProperty('expiry_month').data = 11;
component.getProperty('expiry_year').data = 2021;
```

*Provide charge details*

```javascript
// this is required for the Charge component
component.getProperty('currency').data = 'usd';
component.getProperty('amount').data = 100;
```

*Listen in for port emit events*
```javascript
component.getPort('Success').onEmit(function(){
  // the charge was made
  // the server response can be accessed through the 'Data' property of the port
  let response = component.getPort('Success').getProperty('Data').data;
});

component.getPort('Error').onEmit(function(){
  // an error occured
  // the actual error can be accessed through the 'Data' property of the port
  let err = component.getPort('Error').getProperty('Data').data;
});
```

*Execute the component*
```javascript
// add the component to a graph before executing it
const Graph = require('flow-platform-sdk').Graph;
new Graph("graph-1").addComponent(component);

component.execute();
```

#### Conclusion

That's the Flow Stripe component.

If you are having trouble making charges,
- Check that you are using the correct card details
- Be sure your [Stripe secret key](https://dashboard.stripe.com/account/apikeys) is right.

---
_Source: https://npm.io/package/flow-stripe-component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
