1 | <?php |
||
17 | class PurchaseRequest extends AbstractRequest |
||
18 | { |
||
19 | /** |
||
20 | * {@inheritdoc} |
||
21 | */ |
||
22 | 1 | public function getData() |
|
23 | { |
||
24 | 1 | $this->validate('checkoutId', 'amount', 'currency', 'description', 'transactionId'); |
|
25 | |||
26 | $return = [ |
||
27 | 1 | 'ik_co_id' => $this->getCheckoutId(), |
|
28 | 1 | 'ik_am' => $this->getAmount(), |
|
29 | 1 | 'ik_pm_no' => $this->getTransactionId(), |
|
30 | 1 | 'ik_desc' => $this->getDescription(), |
|
31 | 1 | 'ik_cur' => $this->getCurrency(), |
|
32 | ]; |
||
33 | |||
34 | 1 | if ($ik_pnd_u = $this->getReturnUrl()) { |
|
35 | 1 | $return['ik_pnd_u'] = $ik_pnd_u; |
|
36 | |||
37 | 1 | if ($ik_pnd_m = $this->getReturnMethod()) { |
|
38 | $return['ik_pnd_m'] = $ik_pnd_m; |
||
39 | } |
||
40 | } |
||
41 | |||
42 | 1 | if ($ik_suc_u = $this->getReturnUrl()) { |
|
43 | 1 | $return['ik_suc_u'] = $ik_suc_u; |
|
44 | |||
45 | 1 | if ($ik_suc_m = $this->getReturnMethod()) { |
|
46 | $return['ik_suc_m'] = $ik_suc_m; |
||
47 | } |
||
48 | } |
||
49 | |||
50 | 1 | if ($ik_fal_u = $this->getCancelUrl()) { |
|
51 | 1 | $return['ik_fal_u'] = $ik_fal_u; |
|
52 | |||
53 | 1 | if ($ik_fal_m = $this->getCancelMethod()) { |
|
54 | $return['ik_fal_m'] = $ik_fal_m; |
||
55 | } |
||
56 | } |
||
57 | |||
58 | 1 | if ($ik_ia_u = $this->getNotifyUrl()) { |
|
59 | 1 | $return['ik_ia_u'] = $ik_ia_u; |
|
60 | |||
61 | 1 | if ($ik_ia_m = $this->getNotifyMethod()) { |
|
62 | $return['ik_ia_m'] = $ik_ia_m; |
||
63 | } |
||
64 | } |
||
65 | |||
66 | 1 | if ($this->getSecret()) { |
|
67 | 1 | $return['ik_sign'] = $this->calculateSign($return); |
|
68 | } |
||
69 | |||
70 | 1 | return $return; |
|
71 | } |
||
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | * @param mixed $data |
||
76 | * @return PurchaseResponse |
||
77 | */ |
||
78 | 1 | public function sendData($data) |
|
82 | } |
||
83 |