1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
namespace h4kuna\Fio\Request\Pay\Payment; |
4
|
|
|
|
5
|
|
|
use h4kuna\Fio\Exceptions; |
6
|
|
|
|
7
|
|
|
class International extends Foreign |
8
|
|
|
{ |
9
|
|
|
|
10
|
|
|
public const CHARGES_OUR = 470501; |
11
|
|
|
public const CHARGES_BEN = 470502; |
12
|
|
|
public const CHARGES_SHA = 470503; |
13
|
|
|
|
14
|
|
|
private const TYPES_CHARGES = [self::CHARGES_BEN, self::CHARGES_OUR, self::CHARGES_SHA]; |
15
|
|
|
|
16
|
|
|
/** @var string */ |
17
|
|
|
protected $remittanceInfo4 = ''; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* Default value is goods export. |
21
|
|
|
* @see Property |
22
|
|
|
*/ |
23
|
|
|
protected $paymentReason = 110; |
24
|
|
|
|
25
|
|
|
/** @var int */ |
26
|
|
|
protected $detailsOfCharges = self::CHARGES_BEN; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Section in manual 6.3.4. |
30
|
|
|
* @param int $type |
31
|
|
|
* @return static |
32
|
|
|
* @throws Exceptions\InvalidArgument |
33
|
|
|
*/ |
34
|
|
|
public function setDetailsOfCharges(int $type) |
35
|
|
|
{ |
36
|
|
|
$this->detailsOfCharges = Exceptions\InvalidArgument::checkIsInList($type, self::TYPES_CHARGES); |
37
|
|
|
return $this; |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @return static |
43
|
|
|
*/ |
44
|
|
|
public function setRemittanceInfo4(string $info) |
45
|
|
|
{ |
46
|
|
|
$this->remittanceInfo4 = Exceptions\InvalidArgument::check($info, 35); |
47
|
|
|
return $this; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
|
51
|
|
|
public function getExpectedProperty(): array |
52
|
|
|
{ |
53
|
|
|
return [ |
54
|
|
|
'accountFrom' => true, |
55
|
|
|
'currency' => true, |
56
|
|
|
'amount' => true, |
57
|
|
|
'accountTo' => true, |
58
|
|
|
'bic' => true, |
59
|
|
|
'date' => true, |
60
|
|
|
'comment' => false, |
61
|
|
|
'benefName' => true, |
62
|
|
|
'benefStreet' => true, |
63
|
|
|
'benefCity' => true, |
64
|
|
|
'benefCountry' => true, |
65
|
|
|
'remittanceInfo1' => true, |
66
|
|
|
'remittanceInfo2' => false, |
67
|
|
|
'remittanceInfo3' => false, |
68
|
|
|
'remittanceInfo4' => false, |
69
|
|
|
'detailsOfCharges' => true, |
70
|
|
|
'paymentReason' => true, |
71
|
|
|
]; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
|
75
|
|
|
public function getStartXmlElement(): string |
76
|
|
|
{ |
77
|
|
|
return 'ForeignTransaction'; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
} |
81
|
|
|
|