Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

76
Vistas
Coinbase - put checkout Id in success page link when creating a charge

So when I am specifying the success page link when creating a charge I want to put the id in the link so I can retrieve the data from the checkout session

This is my code:

    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)
    })

And I want to make something like this

    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)
    })
7 months ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos