PaymentRequest::getRequiredParams()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Eo\KeyClient\Payment;
4
5
/**
6
 * PaymentRequest
7
 */
8
class PaymentRequest extends AbstractPayment implements PaymentRequestInterface
9
{
10
    /**
11
     * Class constructor
12
     *
13
     * @param int    $amount          Total amount expressed in cents
14
     * @param string $currency        3 character currency code
15
     * @param string $transactionCode Unique payment identifier code
16
     * @param string $completeUrl     Redirect url for when the payment is completed
17
     * @param string $cancelUrl       Redirect url for when the payment is canceled
18
     */
19
    public function __construct($amount, $currency, $transactionCode, $completeUrl, $cancelUrl)
20
    {
21
        parent::__construct(array(
22
            'importo'  => $amount,
23
            'divisa'   => $currency,
24
            'codTrans' => $transactionCode,
25
            'url'      => $completeUrl,
26
            'url_back' => $cancelUrl
27
        ));
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    protected function getRequiredParams()
34
    {
35
        return array(
36
            'importo',
37
            'divisa',
38
            'codTrans',
39
            'url',
40
            'url_back'
41
        );
42
    }
43
}