https://github.com/bitfinexcom/dazaar-payment
https://github.com/bitfinexcom/dazaar-payment
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/bitfinexcom/dazaar-payment
- Owner: bitfinexcom
- License: mit
- Created: 2019-08-27T14:44:31.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-20T20:21:46.000Z (almost 6 years ago)
- Last Synced: 2024-04-29T15:06:31.721Z (about 2 years ago)
- Language: JavaScript
- Size: 34.2 KB
- Stars: 6
- Watchers: 4
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @dazaar/payment
Dazaar payment manager.
```
npm install dazaar-payment
```
Supports EOS and free payments.
## Usage
``` js
const Payment = require('@dazaar/payment')
const pay = new Payment(seller, [{
// dazaar card payment entry
currency: 'EOS',
...
}])
```
## API
#### `pay.validate(remoteKey, done)`
Validate if a remote key can access a sellers stream.
Returns an info object describing the state of the subscription.
#### `pay.destroy()`
Destroy the payment provider.
#### `pay.metadata(buyerKey)`
Returns a metadata string you should attach as the memo/userdata when
doing a payment yourself.
#### `pay.providers`
An array of payment providers, each corresponding to the payment entry passed in the constructor.
If the payment was not support it might contain null.
#### `provider.buy(buyerKey, amount, authentication, cb)`
Convenience method to buy access to a stream using the provider.
## License
MIT