Last active
March 7, 2020 15:07
-
-
Save Joe8Bit/cfcc83f702a154251acf7ba617c855b5 to your computer and use it in GitHub Desktop.
Example store - Banked API request
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 Banked = require('@banked/node') | |
// -- snip | |
const banked = new Banked({ | |
api_key: process.env.BANKED_API_KEY, | |
secret_key: process.env.BANKED_API_SECRET | |
}) | |
// -- snip | |
app.post('/checkout', async function (req, res) { | |
try { | |
const bankedResponse = await banked.payments.create(req.body) | |
res.send({ | |
url: bankedResponse.data.url | |
}) | |
} catch (e) { | |
console.error(e) | |
} | |
}) | |
// -- snip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment