Skip to content

Instantly share code, notes, and snippets.

@sebelga
Last active March 26, 2018 13:22
Show Gist options
  • Save sebelga/d0fbe1983596d7b5a091aadf2534f12a to your computer and use it in GitHub Desktop.
Save sebelga/d0fbe1983596d7b5a091aadf2534f12a to your computer and use it in GitHub Desktop.
const stripe = require('stripe')('sk_test_your-token');
async function processPayement(amount, source, description) {
let charge;
try {
charge = await stripe.charges.create({
amount,
source,
description,
currency: "usd"
});
} catch(e) {
// Error handling
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment