1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
namespace MerchantSafeUnipay\SDK\Action; |
5
|
|
|
|
6
|
|
|
use MerchantSafeUnipay; |
7
|
|
|
|
8
|
|
|
final class RecurringPlan extends ActionAbstract implements ActionInterface |
9
|
|
|
{ |
10
|
|
|
static private $addKeys = [ |
11
|
|
|
'CARDTOKEN', 'CUSTOMER', 'CUSTOMERNAME', 'CUSTOMEREMAIL', 'CUSTOMERPHONE', 'TCKN', 'RECURRINGPLANCODE', |
12
|
|
|
'FIRSTAMOUNT', 'RECURRINGAMOUNT', 'RECURRENCECOUNT', 'FREQUENCY', 'OCCURRENCE', 'STARTDATE', 'CURRENCY', |
13
|
|
|
'PAYMENTSYSTEM', 'NOTIFICATIONCHANNELS' |
14
|
|
|
]; |
15
|
|
|
static private $editKeys = [ |
16
|
|
|
'RECURRINGPLANCODE', 'RECURRINGPLANSTATUS', 'RECURRINGAMOUNT', 'PAYMENTSYSTEM' |
17
|
|
|
]; |
18
|
|
|
static private $deleteKeys = [ |
19
|
|
|
'RECURRINGPLANCODE' |
20
|
|
|
]; |
21
|
|
|
static private $resendLinkKeys = [ |
22
|
|
|
'RECURRINGPLANCODE', 'NOTIFICATIONCHANNELS' |
23
|
|
|
]; |
24
|
|
|
|
25
|
|
|
public function add($args) |
26
|
|
|
{ |
27
|
|
|
$this->action = 'RECURRINGPLANADD'; |
28
|
|
|
$args = MerchantSafeUnipay\filter(self::$addKeys, $args); |
29
|
|
|
$this->queryParameters = array_merge($this->merchantParams, $args); |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
public function edit($args) |
33
|
|
|
{ |
34
|
|
|
$this->action = 'RECURRINGPLANEDIT'; |
35
|
|
|
$args = MerchantSafeUnipay\filter(self::$editKeys, $args); |
36
|
|
|
$this->queryParameters = array_merge($this->merchantParams, $args); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function delete($args) |
40
|
|
|
{ |
41
|
|
|
$this->action = 'RECURRINGPLANDELETE'; |
42
|
|
|
$args = MerchantSafeUnipay\filter(self::$deleteKeys, $args); |
43
|
|
|
$this->queryParameters = array_merge($this->merchantParams, $args); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function resendLink($args) |
47
|
|
|
{ |
48
|
|
|
$this->action = 'RECURRINGPLANRESENDLINK'; |
49
|
|
|
$args = MerchantSafeUnipay\filter(self::$resendLinkKeys, $args); |
50
|
|
|
$this->queryParameters = array_merge($this->merchantParams, $args); |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
|