Last active
March 26, 2018 13:22
-
-
Save sebelga/d0fbe1983596d7b5a091aadf2534f12a 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
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