<?php

namespace App\Generated\Controllers\V1;

use App\Generated\V1\Messages\Payment\FetchAppWechatPayParamsMessage;
use App\Generated\V1\Messages\Payment\GetCouponDetailMessage;
use App\Http\Controllers\Controller;
use App\Http\Services\V1\PaymentService;
use DB;
use App\Generated\V1\Messages\Payment\GetCouponListMessage;

class PaymentController extends Controller
{
    public $handler;

    public function __construct(PaymentService $handler)
    {
        $this->handler = $handler;
    }

    public function fetchAppWechatPayParams(FetchAppWechatPayParamsMessage $message)
    {
        $message->validateInput();
        $this->handler->fetchAppWechatPayParams($message);
        $message->validateOutput();
        return $message->getResponse();
    }

    public function getCouponDetail(GetCouponDetailMessage $message)
    {
        $message->validateInput();
        $this->handler->getCouponDetail($message);
        $message->validateOutput();
        return $message->getResponse();
    }

    public function getCouponList(GetCouponListMessage $message)
    {
        $message->validateInput();
        $this->handler->getCouponList($message);
        $message->validateOutput();
        return $message->getResponse();
    }

}
