Created
August 15, 2016 23:34
-
-
Save 1dolinski/60b39e6afae9391f08b5469651233845 to your computer and use it in GitHub Desktop.
This file contains 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
var stripe = require("stripe")( | |
"TEST_STRIPE_HERE" | |
); | |
class Charge { | |
constructor(opts = {}) { | |
this.amount = opts.amount; | |
this.currency = 'cad'; | |
this.customer = opts.customer; | |
this.description = opts.description; | |
} | |
} | |
var customerId = 'CUSTOMER_ID_HERE' | |
var charge = new Charge({amount: 675, customer: customerId, description: 'works'}) | |
stripe.charges.create(charge, function(err, charge) { | |
if(err) { | |
console.log(err); | |
return; | |
} | |
console.log(charge); | |
}); |
This file contains 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
Error: Stripe: Unknown arguments ([object Object]). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to POST function (outputs) { | |
return cleanString.replace(/\{([\s\S]+?)\}/g, function($0, $1) { | |
return encodeURIComponent(outputs[$1] || ''); | |
}); | |
}) | |
at Object.create (/Users/singleTests/node_modules/stripe/lib/StripeMethod.js:64:17) | |
at Object.<anonymous> (/Users//singleTests/stripeCharge.js:16:16) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment