Total Complexity | 6 |
Total Lines | 78 |
Duplicated Lines | 0 % |
Coverage | 85.71% |
Changes | 4 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
9 | trait IsPurchasableTrait |
||
10 | { |
||
11 | |||
12 | /** |
||
13 | * @return array |
||
14 | */ |
||
15 | 7 | public function getPurchaseParameters() |
|
16 | { |
||
17 | 7 | $parameters = []; |
|
18 | 7 | $parameters['amount'] = $this->getPurchaseAmount(); |
|
19 | 7 | $parameters['currency'] = $this->getPurchaseCurrency(); |
|
20 | |||
21 | 7 | $parameters['orderId'] = $this->id; |
|
22 | 7 | $parameters['orderName'] = $this->getPurchaseName(); |
|
23 | 7 | $parameters['orderDate'] = $this->getPurchaseDate(); |
|
24 | |||
25 | 7 | $parameters['description'] = $this->getPurchaseName(); |
|
26 | 7 | $parameters['lang'] = translator()->getLanguage(); |
|
|
|||
27 | |||
28 | 7 | $parameters['items'] = [ |
|
29 | [ |
||
30 | 7 | 'name' => $this->getPurchaseName(), |
|
31 | 7 | 'price' => $this->getPurchaseAmount(), |
|
32 | 7 | 'description' => $this->getPurchaseName(), |
|
33 | 7 | 'quantity' => 1, |
|
34 | ], |
||
35 | ]; |
||
36 | |||
37 | 7 | $parameters['returnUrl'] = $this->getConfirmURL(); |
|
38 | 7 | $parameters['notifyUrl'] = $this->getIpnURL(); |
|
39 | |||
40 | 7 | $parameters['card'] = $this->getPurchaseParametersCard(); |
|
41 | |||
42 | 7 | return $parameters; |
|
43 | } |
||
44 | |||
45 | abstract public function getPurchaseAmount(); |
||
46 | |||
47 | /** |
||
48 | * @return string |
||
49 | */ |
||
50 | 7 | public function getPurchaseCurrency() |
|
51 | { |
||
52 | 7 | return 'RON'; |
|
53 | } |
||
54 | |||
55 | /** |
||
56 | * @return string |
||
57 | */ |
||
58 | 7 | public function getPurchaseName() |
|
59 | { |
||
60 | 7 | return $this->getName(); |
|
61 | } |
||
62 | |||
63 | abstract public function getName(); |
||
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | */ |
||
68 | 7 | public function getPurchaseDate() |
|
69 | { |
||
70 | 7 | return $this->created; |
|
71 | } |
||
72 | |||
73 | /** |
||
74 | * @return array |
||
75 | */ |
||
76 | public function getPurchaseParametersCard() |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * @return bool |
||
83 | */ |
||
84 | public function isMultiItemPurchase() |
||
87 | } |
||
88 | } |
||
89 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.