Controller/PricingController.php
private function validatePostData($data)
    {
        $required = ['items', 'currency'];

        foreach ($required as $field) {
            if (!isset($data[$field]) && !is_null($data[$field])) {
                throw new PriceCalculationException($field . ' is required but not set properly');
            }
        }
    }
private function validatePostData($data)
    {
        $required = ['items', 'currency'];

        foreach ($required as $field) {
            if (!isset($data[$field]) && !is_null($data[$field])) {
                throw new PriceCalculationException($field . ' is required but not set properly');
            }
        }
    }
private function validatePostData ( $ data ) { $ required = [ 'items' , 'currency' ] ; foreach ( $ required as $ field ) { if ( ! isset ( $ data [ $ field ] ) && ! is_null ( $ data [ $ field ] ) ) { throw new PriceCalculationException ( $ field . ' is required but not set properly' ) ; } } }
Checks if all necessary data for post request is set.

@param array $data

@throws PriceCalculationException
Checks if all necessary data for post request is set .