INNER CODE UNIT · JavaScript
paymentNotification
Cezerin2/Server · src/paymentGateways/index.js:44
const paymentNotification = (req, res, gateway) =>
PaymentGatewaysService.getGateway(gateway).then(gatewaySettings => {
const options = {
gateway,
gatewaySettings,
req,
res
};
switch (gateway) {
case 'paypal-checkout':
return PayPalCheckout.paymentNotification(options);
case 'liqpay':
return LiqPay.paymentNotification(options);
default:
return Promise.reject('Invalid gateway');
}
});