Skip to content

Instantly share code, notes, and snippets.

@sebelga
Created April 3, 2018 12:25
Show Gist options
  • Save sebelga/02f5397d0d8433924d766fbd75802a8f to your computer and use it in GitHub Desktop.
Save sebelga/02f5397d0d8433924d766fbd75802a8f to your computer and use it in GitHub Desktop.
const stripe = require('./vendors/stripe');
// No changes on the processPayement
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