Completed
Push — master ( afa46a...04583c )
by Joachim
02:00
created

PaymentHandlerTest::testCapture()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 8.9713
c 0
b 0
f 0
cc 1
eloc 15
nc 1
nop 0
1
<?php
2
3
namespace Loevgaard\DandomainAltapayBundle\Tests\Handler;
4
5
use Loevgaard\AltaPay\Client;
6
use Loevgaard\AltaPay\Entity\Transaction;
7
use Loevgaard\AltaPay\Payload\OrderLine;
8
use Loevgaard\AltaPay\Payload\RefundCapturedReservation as RefundCapturedReservationPayload;
9
use Loevgaard\AltaPay\Response\CaptureReservation as CaptureReservationResponse;
10
use Loevgaard\AltaPay\Response\RefundCapturedReservation as RefundCapturedReservationResponse;
11
use Loevgaard\DandomainAltapayBundle\Entity\Payment;
12
use Loevgaard\DandomainAltapayBundle\Entity\PaymentLine;
13
use Loevgaard\DandomainAltapayBundle\Handler\PaymentHandler;
14
use Loevgaard\DandomainAltapayBundle\Manager\PaymentManager;
15
use PHPUnit\Framework\TestCase;
16
17
final class PaymentHandlerTest extends TestCase
18
{
19
    public function testCapture()
20
    {
21
        $payment = $this->getPayment();
22
        $payment->setAltapayId('altapayid');
0 ignored issues
show
Bug introduced by
The method setAltapayId does only exist in Loevgaard\DandomainAltapayBundle\Entity\Payment, but not in PHPUnit_Framework_MockObject_MockObject.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
23
24
        $altapayClient = $this->getAltapayClient();
25
        $altapayClient
26
            ->method('captureReservation')
27
            ->willReturnCallback(function () {
28
                $response = $this->getMockBuilder(CaptureReservationResponse::class)
29
                    ->disableOriginalConstructor()
30
                    ->getMock()
31
                ;
32
                $response->method('isSuccessful')->willReturn(true);
33
34
                return $response;
35
            })
36
        ;
37
38
        $paymentHandler = $this->getPaymentHandler($altapayClient);
39
        $res = $paymentHandler->capture($payment, 99.95);
0 ignored issues
show
Bug introduced by
It seems like $payment defined by $this->getPayment() on line 21 can also be of type object<PHPUnit_Framework_MockObject_MockObject>; however, Loevgaard\DandomainAltap...ymentHandler::capture() does only seem to accept object<Loevgaard\Dandoma...yBundle\Entity\Payment>, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
40
41
        $this->assertInstanceOf(CaptureReservationResponse::class, $res);
42
    }
43
44
    public function testRefund1()
45
    {
46
        $amount = null;
47
        $orderLines = [];
48
49
        $altapayClient = $this->getAltapayClient();
50
        $altapayClient
0 ignored issues
show
Bug introduced by
The method expects does only exist in PHPUnit_Framework_MockObject_MockObject, but not in Loevgaard\AltaPay\Client.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
51
            ->expects($this->any())
52
            ->method('refundCapturedReservation')
53
            ->willReturnCallback(function ($val) use (&$amount, &$orderLines) {
54
                /** @var RefundCapturedReservationPayload $val */
55
                $amount = $val->getAmount();
56
                $orderLines = $val->getOrderLines();
57
58
                $response = $this->getMockBuilder(RefundCapturedReservationResponse::class)
59
                    ->disableOriginalConstructor()
60
                    ->getMock()
61
                ;
62
63
                return $response;
64
            })
65
        ;
66
67
        $payment = $this->getPayment();
68
        $payment->setAltapayId('altapayid');
0 ignored issues
show
Bug introduced by
The method setAltapayId does only exist in Loevgaard\DandomainAltapayBundle\Entity\Payment, but not in PHPUnit_Framework_MockObject_MockObject.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
69
70
        $paymentHandler = $this->getPaymentHandler($altapayClient);
71
        $paymentHandler->refund($payment);
0 ignored issues
show
Bug introduced by
It seems like $payment defined by $this->getPayment() on line 67 can also be of type object<PHPUnit_Framework_MockObject_MockObject>; however, Loevgaard\DandomainAltap...aymentHandler::refund() does only seem to accept object<Loevgaard\Dandoma...yBundle\Entity\Payment>, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
72
73
        $this->assertSame(null, $amount);
74
        $this->assertSame([], $orderLines);
75
    }
76
77
    public function testRefund2()
78
    {
79
        $amount = null;
80
        $orderLines = [];
81
82
        $altapayClient = $this->getAltapayClient();
83
        $altapayClient
0 ignored issues
show
Bug introduced by
The method expects does only exist in PHPUnit_Framework_MockObject_MockObject, but not in Loevgaard\AltaPay\Client.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
84
            ->expects($this->any())
85
            ->method('refundCapturedReservation')
86
            ->willReturnCallback(function ($val) use (&$amount, &$orderLines) {
87
                /** @var RefundCapturedReservationPayload $val */
88
                $amount = $val->getAmount();
89
                $orderLines = $val->getOrderLines();
90
91
                $response = $this->getMockBuilder(RefundCapturedReservationResponse::class)
92
                    ->disableOriginalConstructor()
93
                    ->getMock()
94
                ;
95
                $response->method('isSuccessful')->willReturn(true);
96
97
                $transaction = new Transaction();
98
                $response->method('getTransactions')->willReturn([$transaction]);
99
100
                return $response;
101
            })
102
        ;
103
104
        $payment = $this->getPayment();
105
        $payment->setAltapayId('altapayid');
0 ignored issues
show
Bug introduced by
The method setAltapayId does only exist in Loevgaard\DandomainAltapayBundle\Entity\Payment, but not in PHPUnit_Framework_MockObject_MockObject.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
106
107
        $paymentHandler = $this->getPaymentHandler($altapayClient);
108
        $paymentHandler->refund($payment, null, 100.55);
0 ignored issues
show
Bug introduced by
It seems like $payment defined by $this->getPayment() on line 104 can also be of type object<PHPUnit_Framework_MockObject_MockObject>; however, Loevgaard\DandomainAltap...aymentHandler::refund() does only seem to accept object<Loevgaard\Dandoma...yBundle\Entity\Payment>, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
109
110
        $this->assertSame(100.55, $amount);
111
        $this->assertSame([], $orderLines);
112
    }
113
114 View Code Duplication
    public function testRefundAmountMatchesPaymentLineAmount()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
115
    {
116
        $amount = null;
117
        $orderLines = [];
118
119
        $altapayClient = $this->getAltapayClient();
120
        $altapayClient
0 ignored issues
show
Bug introduced by
The method expects does only exist in PHPUnit_Framework_MockObject_MockObject, but not in Loevgaard\AltaPay\Client.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
121
            ->expects($this->any())
122
            ->method('refundCapturedReservation')
123
            ->willReturnCallback(function ($val) use (&$amount, &$orderLines) {
124
                /** @var RefundCapturedReservationPayload $val */
125
                $amount = $val->getAmount();
126
                $orderLines = $val->getOrderLines();
127
128
                $response = $this->getMockBuilder(RefundCapturedReservationResponse::class)
129
                    ->disableOriginalConstructor()
130
                    ->getMock()
131
                ;
132
133
                return $response;
134
            })
135
        ;
136
137
        $payment = $this->getPayment();
138
        $payment->setAltapayId('altapayid');
0 ignored issues
show
Bug introduced by
The method setAltapayId does only exist in Loevgaard\DandomainAltapayBundle\Entity\Payment, but not in PHPUnit_Framework_MockObject_MockObject.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
139
140
        /** @var PaymentLine|\PHPUnit_Framework_MockObject_MockObject $paymentLine */
141
        $paymentLine = $this->getMockForAbstractClass(PaymentLine::class);
142
        $paymentLine->setPrice(79.96)
0 ignored issues
show
Bug introduced by
The method setPrice does only exist in Loevgaard\DandomainAltap...ndle\Entity\PaymentLine, but not in PHPUnit_Framework_MockObject_MockObject.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
143
            ->setVat(25)
144
            ->setQuantity(1)
145
            ->setName('name')
146
            ->setProductNumber('productnumber')
147
        ;
148
149
        $paymentHandler = $this->getPaymentHandler($altapayClient);
150
        $paymentHandler->refund($payment, [$paymentLine], 99.95);
0 ignored issues
show
Bug introduced by
It seems like $payment defined by $this->getPayment() on line 137 can also be of type object<PHPUnit_Framework_MockObject_MockObject>; however, Loevgaard\DandomainAltap...aymentHandler::refund() does only seem to accept object<Loevgaard\Dandoma...yBundle\Entity\Payment>, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
Documentation introduced by
array($paymentLine) is of type array<integer,object<Loe...ckObject_MockObject>"}>, but the function expects a null|array<integer,objec...le\Entity\PaymentLine>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
151
152
        $this->assertSame(99.95, $amount);
153
154
        /** @var OrderLine $orderLine */
155
        $orderLine = $orderLines[0];
156
        $this->assertSame(99.95, $orderLine->getUnitPrice());
157
        $this->assertSame(25.0, $orderLine->getTaxPercent());
158
        $this->assertSame(1.0, $orderLine->getQuantity());
159
        $this->assertSame('name', $orderLine->getDescription());
160
        $this->assertSame('productnumber', $orderLine->getItemId());
161
    }
162
163 View Code Duplication
    public function testRefundAmountDoesNotMatchPaymentLineAmount()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
164
    {
165
        $amount = null;
166
        $orderLines = [];
167
168
        $altapayClient = $this->getAltapayClient();
169
        $altapayClient
0 ignored issues
show
Bug introduced by
The method expects does only exist in PHPUnit_Framework_MockObject_MockObject, but not in Loevgaard\AltaPay\Client.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
170
            ->expects($this->any())
171
            ->method('refundCapturedReservation')
172
            ->willReturnCallback(function ($val) use (&$amount, &$orderLines) {
173
                /** @var RefundCapturedReservationPayload $val */
174
                $amount = $val->getAmount();
175
                $orderLines = $val->getOrderLines();
176
177
                $response = $this->getMockBuilder(RefundCapturedReservationResponse::class)
178
                    ->disableOriginalConstructor()
179
                    ->getMock()
180
                ;
181
182
                return $response;
183
            })
184
        ;
185
186
        $payment = $this->getPayment();
187
        $payment->setAltapayId('altapayid');
0 ignored issues
show
Bug introduced by
The method setAltapayId does only exist in Loevgaard\DandomainAltapayBundle\Entity\Payment, but not in PHPUnit_Framework_MockObject_MockObject.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
188
189
        /** @var PaymentLine|\PHPUnit_Framework_MockObject_MockObject $paymentLine */
190
        $paymentLine = $this->getMockForAbstractClass(PaymentLine::class);
191
        $paymentLine->setPrice(100)
0 ignored issues
show
Bug introduced by
The method setPrice does only exist in Loevgaard\DandomainAltap...ndle\Entity\PaymentLine, but not in PHPUnit_Framework_MockObject_MockObject.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
192
            ->setVat(25)
193
            ->setQuantity(1)
194
            ->setName('name')
195
            ->setProductNumber('productnumber')
196
        ;
197
198
        $paymentHandler = $this->getPaymentHandler($altapayClient);
199
        $paymentHandler->refund($payment, [$paymentLine], 80);
0 ignored issues
show
Bug introduced by
It seems like $payment defined by $this->getPayment() on line 186 can also be of type object<PHPUnit_Framework_MockObject_MockObject>; however, Loevgaard\DandomainAltap...aymentHandler::refund() does only seem to accept object<Loevgaard\Dandoma...yBundle\Entity\Payment>, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
Documentation introduced by
array($paymentLine) is of type array<integer,object<Loe...ckObject_MockObject>"}>, but the function expects a null|array<integer,objec...le\Entity\PaymentLine>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
200
201
        $this->assertSame(80.0, $amount);
202
203
        /** @var OrderLine $orderLine */
204
        $orderLine = $orderLines[0];
205
        $this->assertSame(80.0, $orderLine->getUnitPrice());
206
        $this->assertSame(1.0, $orderLine->getQuantity());
207
        $this->assertSame('refund', $orderLine->getDescription());
208
        $this->assertSame('refund', $orderLine->getItemId());
209
    }
210
211
    /**
212
     * @return Payment|\PHPUnit_Framework_MockObject_MockObject
213
     */
214
    private function getPayment()
215
    {
216
        return $this->getMockForAbstractClass(Payment::class);
217
    }
218
219
    /**
220
     * @return Client|\PHPUnit_Framework_MockObject_MockObject
221
     */
222
    private function getAltapayClient()
223
    {
224
        /** @var Client|\PHPUnit_Framework_MockObject_MockObject $altapayClient */
225
        $altapayClient = $this->getMockBuilder(Client::class)
226
            ->disableOriginalConstructor()
227
            ->getMock()
228
        ;
229
230
        return $altapayClient;
231
    }
232
233
    /**
234
     * @return PaymentHandler
235
     */
236
    private function getPaymentHandler($altapayClient): PaymentHandler
237
    {
238
        /** @var PaymentManager|\PHPUnit_Framework_MockObject_MockObject $paymentManager */
239
        $paymentManager = $this->getMockBuilder(PaymentManager::class)
240
            ->disableOriginalConstructor()
241
            ->getMock()
242
        ;
243
244
        return new PaymentHandler($altapayClient, $paymentManager);
245
    }
246
}
247