<?php

namespace KrokedilSwedbankPayDeps\SwedbankPay\Api\Service\Vipps\Request;

use KrokedilSwedbankPayDeps\SwedbankPay\Api\Service\Base\Request\Test as BaseTest;
use KrokedilSwedbankPayDeps\SwedbankPay\Api\Service\Vipps\Resource\Request\PaymentPayeeInfo;
use KrokedilSwedbankPayDeps\SwedbankPay\Api\Service\Vipps\Resource\Request\Payment;
use KrokedilSwedbankPayDeps\SwedbankPay\Api\Service\Vipps\Resource\Request\VippsPaymentObject;
use KrokedilSwedbankPayDeps\SwedbankPay\Api\Client\Exception;
class Test extends BaseTest
{
    /**
     * Test constructor.
     * @param string $accessToken
     * @param string $payeeId
     * @param bool $isTest
     * @throws Exception
     */
    public function __construct($accessToken, $payeeId, $isTest)
    {
        $payeeInfo = new PaymentPayeeInfo();
        $payeeInfo->setPayeeId($payeeId);
        $payment = new Payment();
        $payment->setOperation('Test')->setPayeeInfo($payeeInfo);
        $paymentObject = new VippsPaymentObject();
        $paymentObject->setPayment($payment);
        $request = new Purchase($paymentObject);
        $this->sendRequest($accessToken, $payeeId, $isTest, $request);
    }
}
