ShippingEligibilityChecker

ShippingEligibilityChecker

The ShippingEligibilityChecker class is used to check whether an order qualifies for a given ShippingMethod.

Signature

class ShippingEligibilityChecker<T extends ShippingEligibilityCheckerArgs = {}> implements ConfigurableOperationDef {
  readonly code: string;
  readonly description: string;
  readonly args: ShippingEligibilityCheckerArgs;
  constructor(config: {
        args: T;
        check: CheckShippingEligibilityCheckerFn<T>;
        code: string;
        description: string;
    })
  check(order: Order, args: ConfigArg[]) => boolean | Promise<boolean>;
}

Members

code

property
type:
string

description

property
type:
string

args

property
type:
ShippingEligibilityCheckerArgs

constructor

method
type:
(config: { args: T; check: CheckShippingEligibilityCheckerFn<T>; code: string; description: string; }) => ShippingEligibilityChecker

check

method
type:
(order: Order, args: ConfigArg[]) => boolean | Promise<boolean>

Check the given Order to determine whether it is eligible.

alpha