INNER CODE UNIT · JavaScript

getPaymentFormSettings

Cezerin2/Server · src/paymentGateways/index.js:30

const getPaymentFormSettings = orderId =>
	getOptions(orderId).then(options => {
		switch (options.gateway) {
			case 'paypal-checkout':
				return PayPalCheckout.getPaymentFormSettings(options);
			case 'liqpay':
				return LiqPay.getPaymentFormSettings(options);
			case 'stripe-elements':
				return StripeElements.getPaymentFormSettings(options);
			default:
				return Promise.reject('Invalid gateway');
		}
	});

const paymentNotification = (req, res, gateway) =>
	PaymentGatewaysService.getGateway(gateway).then(gatewaySettings => {
		const options = {
			gateway,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…