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