Code Duplication    Length = 44-44 lines in 2 locations

src/Requests/PaymentRequest.php 1 location

@@ 5-48 (lines=44) @@
2
3
namespace Payment247\SDK\Requests;
4
5
class PaymentRequest extends Request implements IFlow
6
{
7
    use FlowTrait, TransactionTrait;
8
9
    protected $fields = [
10
        'amount',
11
        'currency',
12
        'order_id',
13
        'user',
14
        'product',
15
        'ps',
16
        'flow',
17
        'flow_parameters',
18
        'success_url',
19
        'pending_url',
20
        'fail_url',
21
        'email',
22
        'custom',
23
    ];
24
25
    /**
26
     * @return string
27
     */
28
    public function getRequestType()
29
    {
30
        return 'payment';
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getProduct()
37
    {
38
        return $this->raw['product'];
39
    }
40
41
    /**
42
     * @param string $product
43
     */
44
    public function setProduct($product)
45
    {
46
        $this->raw['product'] = $product;
47
    }
48
}
49

src/Requests/PayoutRequest.php 1 location

@@ 5-48 (lines=44) @@
2
3
namespace Payment247\SDK\Requests;
4
5
class PayoutRequest extends Request implements IFlow
6
{
7
    use FlowTrait, TransactionTrait;
8
9
    protected $fields = [
10
        'amount',
11
        'currency',
12
        'order_id',
13
        'user',
14
        'hold',
15
        'ps',
16
        'flow',
17
        'flow_parameters',
18
        'success_url',
19
        'pending_url',
20
        'fail_url',
21
        'email',
22
        'custom',
23
    ];
24
25
    /**
26
     * @return string
27
     */
28
    public function getRequestType()
29
    {
30
        return 'payout';
31
    }
32
33
    /**
34
     * @return bool
35
     */
36
    public function isHold()
37
    {
38
        return (bool) $this->raw['hold'];
39
    }
40
41
    /**
42
     * @param string $hold
43
     */
44
    public function setHold($hold)
45
    {
46
        $this->raw['hold'] = (int) $hold;
47
    }
48
}
49