Created
August 15, 2016 23:27
-
-
Save 1dolinski/e67d077661af47dd89ef07dbff607b2f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const stripeProvider = require('../helpers/providers-stripe'); | |
| module.exports = class Charge { | |
| constructor(opts = {}) { | |
| this.amount = opts.amount; | |
| this.currency = 'cad'; | |
| this.customer = opts.customer; | |
| this.description = opts.description; | |
| } | |
| execute() { | |
| const self = this; | |
| return new Promise((resolve, reject) => { | |
| stripeProvider.charges.create(self, (err, charge) => { | |
| if (err) { | |
| reject(err); | |
| return; | |
| } | |
| resolve(charge); | |
| }); | |
| }); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment