protected function validateResponseOnSuccess(PaymentTransaction $paymentTransaction, Response $response)
    {
        if ($response->getType() !== static::$successResponseType)
        {
            throw new ValidationException("Response type '{$response->getType()}' does not match " .
                                          "success response type '" . static::$successResponseType . "'");
        }

        $missedFields   = array();

        foreach (static::$responseFieldsDefinition as $fieldName)
        {
            if (empty($response[$fieldName]))
            {
                $missedFields[] = $fieldName;
            }
        }

        if (!empty($missedFields))
        {
            throw new ValidationException("Some required fields missed or empty in Response: " .
                                          implode(', ', $missedFields) . ". \n");
        }

        $this->validateClientId($paymentTransaction, $response);
    }
protected function validateResponseOnSuccess(PaymentTransaction $paymentTransaction, Response $response)
    {
        if ($response->getType() !== static::$successResponseType)
        {
            throw new ValidationException("Response type '{$response->getType()}' does not match " .
                                          "success response type '" . static::$successResponseType . "'");
        }

        $missedFields   = array();

        foreach (static::$responseFieldsDefinition as $fieldName)
        {
            if (empty($response[$fieldName]))
            {
                $missedFields[] = $fieldName;
            }
        }

        if (!empty($missedFields))
        {
            throw new ValidationException("Some required fields missed or empty in Response: " .
                                          implode(', ', $missedFields) . ". \n");
        }

        $this->validateClientId($paymentTransaction, $response);
    }
protected function validateResponseOnSuccess ( PaymentTransaction $ paymentTransaction , Response $ response ) { if ( $ response -> getType ( ) !== static :: $ successResponseType ) { throw new ValidationException ( "Response type '{$response->getType()}' does not match " . "success response type '" . static :: $ successResponseType . "'" ) ; } $ missedFields = array ( ) ; foreach ( static :: $ responseFieldsDefinition as $ fieldName ) { if ( empty ( $ response [ $ fieldName ] ) ) { $ missedFields [ ] = $ fieldName ; } } if ( ! empty ( $ missedFields ) ) { throw new ValidationException ( "Some required fields missed or empty in Response: " . implode ( ', ' , $ missedFields ) . ". \n" ) ; } $ this -> validateClientId ( $ paymentTransaction , $ response ) ; }
Validates response before payment transaction updating
if payment transaction is processing or approved

@param       PaymentTransaction      $paymentTransaction     Payment transaction
@param       Response                $response               Response for validating
Validates response before payment transaction updating if payment transaction is processing or approved