original_string: protected function validatePaymentOrder()
      {
          $field = 'payment';
  
          if ($this->isExcluded($field)) {
              return null;
          }
  
          $value = $this->getSubmitted($field);
  
          if ($this->isUpdating() && !isset($value)) {
              $this->unsetSubmitted($field);
              return null;
          }
  
          $label = $this->translation->text('Payment');
  
          if (empty($value)) {
              $this->setErrorRequired($field, $label);
              return false;
          }
  
          $method = $this->payment->get($value);
  
          if (empty($method['status'])) {
              $this->setErrorUnavailable($field, $label);
              return false;
          }
  
          return true;
      }
code: protected function validatePaymentOrder()
      {
          $field = 'payment';
  
          if ($this->isExcluded($field)) {
              return null;
          }
  
          $value = $this->getSubmitted($field);
  
          if ($this->isUpdating() && !isset($value)) {
              $this->unsetSubmitted($field);
              return null;
          }
  
          $label = $this->translation->text('Payment');
  
          if (empty($value)) {
              $this->setErrorRequired($field, $label);
              return false;
          }
  
          $method = $this->payment->get($value);
  
          if (empty($method['status'])) {
              $this->setErrorUnavailable($field, $label);
              return false;
          }
  
          return true;
      }
code_tokens: protected function validatePaymentOrder ( ) { $ field = 'payment' ; if ( $ this -> isExcluded ( $ field ) ) { return null ; } $ value = $ this -> getSubmitted ( $ field ) ; if ( $ this -> isUpdating ( ) && ! isset ( $ value ) ) { $ this -> unsetSubmitted ( $ field ) ; return null ; } $ label = $ this -> translation -> text ( 'Payment' ) ; if ( empty ( $ value ) ) { $ this -> setErrorRequired ( $ field , $ label ) ; return false ; } $ method = $ this -> payment -> get ( $ value ) ; if ( empty ( $ method [ 'status' ] ) ) { $ this -> setErrorUnavailable ( $ field , $ label ) ; return false ; } return true ; }
docstring: Validates a payment method
  @return boolean|null
docstring_tokens: Validates a payment method