Entonces, cuando estoy especificando el enlace de la página de éxito al crear un cargo, quiero poner la identificación en el enlace para poder recuperar los datos de la sesión de pago.
Este es mi código:
app.get('/checkout', async (req, res) => { const chargeData = { name: 'test', local_price: { amount: '1.00', currency: 'USD' }, pricing_type: 'fixed_price', redirect_url: 'http://localhost:3000/order', cancel_url: 'http://localhost:3000/cancel' } const charge = await Charge.create(chargeData) res.send(charge) })
Y quiero hacer algo como esto.
app.get('/checkout', async (req, res) => { const chargeData = { name: 'test', local_price: { amount: '1.00', currency: 'USD' }, pricing_type: 'fixed_price', redirect_url: 'http://localhost:3000/order?id=/*checkout id*/', cancel_url: 'http://localhost:3000/cancel' } const charge = await Charge.create(chargeData) res.send(charge) })