I’d like to access a remote api using node.js.
Here is a code example:
Mollie = require('mollie-api-node');
mollie = new Mollie.API.Client;
mollie.setApiKey('test_JAf68QKVQBJg7gdkFECqT84pSzev5D');
mollie.payments.create({
amount: 10.00,
description: 'My first payment',
redirectUrl: 'https://webshop.example.org/order/12345/',
metadata: {
orderId: '12345'
}
}, function (payment) {
if (payment.error) {
console.error(payment.error);
return response.end();
}
/*
* Send the customer off to complete the payment.
*/
response.writeHead(302, {
Location: payment.getPaymentUrl()
});
return response.end();
});
Is this possible from either our workflow or OL Connect? I can't find a place to install the api currently.