Hello am using coinpayment api for accepting crypto coins in my site but don't know how i can add a get route which i can link to a button where a client clicks to be redirected to a page where the address and amount is shown to them. Am new to using this api. but i really need it. Any way to archieve this
var express = require("express"),
app = express(),
bodyparser = require("body-parser"),
coinpayments = require("coinpayments"),
app.use(bodyParser.urlencoded({extended: true}));
var client = new Coinpayments({
key: "My API PUBLIC KEY",
secret: "MY API SECRET KEY"
});
app.get('the url for the transaction page', function(req,res){
res.render(the url)
*then the createTransaction function is called*
client.createTransaction({'currency1' : 'DOGE', 'currency2' : 'POT', 'amount' : 10},function(err,result){
console.log(result);
})
})
every thing works well but i don't have a knowledge of integrating it into a get link so that when a client hits on it, it will redirect them to the transaction page
{ amount: '0.41899981',
txn_id: 'CPCB7BFRNZ6XCMR1FJDUUKCDNP',
address: 'PUXds8akQMe9xMYtEftcMnirhZpUNyK6ER',
confirms_needed: '5',
timeout: 3600,
status_url: 'https://www.coinpayments.net/index.php?cmd=status&id=CPCB7BFRNZ6XCMR1FJDUUKCDNP&key=828dba80bdc1a7a6fb78443f32e3e094',
qrcode_url: 'https://www.coinpayments.net/qrgen.php?id=CPCB7BFRNZ6XCMR1FJDUUKCDNP&key=828dba80bdc1a7a6fb78443f32e3e094' }
The status_url is the transaction url, thats the link i want the user to be redirected to