INNER CODE UNIT · JavaScript

getOptions

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

const getOptions = orderId =>
	Promise.all([
		OrdersService.getSingleOrder(orderId),
		SettingsService.getSettings()
	]).then(([order, settings]) => {
		if (order && order.payment_method_id) {
			return PaymentGatewaysService.getGateway(
				order.payment_method_gateway
			).then(gatewaySettings => {
				const options = {
					gateway: order.payment_method_gateway,
					gatewaySettings,
					order,
					amount: order.grand_total,
					currency: settings.currency_code
				};

				return options;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…