How to use the payment.makePayment function in payment

To help you get started, we’ve selected a few payment examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hasura / 3factor-example / src / backend / localDevelopment.js View on Github external
app.post('/payment', async function (req, res) {
    res.setHeader('Access-Control-Allow-Origin', '*');
    res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
    res.setHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
    try {
        if (req.method == "OPTIONS") {
	    res.json("");
	    return;
        }
        var paymentReq = req.body;
        var result = await makePayment(paymentReq);
        res.json(result);
    } catch(e) {
        console.log(e);
        res.status(500).json(e.toString());
    }
});

payment

A general purpose library for building credit card forms, validating inputs and formatting numbers. Base on jquery.payment by @stripe, but without the jQuery.

MIT
Latest version published 5 months ago

Package Health Score

71 / 100
Full package analysis