2.0.1 • Published 8 years ago

itsa-mollie-payment-promise v2.0.1

Weekly downloads
1
License
New BSD
Repository
github
Last release
8 years ago

mollie-payment-promise

Promise-wrapper arround mollie-api-node for internet payments You can use the

See Mollie Payment

var Mollie = require('itsa-mollie-payment-promise'),
    MOLLIE_API = 'your_api',
    mollie = new Mollie(MOLLIE_API),
    orderConfig, orderId;
    redirectUrl: 'http://' + request.headers.host + '/bestelling-afronden/' + orderid,

app.get('/order', function(request, response)
    var orderId = request.params.orderid,
        domain = request.headers.host,
        amount = request.params.amount, // DO NOT use request-data, but calculate from your database
        orderConfig;

    orderConfig = {
        amount: amount,
        description: 'Your order at '+domain,
        method: mollie.methods.CREDITCARD,
        redirectUrl: 'https://' + domain + '/complete-order/' + orderid,
        metadata: {
            orderid: orderid
        }
    };

    mollie.sendPayment(orderConfig).then(function(paymentURL) {
        response.redirect(paymentURL);
    });
};
2.0.1

8 years ago

2.0.0

8 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.1

10 years ago