How to use the @adyen/api-library.Client function in @adyen/api-library

To help you get started, we’ve selected a few @adyen/api-library 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 mrvautin / expressCart / routes / payments / adyen.js View on Github external
router.post('/checkout_action', async (req, res, next) => {
    const db = req.app.db;
    const config = req.app.config;
    const adyenConfig = common.getPaymentConfig();

    const client = new Client({
        apiKey: adyenConfig.apiKey,
        environment: adyenConfig.environment
    });
    const checkout = new CheckoutAPI(client);
    let response;
    try{
        response = await checkout.payments({
            shopperInteraction: 'Ecommerce',
            amount: {
                currency: adyenConfig.currency,
                value: numeral(req.session.totalCartAmount).format('0.00').replace('.', '')
            },
            paymentMethod: JSON.parse(req.body.payment),
            reference: adyenConfig.statementDescriptor,
            merchantAccount: adyenConfig.merchantAccount,
            shopperStatement: adyenConfig.statementDescriptor

@adyen/api-library

The Adyen API Library for NodeJS enables you to work with Adyen APIs.

MIT
Latest version published 3 days ago

Package Health Score

86 / 100
Full package analysis

Popular @adyen/api-library functions