src/Genesis/API/Request/WPF/Create.php
protected function verifyTransactionType($transactionType, $parameters = [])
    {
        if (!Types::isValidWPFTransactionType($transactionType)) {
            throw new \Genesis\Exceptions\ErrorParameter(
                sprintf(
                    'Transaction type (%s) is not valid. Valid WPF transactions are: %s.',
                    $transactionType,
                    implode(', ', Types::getWPFTransactionTypes())
                )
            );
        }

        $txnCustomRequiredParams = Types::getCustomRequiredParameters(
            $transactionType
        );

        if (!CommonUtils::isValidArray($txnCustomRequiredParams)) {
            return;
        }

        $txnCustomRequiredParams = static::validateNativeCustomParameters($transactionType, $txnCustomRequiredParams);

        if (CommonUtils::isValidArray($txnCustomRequiredParams) && !CommonUtils::isValidArray($parameters)) {
            throw new \Genesis\Exceptions\ErrorParameter(
                sprintf(
                    'Custom transaction parameters (%s) are required and none are set.',
                    implode(', ', array_keys($txnCustomRequiredParams))
                )
            );
        }

        foreach ($txnCustomRequiredParams as $customRequiredParam => $customRequiredParamValues) {
            $this->validateRequiredParameter(
                $transactionType,
                $customRequiredParam,
                $customRequiredParamValues,
                $parameters
            );
        }
    }
protected function verifyTransactionType($transactionType, $parameters = [])
    {
        if (!Types::isValidWPFTransactionType($transactionType)) {
            throw new \Genesis\Exceptions\ErrorParameter(
                sprintf(
                    'Transaction type (%s) is not valid. Valid WPF transactions are: %s.',
                    $transactionType,
                    implode(', ', Types::getWPFTransactionTypes())
                )
            );
        }

        $txnCustomRequiredParams = Types::getCustomRequiredParameters(
            $transactionType
        );

        if (!CommonUtils::isValidArray($txnCustomRequiredParams)) {
            return;
        }

        $txnCustomRequiredParams = static::validateNativeCustomParameters($transactionType, $txnCustomRequiredParams);

        if (CommonUtils::isValidArray($txnCustomRequiredParams) && !CommonUtils::isValidArray($parameters)) {
            throw new \Genesis\Exceptions\ErrorParameter(
                sprintf(
                    'Custom transaction parameters (%s) are required and none are set.',
                    implode(', ', array_keys($txnCustomRequiredParams))
                )
            );
        }

        foreach ($txnCustomRequiredParams as $customRequiredParam => $customRequiredParamValues) {
            $this->validateRequiredParameter(
                $transactionType,
                $customRequiredParam,
                $customRequiredParamValues,
                $parameters
            );
        }
    }
protected function verifyTransactionType ( $ transactionType , $ parameters = [ ] ) { if ( ! Types :: isValidWPFTransactionType ( $ transactionType ) ) { throw new \ Genesis \ Exceptions \ ErrorParameter ( sprintf ( 'Transaction type (%s) is not valid. Valid WPF transactions are: %s.' , $ transactionType , implode ( ', ' , Types :: getWPFTransactionTypes ( ) ) ) ) ; } $ txnCustomRequiredParams = Types :: getCustomRequiredParameters ( $ transactionType ) ; if ( ! CommonUtils :: isValidArray ( $ txnCustomRequiredParams ) ) { return ; } $ txnCustomRequiredParams = static :: validateNativeCustomParameters ( $ transactionType , $ txnCustomRequiredParams ) ; if ( CommonUtils :: isValidArray ( $ txnCustomRequiredParams ) && ! CommonUtils :: isValidArray ( $ parameters ) ) { throw new \ Genesis \ Exceptions \ ErrorParameter ( sprintf ( 'Custom transaction parameters (%s) are required and none are set.' , implode ( ', ' , array_keys ( $ txnCustomRequiredParams ) ) ) ) ; } foreach ( $ txnCustomRequiredParams as $ customRequiredParam => $ customRequiredParamValues ) { $ this -> validateRequiredParameter ( $ transactionType , $ customRequiredParam , $ customRequiredParamValues , $ parameters ) ; } }
Verify that transaction type parameters are populated correctly

@param string $transactionType
@param array $parameters
@throws \Genesis\Exceptions\ErrorParameter
Verify that transaction type parameters are populated correctly