-
-
Save devjaime/9613cd16a2ac9274a9113b58034aab0b to your computer and use it in GitHub Desktop.
index.js Crear un cargo
This file contains hidden or 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
| exports.createCharge = functions.https.onRequest((req, res) => { | |
| cors(req, res, async () => { | |
| // TODO get real product data from database | |
| const chargeData = { | |
| name: 'Widget', | |
| description: 'Usando una pasarela de prueba', | |
| local_price: { | |
| amount: 9.99, | |
| currency: 'USD', | |
| }, | |
| pricing_type: 'fixed_price', | |
| metadata: { | |
| user: 'devjaime', | |
| }, | |
| }; | |
| const charge = await Charge.create(chargeData); | |
| console.log(charge); | |
| res.send(charge); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment