PaymentController.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace App\Generated\Controllers\V1_1;
  3. use App\Http\Controllers\Controller;
  4. use App\Generated\V1_1\Messages\Payment\GetCouponListMessage;
  5. use App\Generated\V1_1\Messages\Payment\GetCouponDetailMessage;
  6. use App\Http\Services\V1_1\PaymentService;
  7. use App\Generated\V1_1\Messages\Payment\FetchAppWechatPayParamsMessage;
  8. use DB;
  9. class PaymentController extends Controller
  10. {
  11. public $handler;
  12. public function __construct(PaymentService $handler)
  13. {
  14. $this->handler = $handler;
  15. }
  16. public function fetchAppWechatPayParams(FetchAppWechatPayParamsMessage $message)
  17. {
  18. $message->validateInput();
  19. $this->handler->fetchAppWechatPayParams($message);
  20. $message->validateOutput();
  21. return $message->getResponse();
  22. }
  23. public function getCouponDetail(GetCouponDetailMessage $message)
  24. {
  25. $message->validateInput();
  26. $this->handler->getCouponDetail($message);
  27. $message->validateOutput();
  28. return $message->getResponse();
  29. }
  30. public function getCouponList(GetCouponListMessage $message)
  31. {
  32. $message->validateInput();
  33. $this->handler->getCouponList($message);
  34. $message->validateOutput();
  35. return $message->getResponse();
  36. }
  37. }