1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Ticketpark\SaferpayJson\Request\SecureCardData; |
6
|
|
|
|
7
|
|
|
use JMS\Serializer\Annotation\SerializedName; |
8
|
|
|
use JMS\Serializer\Annotation\Type; |
9
|
|
|
use Ticketpark\SaferpayJson\Request\Container\Check; |
10
|
|
|
use Ticketpark\SaferpayJson\Request\Container\PaymentMeans; |
11
|
|
|
use Ticketpark\SaferpayJson\Request\Container\RegisterAlias; |
12
|
|
|
use Ticketpark\SaferpayJson\Request\Request; |
13
|
|
|
use Ticketpark\SaferpayJson\Request\RequestCommonsTrait; |
14
|
|
|
use Ticketpark\SaferpayJson\Request\RequestConfig; |
15
|
|
|
use Ticketpark\SaferpayJson\Response\SecureCardData\AliasInsertDirectResponse; |
16
|
|
|
|
17
|
|
|
final class AliasInsertDirectRequest extends Request |
18
|
|
|
{ |
19
|
|
|
use RequestCommonsTrait; |
20
|
|
|
public const API_PATH = '/Payment/v1/Alias/InsertDirect'; |
21
|
|
|
public const RESPONSE_CLASS = AliasInsertDirectResponse::class; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var RegisterAlias |
25
|
|
|
* @SerializedName("RegisterAlias") |
26
|
|
|
*/ |
27
|
|
|
private $registerAlias; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var PaymentMeans |
31
|
|
|
* @SerializedName("PaymentMeans") |
32
|
|
|
* @Type("Ticketpark\SaferpayJson\Request\Container\PaymentMeans") |
33
|
|
|
*/ |
34
|
|
|
private $paymentMeans; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var Check|null |
38
|
|
|
* @SerializedName("Check") |
39
|
|
|
* @Type("Ticketpark\SaferpayJson\Request\Container\Check") |
40
|
|
|
*/ |
41
|
|
|
private $check; |
42
|
|
|
|
43
|
|
|
public function __construct(RequestConfig $requestConfig, RegisterAlias $registerAlias, PaymentMeans $paymentMeans) |
44
|
|
|
{ |
45
|
|
|
$this->registerAlias = $registerAlias; |
46
|
|
|
$this->paymentMeans = $paymentMeans; |
47
|
|
|
|
48
|
|
|
parent::__construct($requestConfig); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
public function getRegisterAlias(): RegisterAlias |
52
|
|
|
{ |
53
|
|
|
return $this->registerAlias; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
public function setRegisterAlias(RegisterAlias $registerAlias): self |
57
|
|
|
{ |
58
|
|
|
$this->registerAlias = $registerAlias; |
59
|
|
|
|
60
|
|
|
return $this; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public function getPaymentMeans(): PaymentMeans |
64
|
|
|
{ |
65
|
|
|
return $this->paymentMeans; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
public function setPaymentMeans(PaymentMeans $paymentMeans): self |
69
|
|
|
{ |
70
|
|
|
$this->paymentMeans = $paymentMeans; |
71
|
|
|
|
72
|
|
|
return $this; |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
public function getCheck(): ?Check |
76
|
|
|
{ |
77
|
|
|
return $this->check; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
public function setCheck(?Check $check): self |
81
|
|
|
{ |
82
|
|
|
$this->check = $check; |
83
|
|
|
|
84
|
|
|
return $this; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
public function execute(): AliasInsertDirectResponse |
88
|
|
|
{ |
89
|
|
|
/** @var AliasInsertDirectResponse $response */ |
90
|
|
|
$response = $this->doExecute(); |
91
|
|
|
|
92
|
|
|
return $response; |
93
|
|
|
} |
94
|
|
|
} |
95
|
|
|
|