StatusTrait.php 468 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace app\common\service\pay\base;
  3. trait StatusTrait
  4. {
  5. protected bool $success = false;
  6. protected string $message = '';
  7. protected function setStatus(bool $success, string $message = '') : void
  8. {
  9. $this->success = $success;
  10. $this->message = $message;
  11. }
  12. function isSuccess() : bool
  13. {
  14. return $this->success;
  15. }
  16. function getMessage() : string
  17. {
  18. return $this->message;
  19. }
  20. }