Skip to content

Instantly share code, notes, and snippets.

@devjaime
Created April 2, 2021 15:33
Show Gist options
  • Select an option

  • Save devjaime/9613cd16a2ac9274a9113b58034aab0b to your computer and use it in GitHub Desktop.

Select an option

Save devjaime/9613cd16a2ac9274a9113b58034aab0b to your computer and use it in GitHub Desktop.
index.js Crear un cargo
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