code: public function setState($state)
      {
          $allowed_values = array('authorised', 'captured', 'cancelled', 'refunded', 'declined');
          if ((!in_array($state, $allowed_values))) {
              throw new \InvalidArgumentException("Invalid value for 'state', must be one of 'authorised', 'captured', 'cancelled', 'refunded', 'declined'");
          }
          $this->container['state'] = $state;
  
          return $this;
      }
docs: Sets state
  @param string $state
  @return $this