1 | <?php |
||||||
2 | |||||||
3 | namespace ByTIC\Payments\Actions\Purchases; |
||||||
4 | |||||||
5 | use ByTIC\Payments\Models\Purchase\Traits\IsPurchasableTrait; |
||||||
6 | |||||||
7 | /** |
||||||
8 | * Class PurchaseParameters |
||||||
9 | * @package ByTIC\Payments\Actions\Purchases |
||||||
10 | */ |
||||||
11 | class PurchaseParameters |
||||||
12 | { |
||||||
13 | /** |
||||||
14 | * @param IsPurchasableTrait $purchase |
||||||
15 | * @return array |
||||||
16 | */ |
||||||
17 | public static function for($purchase): array |
||||||
18 | { |
||||||
19 | $parameters = []; |
||||||
20 | $parameters['amount'] = $purchase->getPurchaseAmount(); |
||||||
21 | $parameters['currency'] = $purchase->getPurchaseCurrency(); |
||||||
22 | |||||||
23 | $parameters['orderId'] = $purchase->id; |
||||||
24 | $parameters['orderName'] = $purchase->getPurchaseName(); |
||||||
25 | $parameters['orderDate'] = $purchase->getPurchaseDate(); |
||||||
26 | |||||||
27 | $parameters['transactionId'] = $purchase->id; |
||||||
28 | $parameters['description'] = $purchase->getPurchaseName(); |
||||||
29 | $parameters['lang'] = translator()->getLanguage(); |
||||||
0 ignored issues
–
show
|
|||||||
30 | |||||||
31 | $parameters['items'] = [ |
||||||
32 | [ |
||||||
33 | 'name' => $purchase->getPurchaseName(), |
||||||
34 | 'price' => $purchase->getPurchaseAmount(), |
||||||
35 | 'description' => $purchase->getPurchaseName(), |
||||||
36 | 'quantity' => 1, |
||||||
37 | ], |
||||||
38 | ]; |
||||||
39 | |||||||
40 | $parameters['returnUrl'] = $purchase->getConfirmURL(); |
||||||
0 ignored issues
–
show
It seems like
getConfirmURL() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
41 | $parameters['notifyUrl'] = $purchase->getIpnURL(); |
||||||
0 ignored issues
–
show
It seems like
getIpnURL() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
42 | |||||||
43 | $parameters['card'] = $purchase->getPurchaseParametersCard(); |
||||||
44 | return $parameters; |
||||||
45 | } |
||||||
46 | } |
||||||
47 |
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.