public static function code($constant)
    {
        $ref = new \ReflectionClass('\PayPay\Structure\PaymentMethodCode');
        $constants = $ref->getConstants();
        if (!isset($constants[$constant])) {
            throw new \InvalidArgumentException("Invalid payment method code constant " . $constant);
        }

        return $ref->getConstant($constant);
    }