From 5d88c101831592cccc885e71aeee4f105dc795a0 Mon Sep 17 00:00:00 2001 From: Robert Ritler Date: Mon, 10 Jun 2024 09:58:37 +0200 Subject: [PATCH 01/13] feat(saferpay)!: api update 1.31 => 1.32 * changes according to http://saferpay.github.io/jsonapi/#v1.32.0.0.20230117 Closes: #74 BREAKING-CHANGE: Saferpay Changelog: container ReturnUrls (parameters Success and Fail) is replaced by container ReturnUrl (parameter Url) --- .../Request/Container/RequestHeader.php | 2 +- .../Request/Container/ReturnUrl.php | 26 +++++++++ .../Request/Container/ReturnUrls.php | 57 ------------------- .../Request/PaymentPage/InitializeRequest.php | 21 +++---- .../SecureCardData/AliasInsertRequest.php | 20 +++---- .../Request/Transaction/InitializeRequest.php | 16 +++--- 6 files changed, 56 insertions(+), 86 deletions(-) create mode 100644 lib/SaferpayJson/Request/Container/ReturnUrl.php delete mode 100644 lib/SaferpayJson/Request/Container/ReturnUrls.php diff --git a/lib/SaferpayJson/Request/Container/RequestHeader.php b/lib/SaferpayJson/Request/Container/RequestHeader.php index 16c4a5e..647e506 100644 --- a/lib/SaferpayJson/Request/Container/RequestHeader.php +++ b/lib/SaferpayJson/Request/Container/RequestHeader.php @@ -12,7 +12,7 @@ final class RequestHeader * @var string * @SerializedName("SpecVersion") */ - private $specVersion = '1.31'; + private $specVersion = '1.32'; /** * @var string diff --git a/lib/SaferpayJson/Request/Container/ReturnUrl.php b/lib/SaferpayJson/Request/Container/ReturnUrl.php new file mode 100644 index 0000000..67e2f51 --- /dev/null +++ b/lib/SaferpayJson/Request/Container/ReturnUrl.php @@ -0,0 +1,26 @@ +url = $url; + } + + public function getUrl(): string + { + return $this->url; + } +} diff --git a/lib/SaferpayJson/Request/Container/ReturnUrls.php b/lib/SaferpayJson/Request/Container/ReturnUrls.php deleted file mode 100644 index ab8a511..0000000 --- a/lib/SaferpayJson/Request/Container/ReturnUrls.php +++ /dev/null @@ -1,57 +0,0 @@ -success = $success; - $this->fail = $fail; - $this->abort = $abort; - } - - public function getSuccess(): string - { - return $this->success; - } - - public function getFail(): string - { - return $this->fail; - } - - public function getAbort(): ?string - { - return $this->abort; - } - - public function setAbort(?string $abort): self - { - $this->abort = $abort; - - return $this; - } -} diff --git a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php index 2857f3e..bf1b692 100644 --- a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php +++ b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php @@ -14,7 +14,7 @@ use Ticketpark\SaferpayJson\Request\Container\Payment; use Ticketpark\SaferpayJson\Request\Container\PaymentMethodsOptions; use Ticketpark\SaferpayJson\Request\Container\RegisterAlias; -use Ticketpark\SaferpayJson\Request\Container\ReturnUrls; +use Ticketpark\SaferpayJson\Request\Container\ReturnUrl; use Ticketpark\SaferpayJson\Request\Container\RiskFactors; use Ticketpark\SaferpayJson\Request\Container\Styling; use Ticketpark\SaferpayJson\Request\Request; @@ -53,6 +53,7 @@ final class InitializeRequest extends Request public const PAYMENT_METHOD_UNIONPAY = "UNIONPAY"; public const PAYMENT_METHOD_VISA = "VISA"; public const PAYMENT_METHOD_VPAY = "VPAY"; + public const PAYMENT_METHOD_PAYCONIQ = "PAYCONIQ"; public const WALLET_MASTERPASS = "MASTERPASS"; public const WALLET_APPLEPAY = "APPLEPAY"; @@ -74,10 +75,10 @@ final class InitializeRequest extends Request private $payment; /** - * @var ReturnUrls - * @SerializedName("ReturnUrls") + * @var ReturnUrl + * @SerializedName("ReturnUrl") */ - private $returnUrls; + private $returnUrl; /** * @var string|null @@ -173,11 +174,11 @@ public function __construct( RequestConfig $requestConfig, string $terminalId, Payment $payment, - ReturnUrls $returnUrls + ReturnUrl $returnUrl ) { $this->terminalId = $terminalId; $this->payment = $payment; - $this->returnUrls = $returnUrls; + $this->returnUrl = $returnUrl; parent::__construct($requestConfig); } @@ -206,14 +207,14 @@ public function setPayment(Payment $payment): self return $this; } - public function getReturnUrls(): ReturnUrls + public function getReturnUrl(): ReturnUrl { - return $this->returnUrls; + return $this->returnUrl; } - public function setReturnUrls(ReturnUrls $returnUrls): self + public function setReturnUrl(ReturnUrl $returnUrl): self { - $this->returnUrls = $returnUrls; + $this->returnUrl = $returnUrl; return $this; } diff --git a/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php b/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php index 59355b4..49df119 100755 --- a/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php +++ b/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php @@ -10,7 +10,7 @@ use Ticketpark\SaferpayJson\Request\Container\Check; use Ticketpark\SaferpayJson\Request\Container\PaymentMeans; use Ticketpark\SaferpayJson\Request\Container\RegisterAlias; -use Ticketpark\SaferpayJson\Request\Container\ReturnUrls; +use Ticketpark\SaferpayJson\Request\Container\ReturnUrl; use Ticketpark\SaferpayJson\Request\Container\Styling; use Ticketpark\SaferpayJson\Request\Request; use Ticketpark\SaferpayJson\Request\RequestCommonsTrait; @@ -56,10 +56,10 @@ final class AliasInsertRequest extends Request private $type; /** - * @var ReturnUrls - * @SerializedName("ReturnUrls") + * @var ReturnUrl + * @SerializedName("ReturnUrl") */ - private $returnUrls; + private $returnUrl; /** * @var Styling|null @@ -102,11 +102,11 @@ public function __construct( RequestConfig $requestConfig, RegisterAlias $registerAlias, string $type, - ReturnUrls $returnUrls + ReturnUrl $returnUrl ) { $this->registerAlias = $registerAlias; $this->type = $type; - $this->returnUrls = $returnUrls; + $this->returnUrl = $returnUrl; parent::__construct($requestConfig); } @@ -135,14 +135,14 @@ public function setType(string $type): self return $this; } - public function getReturnUrls(): ReturnUrls + public function getReturnUrl(): ReturnUrl { - return $this->returnUrls; + return $this->returnUrl; } - public function setReturnUrls(ReturnUrls $returnUrls): self + public function setReturnUrl(ReturnUrl $returnUrl): self { - $this->returnUrls = $returnUrls; + $this->returnUrl = $returnUrl; return $this; } diff --git a/lib/SaferpayJson/Request/Transaction/InitializeRequest.php b/lib/SaferpayJson/Request/Transaction/InitializeRequest.php index 3948777..a22e7b5 100644 --- a/lib/SaferpayJson/Request/Transaction/InitializeRequest.php +++ b/lib/SaferpayJson/Request/Transaction/InitializeRequest.php @@ -12,7 +12,7 @@ use Ticketpark\SaferpayJson\Request\Container\Payment; use Ticketpark\SaferpayJson\Request\Container\PaymentMeans; use Ticketpark\SaferpayJson\Request\Container\RedirectNotifyUrls; -use Ticketpark\SaferpayJson\Request\Container\ReturnUrls; +use Ticketpark\SaferpayJson\Request\Container\ReturnUrl; use Ticketpark\SaferpayJson\Request\Container\RiskFactors; use Ticketpark\SaferpayJson\Request\Container\Styling; use Ticketpark\SaferpayJson\Request\Container\Wallet; @@ -79,10 +79,10 @@ final class InitializeRequest extends Request private $payer; /** - * @var ReturnUrls - * @SerializedName("ReturnUrls") + * @var ReturnUrl + * @SerializedName("ReturnUrl") */ - private $returnUrls; + private $returnUrl; /** * @var Styling|null @@ -130,11 +130,11 @@ public function __construct( RequestConfig $requestConfig, string $terminalId, Payment $payment, - ReturnUrls $returnUrls + ReturnUrl $returnUrl ) { $this->terminalId = $terminalId; $this->payment = $payment; - $this->returnUrls = $returnUrls; + $this->returnUrl = $returnUrl; parent::__construct($requestConfig); } @@ -253,9 +253,9 @@ public function getPayer(): ?Payer return $this->payer; } - public function getReturnUrls(): ReturnUrls + public function getReturnUrl(): ReturnUrl { - return $this->returnUrls; + return $this->returnUrl; } public function getStyling(): ?Styling From 20e403f7824cb1274ea65a5aed83bb722de3484b Mon Sep 17 00:00:00 2001 From: Robert Ritler Date: Mon, 10 Jun 2024 09:59:39 +0200 Subject: [PATCH 02/13] test: api update 1.31 => 1.32 * changes to tests because of replacement of ReturnUrls with ReturnUrl --- .../Tests/Request/PaymentPage/InitializeRequestTest.php | 4 ++-- .../Tests/Request/SecureCardData/AliasInsertRequestTest.php | 4 ++-- .../Tests/Request/Transaction/InitializeRequestTest.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/SaferpayJson/Tests/Request/PaymentPage/InitializeRequestTest.php b/tests/SaferpayJson/Tests/Request/PaymentPage/InitializeRequestTest.php index e46e383..f6bf4c5 100644 --- a/tests/SaferpayJson/Tests/Request/PaymentPage/InitializeRequestTest.php +++ b/tests/SaferpayJson/Tests/Request/PaymentPage/InitializeRequestTest.php @@ -4,7 +4,7 @@ use Ticketpark\SaferpayJson\Request\Container\Amount; use Ticketpark\SaferpayJson\Request\Container\Payment; -use Ticketpark\SaferpayJson\Request\Container\ReturnUrls; +use Ticketpark\SaferpayJson\Request\Container\ReturnUrl; use Ticketpark\SaferpayJson\Request\PaymentPage\InitializeRequest; use Ticketpark\SaferpayJson\Response\PaymentPage\InitializeResponse; use Ticketpark\SaferpayJson\Tests\Request\CommonRequestTest; @@ -26,7 +26,7 @@ protected function getInstance() new Payment( new Amount(5000, 'CHF') ), - new ReturnUrls('success-url', 'fail-url') + new ReturnUrl('success-url') ); } } diff --git a/tests/SaferpayJson/Tests/Request/SecureCardData/AliasInsertRequestTest.php b/tests/SaferpayJson/Tests/Request/SecureCardData/AliasInsertRequestTest.php index d813657..b0e60ed 100755 --- a/tests/SaferpayJson/Tests/Request/SecureCardData/AliasInsertRequestTest.php +++ b/tests/SaferpayJson/Tests/Request/SecureCardData/AliasInsertRequestTest.php @@ -3,7 +3,7 @@ namespace Ticketpark\SaferpayJson\Tests\Request\SecureCardData; use Ticketpark\SaferpayJson\Request\Container\RegisterAlias; -use Ticketpark\SaferpayJson\Request\Container\ReturnUrls; +use Ticketpark\SaferpayJson\Request\Container\ReturnUrl; use Ticketpark\SaferpayJson\Request\SecureCardData\AliasInsertRequest; use Ticketpark\SaferpayJson\Response\SecureCardData\AliasInsertResponse; use Ticketpark\SaferpayJson\Tests\Request\CommonRequestTest; @@ -23,7 +23,7 @@ public function getInstance() $this->getRequestConfig(), new RegisterAlias(RegisterAlias::ID_GENERATOR_RANDOM), AliasInsertRequest::TYPE_CARD, - new ReturnUrls('success-url', 'fail-url') + new ReturnUrl('success-url') ); } } diff --git a/tests/SaferpayJson/Tests/Request/Transaction/InitializeRequestTest.php b/tests/SaferpayJson/Tests/Request/Transaction/InitializeRequestTest.php index dc0bb9e..8ec8789 100644 --- a/tests/SaferpayJson/Tests/Request/Transaction/InitializeRequestTest.php +++ b/tests/SaferpayJson/Tests/Request/Transaction/InitializeRequestTest.php @@ -4,7 +4,7 @@ use Ticketpark\SaferpayJson\Request\Container\Amount; use Ticketpark\SaferpayJson\Request\Container\Payment; -use Ticketpark\SaferpayJson\Request\Container\ReturnUrls; +use Ticketpark\SaferpayJson\Request\Container\ReturnUrl; use Ticketpark\SaferpayJson\Request\Transaction\InitializeRequest; use Ticketpark\SaferpayJson\Response\Transaction\InitializeResponse; use Ticketpark\SaferpayJson\Tests\Request\CommonRequestTest; @@ -19,7 +19,7 @@ protected function getInstance() new Payment( new Amount(5000, 'CHF') ), - new ReturnUrls('success-url', 'fail-url') + new ReturnUrl('success-url') ); } From 3cc4a3c284aae1c8265707d6db5b15ebbf4873c3 Mon Sep 17 00:00:00 2001 From: Robert Ritler Date: Mon, 10 Jun 2024 09:59:59 +0200 Subject: [PATCH 03/13] docs: api update 1.31 => 1.32 * changes to examples because of replacement of ReturnUrls with ReturnUrl --- example/PaymentPage/example-initialize.php | 7 +++---- example/SecureCardData/example-alias-insert.php | 7 +++---- example/Transaction/example-initialize.php | 7 +++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/example/PaymentPage/example-initialize.php b/example/PaymentPage/example-initialize.php index b5e2dce..6052c51 100644 --- a/example/PaymentPage/example-initialize.php +++ b/example/PaymentPage/example-initialize.php @@ -28,9 +28,8 @@ $payment = new Container\Payment($amount); $payment->setDescription('Order No. 12839'); -$returnUrls = new Container\ReturnUrls( - 'http://www.mysite.ch/success?orderId=12839', - 'http://www.mysite.ch/fail' +$returnUrl = new Container\ReturnUrl( + 'http://www.mysite.ch/success?orderId=12839' ); // ----------------------------- @@ -41,7 +40,7 @@ $requestConfig, $terminalId, $payment, - $returnUrls + $returnUrl ); // Note: More data can be provided to InitializeRequest with setters, diff --git a/example/SecureCardData/example-alias-insert.php b/example/SecureCardData/example-alias-insert.php index 87dfa12..c273685 100644 --- a/example/SecureCardData/example-alias-insert.php +++ b/example/SecureCardData/example-alias-insert.php @@ -24,9 +24,8 @@ Container\RegisterAlias::ID_GENERATOR_RANDOM ); -$returnUrls = new Container\ReturnUrls( - 'http://www.mysite.ch/success', - 'http://www.mysite.ch/fail' +$returnUrl = new Container\ReturnUrl( + 'http://www.mysite.ch/success' ); // ----------------------------- @@ -37,7 +36,7 @@ $requestConfig, $registerAlias, AliasInsertRequest::TYPE_CARD, - $returnUrls + $returnUrl ); // ----------------------------- diff --git a/example/Transaction/example-initialize.php b/example/Transaction/example-initialize.php index aa9e7be..c4c8c7a 100644 --- a/example/Transaction/example-initialize.php +++ b/example/Transaction/example-initialize.php @@ -28,9 +28,8 @@ $payment = new Container\Payment($amount); $payment->setDescription('Order No. 12840'); -$returnUrls = new Container\ReturnUrls( - 'http://www.mysite.ch/success?orderId=12840', - 'http://www.mysite.ch/fail' +$returnUrl = new Container\ReturnUrl( + 'http://www.mysite.ch/success?orderId=12840' ); // ----------------------------- @@ -41,7 +40,7 @@ $requestConfig, $terminalId, $payment, - $returnUrls + $returnUrl ); // Note: More data can be provided to InitializeRequest with setters, From ea22edd5e2dfcb57f3e7fb8b43e77df0305844f7 Mon Sep 17 00:00:00 2001 From: Robert Ritler Date: Mon, 10 Jun 2024 10:24:50 +0200 Subject: [PATCH 04/13] feat(saferpay)!: api update 1.32 => 1.33 * changes according to http://saferpay.github.io/jsonapi/#v1.33.0.0.20230321 Closes: #75 BREAKING-CHANGE: Saferpay Changelog: the error behavior ABORT was renamed to DO_NOT_RETRY, DeviceFingerprint was removed from all versions, the Twint object was removed from the responses --- .../Request/Container/RequestHeader.php | 2 +- .../Request/Container/RiskFactors.php | 17 ------------ .../Container/SecureCardData/Notification.php | 27 +++++++++++++++++++ .../Request/PaymentPage/InitializeRequest.php | 1 + .../SecureCardData/AliasInsertRequest.php | 18 +++++++++++++ .../Response/Container/PaymentMeans.php | 12 --------- lib/SaferpayJson/Response/Container/Twint.php | 23 ---------------- lib/SaferpayJson/Response/ErrorResponse.php | 2 +- 8 files changed, 48 insertions(+), 54 deletions(-) create mode 100644 lib/SaferpayJson/Request/Container/SecureCardData/Notification.php delete mode 100644 lib/SaferpayJson/Response/Container/Twint.php diff --git a/lib/SaferpayJson/Request/Container/RequestHeader.php b/lib/SaferpayJson/Request/Container/RequestHeader.php index 647e506..3c36d6f 100644 --- a/lib/SaferpayJson/Request/Container/RequestHeader.php +++ b/lib/SaferpayJson/Request/Container/RequestHeader.php @@ -12,7 +12,7 @@ final class RequestHeader * @var string * @SerializedName("SpecVersion") */ - private $specVersion = '1.32'; + private $specVersion = '1.33'; /** * @var string diff --git a/lib/SaferpayJson/Request/Container/RiskFactors.php b/lib/SaferpayJson/Request/Container/RiskFactors.php index 3b798e3..4173e82 100644 --- a/lib/SaferpayJson/Request/Container/RiskFactors.php +++ b/lib/SaferpayJson/Request/Container/RiskFactors.php @@ -34,12 +34,6 @@ final class RiskFactors */ private $isB2B; - /** - * @var string|null - * @SerializedName("DeviceFingerprint") - */ - private $deviceFingerprint; - public function getDeliveryType(): ?string { return $this->deliveryType; @@ -74,15 +68,4 @@ public function setIsB2B(?bool $isB2B): self $this->isB2B = $isB2B; return $this; } - - public function getDeviceFingerprint(): ?string - { - return $this->deviceFingerprint; - } - - public function setDeviceFingerprint(?string $deviceFingerprint): self - { - $this->deviceFingerprint = $deviceFingerprint; - return $this; - } } diff --git a/lib/SaferpayJson/Request/Container/SecureCardData/Notification.php b/lib/SaferpayJson/Request/Container/SecureCardData/Notification.php new file mode 100644 index 0000000..8c1428c --- /dev/null +++ b/lib/SaferpayJson/Request/Container/SecureCardData/Notification.php @@ -0,0 +1,27 @@ +notifyUrl; + } + + public function setNotifyUrl(?string $notifyUrl): self + { + $this->notifyUrl = $notifyUrl; + return $this; + } +} diff --git a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php index bf1b692..ad2830e 100644 --- a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php +++ b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php @@ -54,6 +54,7 @@ final class InitializeRequest extends Request public const PAYMENT_METHOD_VISA = "VISA"; public const PAYMENT_METHOD_VPAY = "VPAY"; public const PAYMENT_METHOD_PAYCONIQ = "PAYCONIQ"; + public const PAYMENT_METHOD_ACCOUNTTOACCOUNT = "ACCOUNTTOACCOUNT"; public const WALLET_MASTERPASS = "MASTERPASS"; public const WALLET_APPLEPAY = "APPLEPAY"; diff --git a/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php b/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php index 49df119..5e62353 100755 --- a/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php +++ b/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php @@ -11,6 +11,7 @@ use Ticketpark\SaferpayJson\Request\Container\PaymentMeans; use Ticketpark\SaferpayJson\Request\Container\RegisterAlias; use Ticketpark\SaferpayJson\Request\Container\ReturnUrl; +use Ticketpark\SaferpayJson\Request\Container\SecureCardData\Notification; use Ticketpark\SaferpayJson\Request\Container\Styling; use Ticketpark\SaferpayJson\Request\Request; use Ticketpark\SaferpayJson\Request\RequestCommonsTrait; @@ -98,6 +99,12 @@ final class AliasInsertRequest extends Request */ private $paymentMeans; + /** + * @var Notification|null + * @SerializedName("Notification") + */ + private $notification; + public function __construct( RequestConfig $requestConfig, RegisterAlias $registerAlias, @@ -226,4 +233,15 @@ public function execute(): AliasInsertResponse return $response; } + + public function getNotification(): ?Notification + { + return $this->notification; + } + + public function setNotification(?Notification $notification): self + { + $this->notification = $notification; + return $this; + } } diff --git a/lib/SaferpayJson/Response/Container/PaymentMeans.php b/lib/SaferpayJson/Response/Container/PaymentMeans.php index f9dbf08..d383b18 100644 --- a/lib/SaferpayJson/Response/Container/PaymentMeans.php +++ b/lib/SaferpayJson/Response/Container/PaymentMeans.php @@ -44,13 +44,6 @@ final class PaymentMeans */ private $bankAccount; - /** - * @var Twint|null - * @SerializedName("Twint") - * @Type("Ticketpark\SaferpayJson\Response\Container\Twint") - */ - private $twint; - /** * @var PayPal|null * @SerializedName("PayPal") @@ -83,11 +76,6 @@ public function getBankAccount(): ?BankAccount return $this->bankAccount; } - public function getTwint(): ?Twint - { - return $this->twint; - } - public function getPayPal(): ?PayPal { return $this->payPal; diff --git a/lib/SaferpayJson/Response/Container/Twint.php b/lib/SaferpayJson/Response/Container/Twint.php deleted file mode 100644 index a581f84..0000000 --- a/lib/SaferpayJson/Response/Container/Twint.php +++ /dev/null @@ -1,23 +0,0 @@ -") - */ - private $certificateExpirationDate; - - public function getCertificateExpirationDate(): ?\DateTime - { - return $this->certificateExpirationDate; - } -} diff --git a/lib/SaferpayJson/Response/ErrorResponse.php b/lib/SaferpayJson/Response/ErrorResponse.php index 92ed407..1098c43 100644 --- a/lib/SaferpayJson/Response/ErrorResponse.php +++ b/lib/SaferpayJson/Response/ErrorResponse.php @@ -10,7 +10,7 @@ class ErrorResponse extends Response { - public const BEHAVIOUR_ABORT = 'ABORT'; + public const BEHAVIOUR_DO_NOT_RETRY = 'DO_NOT_RETRY'; public const BEHAVIOUR_OTHER_MEANS = 'OTHER_MEANS'; public const BEHAVIOUR_RETRY = 'RETRY'; public const BEHAVIOUR_RETRY_LATER = 'RETRY_LATER'; From e1b64a88e8bfc120134f59cc389d5cc1cf22c2d8 Mon Sep 17 00:00:00 2001 From: Robert Ritler Date: Mon, 10 Jun 2024 10:49:27 +0200 Subject: [PATCH 05/13] fix: fixed valid PaymentMethods in InitializeRequest, AliasInsertRequest and InitializeRequest --- .../Request/PaymentPage/InitializeRequest.php | 9 +++++---- .../Request/SecureCardData/AliasInsertRequest.php | 1 - .../Request/Transaction/InitializeRequest.php | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php index ad2830e..a79e0b1 100644 --- a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php +++ b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php @@ -28,6 +28,7 @@ final class InitializeRequest extends Request public const API_PATH = '/Payment/v1/PaymentPage/Initialize'; public const RESPONSE_CLASS = InitializeResponse::class; + public const PAYMENT_METHOD_ACCOUNTTOACCOUNT = "ACCOUNTTOACCOUNT"; public const PAYMENT_METHOD_ALIPAY = "ALIPAY"; public const PAYMENT_METHOD_AMEX = "AMEX"; public const PAYMENT_METHOD_BANCONTACT = "BANCONTACT"; @@ -40,11 +41,13 @@ final class InitializeRequest extends Request public const PAYMENT_METHOD_IDEAL = "IDEAL"; public const PAYMENT_METHOD_INVOICE = "INVOICE"; public const PAYMENT_METHOD_JCB = "JCB"; + public const PAYMENT_METHOD_KLARNA = "KLARNA"; public const PAYMENT_METHOD_MAESTRO = "MAESTRO"; public const PAYMENT_METHOD_MASTERCARD = "MASTERCARD"; public const PAYMENT_METHOD_MYONE = "MYONE"; - public const PAYMENT_METHOD_PAYPAL = "PAYPAL"; + public const PAYMENT_METHOD_PAYCONIQ = "PAYCONIQ"; public const PAYMENT_METHOD_PAYDIREKT = "PAYDIREKT"; + public const PAYMENT_METHOD_PAYPAL = "PAYPAL"; public const PAYMENT_METHOD_POSTCARD = "POSTCARD"; public const PAYMENT_METHOD_POSTFINANCE = "POSTFINANCE"; public const PAYMENT_METHOD_SAFERPAYTEST = "SAFERPAYTEST"; @@ -52,9 +55,7 @@ final class InitializeRequest extends Request public const PAYMENT_METHOD_TWINT = "TWINT"; public const PAYMENT_METHOD_UNIONPAY = "UNIONPAY"; public const PAYMENT_METHOD_VISA = "VISA"; - public const PAYMENT_METHOD_VPAY = "VPAY"; - public const PAYMENT_METHOD_PAYCONIQ = "PAYCONIQ"; - public const PAYMENT_METHOD_ACCOUNTTOACCOUNT = "ACCOUNTTOACCOUNT"; + public const PAYMENT_METHOD_WLCRYPTOPAYMENTS = "WLCRYPTOPAYMENTS"; public const WALLET_MASTERPASS = "MASTERPASS"; public const WALLET_APPLEPAY = "APPLEPAY"; diff --git a/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php b/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php index 5e62353..fc19429 100755 --- a/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php +++ b/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php @@ -36,7 +36,6 @@ final class AliasInsertRequest extends Request public const PAYMENT_METHOD_SAFERPAYTEST = "SAFERPAYTEST"; public const PAYMENT_METHOD_UNIONPAY = "UNIONPAY"; public const PAYMENT_METHOD_VISA = "VISA"; - public const PAYMENT_METHOD_VPAY = "VPAY"; public const TYPE_CARD = 'CARD'; public const TYPE_BANK_ACCOUNT = 'BANK_ACCOUNT'; diff --git a/lib/SaferpayJson/Request/Transaction/InitializeRequest.php b/lib/SaferpayJson/Request/Transaction/InitializeRequest.php index a22e7b5..70de390 100644 --- a/lib/SaferpayJson/Request/Transaction/InitializeRequest.php +++ b/lib/SaferpayJson/Request/Transaction/InitializeRequest.php @@ -38,7 +38,6 @@ final class InitializeRequest extends Request public const PAYMENT_METHOD_MYONE = "MYONE"; public const PAYMENT_METHOD_UNIONPAY = "UNIONPAY"; public const PAYMENT_METHOD_VISA = "VISA"; - public const PAYMENT_METHOD_VPAY = "VPAY"; public const WALLET_MASTERPASS = "MASTERPASS"; From 68b588463f8106dc5d7fe48b48866829f5f7db10 Mon Sep 17 00:00:00 2001 From: Robert Ritler Date: Mon, 10 Jun 2024 11:21:42 +0200 Subject: [PATCH 06/13] feat(saferpay)!: api update 1.33 => 1.34 * changes according to http://saferpay.github.io/jsonapi/#v1.34.0.0.20230516 Closes: #82 BREAKING-CHANGE: Saferpay Changelog: removed MASTERPASS as valid value from field Wallets in PaymentPage/Initialize requests, removed UNIONPAY as valid value from field PaymentMethods in SecureCardData/AliasInsert requests --- .../Request/Container/RequestHeader.php | 2 +- .../Request/Container/RiskFactors.php | 17 +++ lib/SaferpayJson/Request/Container/Wallet.php | 102 ------------------ .../Request/PaymentPage/InitializeRequest.php | 1 - .../SecureCardData/AliasInsertRequest.php | 1 - .../Request/Transaction/InitializeRequest.php | 19 ---- 6 files changed, 18 insertions(+), 124 deletions(-) delete mode 100644 lib/SaferpayJson/Request/Container/Wallet.php diff --git a/lib/SaferpayJson/Request/Container/RequestHeader.php b/lib/SaferpayJson/Request/Container/RequestHeader.php index 3c36d6f..b23c83e 100644 --- a/lib/SaferpayJson/Request/Container/RequestHeader.php +++ b/lib/SaferpayJson/Request/Container/RequestHeader.php @@ -12,7 +12,7 @@ final class RequestHeader * @var string * @SerializedName("SpecVersion") */ - private $specVersion = '1.33'; + private $specVersion = '1.34'; /** * @var string diff --git a/lib/SaferpayJson/Request/Container/RiskFactors.php b/lib/SaferpayJson/Request/Container/RiskFactors.php index 4173e82..b9a2851 100644 --- a/lib/SaferpayJson/Request/Container/RiskFactors.php +++ b/lib/SaferpayJson/Request/Container/RiskFactors.php @@ -34,6 +34,12 @@ final class RiskFactors */ private $isB2B; + /** + * @var string|null + * @SerializedName("DeviceFingerprintTransactionId") + */ + private $deviceFingerprintTransactionId; + public function getDeliveryType(): ?string { return $this->deliveryType; @@ -68,4 +74,15 @@ public function setIsB2B(?bool $isB2B): self $this->isB2B = $isB2B; return $this; } + + public function getDeviceFingerprintTransactionId(): ?string + { + return $this->deviceFingerprintTransactionId; + } + + public function setDeviceFingerprintTransactionId(?string $deviceFingerprintTransactionId): self + { + $this->deviceFingerprintTransactionId = $deviceFingerprintTransactionId; + return $this; + } } diff --git a/lib/SaferpayJson/Request/Container/Wallet.php b/lib/SaferpayJson/Request/Container/Wallet.php deleted file mode 100644 index 82dbd5c..0000000 --- a/lib/SaferpayJson/Request/Container/Wallet.php +++ /dev/null @@ -1,102 +0,0 @@ -|null - * @SerializedName("PaymentMethods") - */ - private $paymentMethods; - - /** - * @var bool|null - * @SerializedName("RequestDeliveryAddress") - */ - private $requestDeliveryAddress; - - /** - * @var bool|null - * @SerializedName("EnableAmountAdjustment") - */ - private $enableAmountAdjustment; - - public function __construct(string $type) - { - $this->type = $type; - } - - public function setPaymentMethods(?array $paymentMethods): Wallet - { - $this->paymentMethods = $paymentMethods; - return $this; - } - - public function setRequestDeliveryAddress(?bool $requestDeliveryAddress): Wallet - { - $this->requestDeliveryAddress = $requestDeliveryAddress; - return $this; - } - - public function setEnableAmountAdjustment(?bool $enableAmountAdjustment): Wallet - { - $this->enableAmountAdjustment = $enableAmountAdjustment; - return $this; - } - - public function getType(): string - { - return $this->type; - } - - public function getPaymentMethods(): ?array - { - return $this->paymentMethods; - } - - public function getRequestDeliveryAddress(): ?bool - { - return $this->requestDeliveryAddress; - } - - public function getEnableAmountAdjustment(): ?bool - { - return $this->enableAmountAdjustment; - } -} diff --git a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php index a79e0b1..1439e78 100644 --- a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php +++ b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php @@ -57,7 +57,6 @@ final class InitializeRequest extends Request public const PAYMENT_METHOD_VISA = "VISA"; public const PAYMENT_METHOD_WLCRYPTOPAYMENTS = "WLCRYPTOPAYMENTS"; - public const WALLET_MASTERPASS = "MASTERPASS"; public const WALLET_APPLEPAY = "APPLEPAY"; public const WALLET_GOOGLEPAY = "GOOGLEPAY"; diff --git a/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php b/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php index fc19429..efb2388 100755 --- a/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php +++ b/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php @@ -34,7 +34,6 @@ final class AliasInsertRequest extends Request public const PAYMENT_METHOD_MASTERCARD = "MASTERCARD"; public const PAYMENT_METHOD_MYONE = "MYONE"; public const PAYMENT_METHOD_SAFERPAYTEST = "SAFERPAYTEST"; - public const PAYMENT_METHOD_UNIONPAY = "UNIONPAY"; public const PAYMENT_METHOD_VISA = "VISA"; public const TYPE_CARD = 'CARD'; diff --git a/lib/SaferpayJson/Request/Transaction/InitializeRequest.php b/lib/SaferpayJson/Request/Transaction/InitializeRequest.php index 70de390..59756fa 100644 --- a/lib/SaferpayJson/Request/Transaction/InitializeRequest.php +++ b/lib/SaferpayJson/Request/Transaction/InitializeRequest.php @@ -15,7 +15,6 @@ use Ticketpark\SaferpayJson\Request\Container\ReturnUrl; use Ticketpark\SaferpayJson\Request\Container\RiskFactors; use Ticketpark\SaferpayJson\Request\Container\Styling; -use Ticketpark\SaferpayJson\Request\Container\Wallet; use Ticketpark\SaferpayJson\Request\Request; use Ticketpark\SaferpayJson\Request\RequestCommonsTrait; use Ticketpark\SaferpayJson\Request\RequestConfig; @@ -89,12 +88,6 @@ final class InitializeRequest extends Request */ private $styling; - /** - * @var Wallet|null - * @SerializedName("Wallet") - */ - private $wallet; - /** * @var array|null * @SerializedName("PaymentMethods") @@ -181,13 +174,6 @@ public function setStyling(?Styling $styling): self return $this; } - public function setWallet(?Wallet $wallet): self - { - $this->wallet = $wallet; - - return $this; - } - public function setPaymentMethods(?array $paymentMethods): self { $this->paymentMethods = $paymentMethods; @@ -262,11 +248,6 @@ public function getStyling(): ?Styling return $this->styling; } - public function getWallet(): ?Wallet - { - return $this->wallet; - } - public function getPaymentMethods(): ?array { return $this->paymentMethods; From 4f547d784ea343ddd296f53106904e32a1c11e80 Mon Sep 17 00:00:00 2001 From: Robert Ritler Date: Mon, 10 Jun 2024 11:45:00 +0200 Subject: [PATCH 07/13] feat(saferpay): api update 1.34 => 1.35 * changes according to http://saferpay.github.io/jsonapi/#v1.35.0.0.20230718 Closes: #83 --- .../Request/Container/Notification.php | 17 ++++++++++++ .../Request/Container/RequestHeader.php | 2 +- .../Container/Transaction/Notification.php | 27 +++++++++++++++++++ .../Request/PaymentPage/InitializeRequest.php | 1 + .../AuthorizeReferencedRequest.php | 18 +++++++++++++ .../Request/Transaction/InitializeRequest.php | 18 +++++++++++++ 6 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 lib/SaferpayJson/Request/Container/Transaction/Notification.php diff --git a/lib/SaferpayJson/Request/Container/Notification.php b/lib/SaferpayJson/Request/Container/Notification.php index 8f8bd45..ee92950 100644 --- a/lib/SaferpayJson/Request/Container/Notification.php +++ b/lib/SaferpayJson/Request/Container/Notification.php @@ -20,6 +20,12 @@ final class Notification */ private $payerEmail; + /** + * @var string|null + * @SerializedName("PayerDccReceiptEmail") + */ + private $payerDccReceiptEmail; + /** * @var string|null * @SerializedName("SuccessNotifyUrl") @@ -56,6 +62,17 @@ public function setPayerEmail(string $payerEmail): self return $this; } + public function getPayerDccReceiptEmail(): ?string + { + return $this->payerDccReceiptEmail; + } + + public function setPayerDccReceiptEmail(?string $payerDccReceiptEmail): self + { + $this->payerDccReceiptEmail = $payerDccReceiptEmail; + return $this; + } + public function getSuccessNotifyUrl(): ?string { return $this->successNotifyUrl; diff --git a/lib/SaferpayJson/Request/Container/RequestHeader.php b/lib/SaferpayJson/Request/Container/RequestHeader.php index b23c83e..410251e 100644 --- a/lib/SaferpayJson/Request/Container/RequestHeader.php +++ b/lib/SaferpayJson/Request/Container/RequestHeader.php @@ -12,7 +12,7 @@ final class RequestHeader * @var string * @SerializedName("SpecVersion") */ - private $specVersion = '1.34'; + private $specVersion = '1.35'; /** * @var string diff --git a/lib/SaferpayJson/Request/Container/Transaction/Notification.php b/lib/SaferpayJson/Request/Container/Transaction/Notification.php new file mode 100644 index 0000000..91b558d --- /dev/null +++ b/lib/SaferpayJson/Request/Container/Transaction/Notification.php @@ -0,0 +1,27 @@ +payerDccReceiptEmail; + } + + public function setPayerDccReceiptEmail(?string $payerDccReceiptEmail): self + { + $this->payerDccReceiptEmail = $payerDccReceiptEmail; + return $this; + } +} diff --git a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php index 1439e78..c14a6d6 100644 --- a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php +++ b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php @@ -34,6 +34,7 @@ final class InitializeRequest extends Request public const PAYMENT_METHOD_BANCONTACT = "BANCONTACT"; public const PAYMENT_METHOD_BONUS = "BONUS"; public const PAYMENT_METHOD_DINERS = "DINERS"; + public const PAYMENT_METHOD_CARD = "CARD"; public const PAYMENT_METHOD_DIRECTDEBIT = "DIRECTDEBIT"; public const PAYMENT_METHOD_EPRZELEWY = "EPRZELEWY"; public const PAYMENT_METHOD_EPS = "EPS"; diff --git a/lib/SaferpayJson/Request/Transaction/AuthorizeReferencedRequest.php b/lib/SaferpayJson/Request/Transaction/AuthorizeReferencedRequest.php index 1ada576..3cf76d1 100644 --- a/lib/SaferpayJson/Request/Transaction/AuthorizeReferencedRequest.php +++ b/lib/SaferpayJson/Request/Transaction/AuthorizeReferencedRequest.php @@ -7,6 +7,7 @@ use JMS\Serializer\Annotation\SerializedName; use Ticketpark\SaferpayJson\Request\Container\Authentication; use Ticketpark\SaferpayJson\Request\Container\Payment; +use Ticketpark\SaferpayJson\Request\Container\Transaction\Notification; use Ticketpark\SaferpayJson\Request\Container\TransactionReference; use Ticketpark\SaferpayJson\Request\Request; use Ticketpark\SaferpayJson\Request\RequestCommonsTrait; @@ -49,6 +50,12 @@ final class AuthorizeReferencedRequest extends Request */ private $suppressDcc; + /** + * @var Notification|null + * @SerializedName("Notification") + */ + private $notification; + public function __construct( RequestConfig $requestConfig, string $terminalId, @@ -122,6 +129,17 @@ public function setSuppressDcc(?bool $suppressDcc): self return $this; } + public function getNotification(): ?Notification + { + return $this->notification; + } + + public function setNotification(?Notification $notification): self + { + $this->notification = $notification; + return $this; + } + public function execute(): AuthorizeReferencedResponse { /** @var AuthorizeReferencedResponse $response */ diff --git a/lib/SaferpayJson/Request/Transaction/InitializeRequest.php b/lib/SaferpayJson/Request/Transaction/InitializeRequest.php index 59756fa..47bf640 100644 --- a/lib/SaferpayJson/Request/Transaction/InitializeRequest.php +++ b/lib/SaferpayJson/Request/Transaction/InitializeRequest.php @@ -15,6 +15,7 @@ use Ticketpark\SaferpayJson\Request\Container\ReturnUrl; use Ticketpark\SaferpayJson\Request\Container\RiskFactors; use Ticketpark\SaferpayJson\Request\Container\Styling; +use Ticketpark\SaferpayJson\Request\Container\Transaction\Notification; use Ticketpark\SaferpayJson\Request\Request; use Ticketpark\SaferpayJson\Request\RequestCommonsTrait; use Ticketpark\SaferpayJson\Request\RequestConfig; @@ -118,6 +119,12 @@ final class InitializeRequest extends Request */ private $redirectNotifyUrls; + /** + * @var Notification|null + * @SerializedName("Notification") + */ + private $notification; + public function __construct( RequestConfig $requestConfig, string $terminalId, @@ -272,4 +279,15 @@ public function getRedirectNotifyUrls(): ?RedirectNotifyUrls { return $this->redirectNotifyUrls; } + + public function getNotification(): ?Notification + { + return $this->notification; + } + + public function setNotification(?Notification $notification): self + { + $this->notification = $notification; + return $this; + } } From 21788025ed36675dc9bba27f9790346cd194ffa1 Mon Sep 17 00:00:00 2001 From: Robert Ritler Date: Mon, 10 Jun 2024 11:50:50 +0200 Subject: [PATCH 08/13] feat(saferpay)!: api update 1.35 => 1.36 * changes according to http://saferpay.github.io/jsonapi/#v1.36.0.0.20230912 Closes: #84 BREAKING-CHANGE: Saferpay Changelog: removed UNIONPAY as valid value from field PaymentMethods in Transaction/Initialize requests, removed LegalForm, renamed the values of the Condition field --- lib/SaferpayJson/Request/Container/Address.php | 18 ------------------ .../Request/Container/RequestHeader.php | 2 +- .../Request/PaymentPage/InitializeRequest.php | 4 ++-- .../Request/Transaction/InitializeRequest.php | 1 - .../Response/Container/Address.php | 12 ------------ 5 files changed, 3 insertions(+), 34 deletions(-) diff --git a/lib/SaferpayJson/Request/Container/Address.php b/lib/SaferpayJson/Request/Container/Address.php index f433f93..b0d3d8a 100644 --- a/lib/SaferpayJson/Request/Container/Address.php +++ b/lib/SaferpayJson/Request/Container/Address.php @@ -74,12 +74,6 @@ final class Address */ private $dateOfBirth; - /** - * @var string|null - * @SerializedName("LegalForm") - */ - private $legalForm; - /** * @var string|null * @SerializedName("Street2") @@ -224,18 +218,6 @@ public function setDateOfBirth(?\DateTime $dateOfBirth): self return $this; } - public function getLegalForm(): ?string - { - return $this->legalForm; - } - - public function setLegalForm(?string $legalForm): self - { - $this->legalForm = $legalForm; - - return $this; - } - public function getStreet2(): ?string { return $this->street2; diff --git a/lib/SaferpayJson/Request/Container/RequestHeader.php b/lib/SaferpayJson/Request/Container/RequestHeader.php index 410251e..12ffad7 100644 --- a/lib/SaferpayJson/Request/Container/RequestHeader.php +++ b/lib/SaferpayJson/Request/Container/RequestHeader.php @@ -12,7 +12,7 @@ final class RequestHeader * @var string * @SerializedName("SpecVersion") */ - private $specVersion = '1.35'; + private $specVersion = '1.36'; /** * @var string diff --git a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php index c14a6d6..1492434 100644 --- a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php +++ b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php @@ -61,8 +61,8 @@ final class InitializeRequest extends Request public const WALLET_APPLEPAY = "APPLEPAY"; public const WALLET_GOOGLEPAY = "GOOGLEPAY"; - public const CONDITION_WITH_LIABILITY_SHIFT = 'WITH_LIABILITY_SHIFT'; - public const CONDITION_IF_ALLOWED_BY_SCHEME = 'IF_ALLOWED_BY_SCHEME'; + public const CONDITION_THREE_DS_AUTHENTICATION_SUCCESSFUL_OR_ATTEMPTED = 'THREE_DS_AUTHENTICATION_SUCCESSFUL_OR_ATTEMPTED'; + public const CONDITION_NONE = 'NONE'; /** * @var string diff --git a/lib/SaferpayJson/Request/Transaction/InitializeRequest.php b/lib/SaferpayJson/Request/Transaction/InitializeRequest.php index 47bf640..b6d7f25 100644 --- a/lib/SaferpayJson/Request/Transaction/InitializeRequest.php +++ b/lib/SaferpayJson/Request/Transaction/InitializeRequest.php @@ -36,7 +36,6 @@ final class InitializeRequest extends Request public const PAYMENT_METHOD_MAESTRO = "MAESTRO"; public const PAYMENT_METHOD_MASTERCARD = "MASTERCARD"; public const PAYMENT_METHOD_MYONE = "MYONE"; - public const PAYMENT_METHOD_UNIONPAY = "UNIONPAY"; public const PAYMENT_METHOD_VISA = "VISA"; public const WALLET_MASTERPASS = "MASTERPASS"; diff --git a/lib/SaferpayJson/Response/Container/Address.php b/lib/SaferpayJson/Response/Container/Address.php index 1c62fce..ecfd185 100644 --- a/lib/SaferpayJson/Response/Container/Address.php +++ b/lib/SaferpayJson/Response/Container/Address.php @@ -84,13 +84,6 @@ final class Address */ private $dateOfBirth; - /** - * @var string|null - * @SerializedName("LegalForm") - * @Type("string") - */ - private $legalForm; - /** * @var string|null * @SerializedName("Street2") @@ -168,11 +161,6 @@ public function getDateOfBirth(): ?\DateTime return $this->dateOfBirth; } - public function getLegalForm(): ?string - { - return $this->legalForm; - } - public function getStreet2(): ?string { return $this->street2; From dea9412140207f5e8ba342ec9743faa2f12cf7ba Mon Sep 17 00:00:00 2001 From: Robert Ritler Date: Mon, 10 Jun 2024 11:56:58 +0200 Subject: [PATCH 09/13] feat(saferpay)!: api update 1.36 => 1.37 * changes according to http://saferpay.github.io/jsonapi/#v1.37.0.0.20231114 Closes: #85 BREAKING-CHANGE: Saferpay Changelog: added TokenType field to SchemeToken (mandatory) --- .../Request/Container/RequestHeader.php | 2 +- lib/SaferpayJson/Request/Container/SchemeToken.php | 14 +++++++++++++- .../Request/PaymentPage/InitializeRequest.php | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/SaferpayJson/Request/Container/RequestHeader.php b/lib/SaferpayJson/Request/Container/RequestHeader.php index 12ffad7..a173daf 100644 --- a/lib/SaferpayJson/Request/Container/RequestHeader.php +++ b/lib/SaferpayJson/Request/Container/RequestHeader.php @@ -12,7 +12,7 @@ final class RequestHeader * @var string * @SerializedName("SpecVersion") */ - private $specVersion = '1.36'; + private $specVersion = '1.37'; /** * @var string diff --git a/lib/SaferpayJson/Request/Container/SchemeToken.php b/lib/SaferpayJson/Request/Container/SchemeToken.php index 41d04f5..1d61e31 100644 --- a/lib/SaferpayJson/Request/Container/SchemeToken.php +++ b/lib/SaferpayJson/Request/Container/SchemeToken.php @@ -43,12 +43,19 @@ final class SchemeToken */ private $eci; - public function __construct(string $number, int $expMonth, int $expYear, string $authValue) + /** + * @var string + * @SerializedName("TokenType") + */ + private $tokenType; + + public function __construct(string $number, int $expMonth, int $expYear, string $authValue, string $tokenType) { $this->number = $number; $this->expMonth = $expMonth; $this->expYear = $expYear; $this->authValue = $authValue; + $this->tokenType = $tokenType; } public function getNumber(): string @@ -81,4 +88,9 @@ public function setEci(?string $eci): self $this->eci = $eci; return $this; } + + public function getTokenType(): string + { + return $this->tokenType; + } } diff --git a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php index 1492434..2b9013b 100644 --- a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php +++ b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php @@ -51,6 +51,7 @@ final class InitializeRequest extends Request public const PAYMENT_METHOD_PAYPAL = "PAYPAL"; public const PAYMENT_METHOD_POSTCARD = "POSTCARD"; public const PAYMENT_METHOD_POSTFINANCE = "POSTFINANCE"; + public const PAYMENT_METHOD_POSTFINANCEPAY = "POSTFINANCEPAY"; public const PAYMENT_METHOD_SAFERPAYTEST = "SAFERPAYTEST"; public const PAYMENT_METHOD_SOFORT = "SOFORT"; public const PAYMENT_METHOD_TWINT = "TWINT"; From 3255e53587f1486a4dd3e30e4c36a025cfdce4a8 Mon Sep 17 00:00:00 2001 From: Robert Ritler Date: Mon, 10 Jun 2024 12:12:55 +0200 Subject: [PATCH 10/13] feat(saferpay)!: api update 1.37 => 1.38 * changes according to http://saferpay.github.io/jsonapi/#v1.38.0.0.20240123 Closes: #86 BREAKING-CHANGE: Saferpay Changelog: removed Alipay from PaymentMethodOptions --- lib/SaferpayJson/Request/Container/A2a.php | 26 ++++++++++++++++ lib/SaferpayJson/Request/Container/Alipay.php | 27 ----------------- .../Container/PaymentMethodsOptions.php | 19 ------------ .../Request/Container/RequestHeader.php | 2 +- .../Transaction/PaymentMethodsOptions.php | 30 +++++++++++++++++++ .../Request/Transaction/RefundRequest.php | 19 +++++++++++- 6 files changed, 75 insertions(+), 48 deletions(-) create mode 100644 lib/SaferpayJson/Request/Container/A2a.php delete mode 100644 lib/SaferpayJson/Request/Container/Alipay.php create mode 100644 lib/SaferpayJson/Request/Container/Transaction/PaymentMethodsOptions.php diff --git a/lib/SaferpayJson/Request/Container/A2a.php b/lib/SaferpayJson/Request/Container/A2a.php new file mode 100644 index 0000000..f40b034 --- /dev/null +++ b/lib/SaferpayJson/Request/Container/A2a.php @@ -0,0 +1,26 @@ +accountHolderName = $accountHolderName; + } + + public function getAccountHolderName(): string + { + return $this->accountHolderName; + } +} diff --git a/lib/SaferpayJson/Request/Container/Alipay.php b/lib/SaferpayJson/Request/Container/Alipay.php deleted file mode 100644 index 23c366a..0000000 --- a/lib/SaferpayJson/Request/Container/Alipay.php +++ /dev/null @@ -1,27 +0,0 @@ -localWallet = $localWallet; - } - - public function getLocalWallet(): ?string - { - return $this->localWallet; - } -} diff --git a/lib/SaferpayJson/Request/Container/PaymentMethodsOptions.php b/lib/SaferpayJson/Request/Container/PaymentMethodsOptions.php index c9f0a5a..a345a34 100644 --- a/lib/SaferpayJson/Request/Container/PaymentMethodsOptions.php +++ b/lib/SaferpayJson/Request/Container/PaymentMethodsOptions.php @@ -9,13 +9,6 @@ final class PaymentMethodsOptions { - /** - * @var Alipay|null - * @SerializedName("Alipay") - * @Type("Ticketpark\SaferpayJson\Request\Container\Alipay") - */ - private $alipay; - /** * @var Ideal|null * @SerializedName("Ideal") @@ -30,18 +23,6 @@ final class PaymentMethodsOptions */ private $klarna; - public function getAlipay(): ?Alipay - { - return $this->alipay; - } - - public function setAlipay(?Alipay $alipay): self - { - $this->alipay = $alipay; - - return $this; - } - public function getIdeal(): ?Ideal { return $this->ideal; diff --git a/lib/SaferpayJson/Request/Container/RequestHeader.php b/lib/SaferpayJson/Request/Container/RequestHeader.php index a173daf..2460048 100644 --- a/lib/SaferpayJson/Request/Container/RequestHeader.php +++ b/lib/SaferpayJson/Request/Container/RequestHeader.php @@ -12,7 +12,7 @@ final class RequestHeader * @var string * @SerializedName("SpecVersion") */ - private $specVersion = '1.37'; + private $specVersion = '1.38'; /** * @var string diff --git a/lib/SaferpayJson/Request/Container/Transaction/PaymentMethodsOptions.php b/lib/SaferpayJson/Request/Container/Transaction/PaymentMethodsOptions.php new file mode 100644 index 0000000..2b37630 --- /dev/null +++ b/lib/SaferpayJson/Request/Container/Transaction/PaymentMethodsOptions.php @@ -0,0 +1,30 @@ +a2a; + } + + public function setA2a(?A2a $a2a): self + { + $this->a2a = $a2a; + return $this; + } +} diff --git a/lib/SaferpayJson/Request/Transaction/RefundRequest.php b/lib/SaferpayJson/Request/Transaction/RefundRequest.php index b39c91e..9c8e7df 100644 --- a/lib/SaferpayJson/Request/Transaction/RefundRequest.php +++ b/lib/SaferpayJson/Request/Transaction/RefundRequest.php @@ -8,7 +8,7 @@ use Ticketpark\SaferpayJson\Request\Container\CaptureReference; use Ticketpark\SaferpayJson\Request\Container\PendingNotification; use Ticketpark\SaferpayJson\Request\Container\Refund; -use Ticketpark\SaferpayJson\Request\Container\TransactionReference; +use Ticketpark\SaferpayJson\Request\Container\Transaction\PaymentMethodsOptions; use Ticketpark\SaferpayJson\Request\Request; use Ticketpark\SaferpayJson\Request\RequestCommonsTrait; use Ticketpark\SaferpayJson\Request\RequestConfig; @@ -38,6 +38,12 @@ final class RefundRequest extends Request */ private $pendingNotification; + /** + * @var PaymentMethodsOptions|null + * @SerializedName("PaymentMethodsOptions") + */ + private $paymentMethodsOptions; + public function __construct( RequestConfig $requestConfig, Refund $refund, @@ -85,6 +91,17 @@ public function setPendingNotification(?PendingNotification $pendingNotification return $this; } + public function getPaymentMethodsOptions(): ?PaymentMethodsOptions + { + return $this->paymentMethodsOptions; + } + + public function setPaymentMethodsOptions(?PaymentMethodsOptions $paymentMethodsOptions): self + { + $this->paymentMethodsOptions = $paymentMethodsOptions; + return $this; + } + public function execute(): RefundResponse { /** @var RefundResponse $response */ From 5d2b7079593726d3690af792e7bd54a0cc25e08a Mon Sep 17 00:00:00 2001 From: Robert Ritler Date: Mon, 10 Jun 2024 12:16:45 +0200 Subject: [PATCH 11/13] feat(saferpay)!: api update 1.38 => 1.39 * changes according to http://saferpay.github.io/jsonapi/#v1.39.0.0.20240319 Closes: #87 BREAKING-CHANGE: Saferpay Changelog: removed Styling container from PaymentPage/Initialize, option MANUAL_REVIEW in field Result of FraudPrevention container is now called CHALLENGED --- .../Request/Container/RequestHeader.php | 2 +- .../Request/PaymentPage/InitializeRequest.php | 19 ------------------- .../Response/Container/FraudPrevention.php | 2 +- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/lib/SaferpayJson/Request/Container/RequestHeader.php b/lib/SaferpayJson/Request/Container/RequestHeader.php index 2460048..4d5c288 100644 --- a/lib/SaferpayJson/Request/Container/RequestHeader.php +++ b/lib/SaferpayJson/Request/Container/RequestHeader.php @@ -12,7 +12,7 @@ final class RequestHeader * @var string * @SerializedName("SpecVersion") */ - private $specVersion = '1.38'; + private $specVersion = '1.39'; /** * @var string diff --git a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php index 2b9013b..8dce1bf 100644 --- a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php +++ b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php @@ -16,7 +16,6 @@ use Ticketpark\SaferpayJson\Request\Container\RegisterAlias; use Ticketpark\SaferpayJson\Request\Container\ReturnUrl; use Ticketpark\SaferpayJson\Request\Container\RiskFactors; -use Ticketpark\SaferpayJson\Request\Container\Styling; use Ticketpark\SaferpayJson\Request\Request; use Ticketpark\SaferpayJson\Request\RequestCommonsTrait; use Ticketpark\SaferpayJson\Request\RequestConfig; @@ -131,12 +130,6 @@ final class InitializeRequest extends Request */ private $notification; - /** - * @var Styling|null - * @SerializedName("Styling") - */ - private $styling; - /** * @var AddressForm|null * @SerializedName("BillingAddressForm") @@ -318,18 +311,6 @@ public function setNotification(?Notification $notification): self return $this; } - public function getStyling(): ?Styling - { - return $this->styling; - } - - public function setStyling(?Styling $styling): self - { - $this->styling = $styling; - - return $this; - } - public function getBillingAddressForm(): ?AddressForm { return $this->billingAddressForm; diff --git a/lib/SaferpayJson/Response/Container/FraudPrevention.php b/lib/SaferpayJson/Response/Container/FraudPrevention.php index 372a945..98b9b87 100644 --- a/lib/SaferpayJson/Response/Container/FraudPrevention.php +++ b/lib/SaferpayJson/Response/Container/FraudPrevention.php @@ -10,7 +10,7 @@ final class FraudPrevention { public const APPROVED = 'APPROVED'; - public const MANUAL_REVIEW = 'MANUAL_REVIEW'; + public const CHALLENGED = 'CHALLENGED'; /** * @var string|null From 80d552cbadf8b5d5f488cc367e1452a06173bad2 Mon Sep 17 00:00:00 2001 From: Robert Ritler Date: Mon, 10 Jun 2024 13:22:45 +0200 Subject: [PATCH 12/13] feat(saferpay)!: api update 1.39 => 1.40 * changes according to http://saferpay.github.io/jsonapi/index.html Closes: #88 BREAKING-CHANGE: Saferpay Changelog: removed PAYPAL as option in Transaction/RedirectPayment, removed POSTFINANCE and POSTCARD as valid values for PaymentMethods, removed BANCONTACT as valid value for PaymentMethods in Alias/Insert --- lib/SaferpayJson/Request/Container/RequestHeader.php | 2 +- lib/SaferpayJson/Request/Container/SchemeToken.php | 8 ++++++++ .../Request/PaymentPage/InitializeRequest.php | 3 +-- .../Request/SecureCardData/AliasInsertRequest.php | 3 ++- .../Request/Transaction/InitializeRequest.php | 1 + lib/SaferpayJson/Response/Container/Brand.php | 1 + 6 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/SaferpayJson/Request/Container/RequestHeader.php b/lib/SaferpayJson/Request/Container/RequestHeader.php index 4d5c288..a146127 100644 --- a/lib/SaferpayJson/Request/Container/RequestHeader.php +++ b/lib/SaferpayJson/Request/Container/RequestHeader.php @@ -12,7 +12,7 @@ final class RequestHeader * @var string * @SerializedName("SpecVersion") */ - private $specVersion = '1.39'; + private $specVersion = '1.40'; /** * @var string diff --git a/lib/SaferpayJson/Request/Container/SchemeToken.php b/lib/SaferpayJson/Request/Container/SchemeToken.php index 1d61e31..9f4e0a2 100644 --- a/lib/SaferpayJson/Request/Container/SchemeToken.php +++ b/lib/SaferpayJson/Request/Container/SchemeToken.php @@ -9,6 +9,14 @@ final class SchemeToken { + public const TOKEN_TYPE_APPLEPAY = "APPLEPAY"; + public const TOKEN_TYPE_GOOGLEPAY = "GOOGLEPAY"; + public const TOKEN_TYPE_SAMSUNGPAY = "SAMSUNGPAY"; + public const TOKEN_TYPE_CLICKTOPAY = "CLICKTOPAY"; + public const TOKEN_TYPE_OTHER = "OTHER"; + public const TOKEN_TYPE_MDES = "MDES"; + public const TOKEN_TYPE_VTS = "VTS"; + /** * @var string * @SerializedName("Number") diff --git a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php index 8dce1bf..6364582 100644 --- a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php +++ b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php @@ -48,14 +48,13 @@ final class InitializeRequest extends Request public const PAYMENT_METHOD_PAYCONIQ = "PAYCONIQ"; public const PAYMENT_METHOD_PAYDIREKT = "PAYDIREKT"; public const PAYMENT_METHOD_PAYPAL = "PAYPAL"; - public const PAYMENT_METHOD_POSTCARD = "POSTCARD"; - public const PAYMENT_METHOD_POSTFINANCE = "POSTFINANCE"; public const PAYMENT_METHOD_POSTFINANCEPAY = "POSTFINANCEPAY"; public const PAYMENT_METHOD_SAFERPAYTEST = "SAFERPAYTEST"; public const PAYMENT_METHOD_SOFORT = "SOFORT"; public const PAYMENT_METHOD_TWINT = "TWINT"; public const PAYMENT_METHOD_UNIONPAY = "UNIONPAY"; public const PAYMENT_METHOD_VISA = "VISA"; + public const PAYMENT_METHOD_WECHATPAY = "WECHATPAY"; public const PAYMENT_METHOD_WLCRYPTOPAYMENTS = "WLCRYPTOPAYMENTS"; public const WALLET_APPLEPAY = "APPLEPAY"; diff --git a/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php b/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php index efb2388..1897848 100755 --- a/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php +++ b/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php @@ -25,7 +25,6 @@ final class AliasInsertRequest extends Request public const RESPONSE_CLASS = AliasInsertResponse::class; public const PAYMENT_METHOD_AMEX = "AMEX"; - public const PAYMENT_METHOD_BANCONTACT = "BANCONTACT"; public const PAYMENT_METHOD_BONUS = "BONUS"; public const PAYMENT_METHOD_DINERS = "DINERS"; public const PAYMENT_METHOD_DIRECTDEBIT = "DIRECTDEBIT"; @@ -33,8 +32,10 @@ final class AliasInsertRequest extends Request public const PAYMENT_METHOD_MAESTRO = "MAESTRO"; public const PAYMENT_METHOD_MASTERCARD = "MASTERCARD"; public const PAYMENT_METHOD_MYONE = "MYONE"; + public const PAYMENT_METHOD_POSTFINANCEPAY = "POSTFINANCEPAY"; public const PAYMENT_METHOD_SAFERPAYTEST = "SAFERPAYTEST"; public const PAYMENT_METHOD_VISA = "VISA"; + public const PAYMENT_METHOD_WECHATPAY = "WECHATPAY"; public const TYPE_CARD = 'CARD'; public const TYPE_BANK_ACCOUNT = 'BANK_ACCOUNT'; diff --git a/lib/SaferpayJson/Request/Transaction/InitializeRequest.php b/lib/SaferpayJson/Request/Transaction/InitializeRequest.php index b6d7f25..60cf044 100644 --- a/lib/SaferpayJson/Request/Transaction/InitializeRequest.php +++ b/lib/SaferpayJson/Request/Transaction/InitializeRequest.php @@ -37,6 +37,7 @@ final class InitializeRequest extends Request public const PAYMENT_METHOD_MASTERCARD = "MASTERCARD"; public const PAYMENT_METHOD_MYONE = "MYONE"; public const PAYMENT_METHOD_VISA = "VISA"; + public const PAYMENT_METHOD_WECHATPAY = "WECHATPAY"; public const WALLET_MASTERPASS = "MASTERPASS"; diff --git a/lib/SaferpayJson/Response/Container/Brand.php b/lib/SaferpayJson/Response/Container/Brand.php index 4fb4ab1..d86dcd3 100644 --- a/lib/SaferpayJson/Response/Container/Brand.php +++ b/lib/SaferpayJson/Response/Container/Brand.php @@ -34,6 +34,7 @@ final class Brand public const PAYMENT_METHOD_UNIONPAY = 'UNIONPAY'; public const PAYMENT_METHOD_VISA = 'VISA'; public const PAYMENT_METHOD_VPAY = 'VPAY'; + public const PAYMENT_METHOD_WECHATPAY = 'WECHATPAY'; /** * @var string|null From 4b2e80f2682a920cec725e68ff75d32842db23c3 Mon Sep 17 00:00:00 2001 From: Manuel Reinhard Date: Thu, 11 Jul 2024 14:25:52 +0200 Subject: [PATCH 13/13] Use native types where possible --- lib/SaferpayJson/Request/Container/A2a.php | 3 +-- lib/SaferpayJson/Request/Container/Address.php | 1 - lib/SaferpayJson/Request/Container/Amount.php | 2 -- lib/SaferpayJson/Request/Container/Card.php | 3 --- lib/SaferpayJson/Request/Container/ChosenPlan.php | 6 ------ lib/SaferpayJson/Request/Container/IssuerReference.php | 3 --- lib/SaferpayJson/Request/Container/Klarna.php | 2 -- .../Request/Container/MastercardIssuerInstallments.php | 2 -- lib/SaferpayJson/Request/Container/Notification.php | 4 ++-- lib/SaferpayJson/Request/Container/Order.php | 2 +- lib/SaferpayJson/Request/Container/Payer.php | 3 --- lib/SaferpayJson/Request/Container/PaymentMeans.php | 10 ---------- .../Request/Container/PaymentMethodsOptions.php | 4 ---- .../Request/Container/PendingNotification.php | 2 +- lib/SaferpayJson/Request/Container/Refund.php | 4 +--- lib/SaferpayJson/Request/Container/RegisterAlias.php | 2 -- lib/SaferpayJson/Request/Container/RequestHeader.php | 4 ++-- lib/SaferpayJson/Request/Container/ReturnUrl.php | 3 +-- lib/SaferpayJson/Request/Container/RiskFactors.php | 5 +---- lib/SaferpayJson/Request/Container/SchemeToken.php | 8 +------- lib/SaferpayJson/Request/Container/UpdateAlias.php | 2 -- .../Request/PaymentPage/InitializeRequest.php | 3 +-- .../SecureCardData/AliasInsertDirectRequest.php | 4 ---- .../Request/SecureCardData/AliasInsertRequest.php | 9 ++------- .../Request/Transaction/AuthorizeReferencedRequest.php | 3 +-- .../Request/Transaction/InitializeRequest.php | 8 +++----- lib/SaferpayJson/Request/Transaction/RefundRequest.php | 3 +-- .../Container/MastercardIssuerInstallments.php | 4 ++-- lib/SaferpayJson/Response/Container/PaymentMeans.php | 1 - 29 files changed, 21 insertions(+), 89 deletions(-) diff --git a/lib/SaferpayJson/Request/Container/A2a.php b/lib/SaferpayJson/Request/Container/A2a.php index f40b034..e84dcbe 100644 --- a/lib/SaferpayJson/Request/Container/A2a.php +++ b/lib/SaferpayJson/Request/Container/A2a.php @@ -9,10 +9,9 @@ final class A2a { /** - * @var string * @SerializedName("AccountHolderName") */ - private $accountHolderName; + private string $accountHolderName; public function __construct(string $accountHolderName) { diff --git a/lib/SaferpayJson/Request/Container/Address.php b/lib/SaferpayJson/Request/Container/Address.php index ae72f0d..c66f359 100644 --- a/lib/SaferpayJson/Request/Container/Address.php +++ b/lib/SaferpayJson/Request/Container/Address.php @@ -64,7 +64,6 @@ final class Address private ?\DateTime $dateOfBirth = null; /** - * @var string|null * @SerializedName("Street2") */ private ?string $street2 = null; diff --git a/lib/SaferpayJson/Request/Container/Amount.php b/lib/SaferpayJson/Request/Container/Amount.php index 359bb75..b65da72 100644 --- a/lib/SaferpayJson/Request/Container/Amount.php +++ b/lib/SaferpayJson/Request/Container/Amount.php @@ -5,13 +5,11 @@ namespace Ticketpark\SaferpayJson\Request\Container; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; final class Amount { /** * @SerializedName("Value") - * @Type("integer") */ private int $value; diff --git a/lib/SaferpayJson/Request/Container/Card.php b/lib/SaferpayJson/Request/Container/Card.php index e542324..3681259 100644 --- a/lib/SaferpayJson/Request/Container/Card.php +++ b/lib/SaferpayJson/Request/Container/Card.php @@ -5,7 +5,6 @@ namespace Ticketpark\SaferpayJson\Request\Container; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; final class Card { @@ -16,13 +15,11 @@ final class Card /** * @SerializedName("ExpYear") - * @Type("integer") */ private ?int $expYear = null; /** * @SerializedName("ExpMonth") - * @Type("integer") */ private ?int $expMonth = null; diff --git a/lib/SaferpayJson/Request/Container/ChosenPlan.php b/lib/SaferpayJson/Request/Container/ChosenPlan.php index 330ff33..670b95b 100644 --- a/lib/SaferpayJson/Request/Container/ChosenPlan.php +++ b/lib/SaferpayJson/Request/Container/ChosenPlan.php @@ -5,13 +5,11 @@ namespace Ticketpark\SaferpayJson\Request\Container; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; final class ChosenPlan { /** * @SerializedName("NumberOfInstallments") - * @Type("int") */ private int $numberOfInstallments; @@ -22,7 +20,6 @@ final class ChosenPlan /** * @SerializedName("InstallmentFee") - * @Type("Ticketpark\SaferpayJson\Request\Container\Amount") */ private ?Amount $installmentFee = null; @@ -33,19 +30,16 @@ final class ChosenPlan /** * @SerializedName("FirstInstallmentAmount") - * @Type("Ticketpark\SaferpayJson\Request\Container\Amount") */ private ?Amount $firstInstallmentAmount = null; /** * @SerializedName("SubsequentInstallmentAmount") - * @Type("Ticketpark\SaferpayJson\Request\Container\Amount") */ private ?Amount $subsequentInstallmentAmount = null; /** * @SerializedName("TotalAmountDue") - * @Type("Ticketpark\SaferpayJson\Request\Container\Amount") */ private ?Amount $totalAmountDue = null; diff --git a/lib/SaferpayJson/Request/Container/IssuerReference.php b/lib/SaferpayJson/Request/Container/IssuerReference.php index bd29fc5..3273caa 100644 --- a/lib/SaferpayJson/Request/Container/IssuerReference.php +++ b/lib/SaferpayJson/Request/Container/IssuerReference.php @@ -5,19 +5,16 @@ namespace Ticketpark\SaferpayJson\Request\Container; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; final class IssuerReference { /** * @SerializedName("TransactionStamp") - * @Type("string") */ private string $transactionStamp; /** * @SerializedName("SettlementDate") - * @Type("string") */ private ?string $settlementDate = null; diff --git a/lib/SaferpayJson/Request/Container/Klarna.php b/lib/SaferpayJson/Request/Container/Klarna.php index e4bf627..01e0d2b 100644 --- a/lib/SaferpayJson/Request/Container/Klarna.php +++ b/lib/SaferpayJson/Request/Container/Klarna.php @@ -5,13 +5,11 @@ namespace Ticketpark\SaferpayJson\Request\Container; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; final class Klarna { /** * @SerializedName("Attachment") - * @Type("Ticketpark\SaferpayJson\Request\Container\Attachment") */ private Attachment $attachment; diff --git a/lib/SaferpayJson/Request/Container/MastercardIssuerInstallments.php b/lib/SaferpayJson/Request/Container/MastercardIssuerInstallments.php index c3629a9..d9533b9 100644 --- a/lib/SaferpayJson/Request/Container/MastercardIssuerInstallments.php +++ b/lib/SaferpayJson/Request/Container/MastercardIssuerInstallments.php @@ -5,13 +5,11 @@ namespace Ticketpark\SaferpayJson\Request\Container; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; final class MastercardIssuerInstallments { /** * @SerializedName("ChosenPlan") - * @Type("Ticketpark\SaferpayJson\Request\Container\ChosenPlan") */ private ?ChosenPlan $chosenPlan = null; diff --git a/lib/SaferpayJson/Request/Container/Notification.php b/lib/SaferpayJson/Request/Container/Notification.php index c788fd5..140f17f 100644 --- a/lib/SaferpayJson/Request/Container/Notification.php +++ b/lib/SaferpayJson/Request/Container/Notification.php @@ -9,7 +9,7 @@ final class Notification { /** - * @var array|null + * @var array * @SerializedName("MerchantEmails") */ private ?array $merchantEmails = []; @@ -23,7 +23,7 @@ final class Notification * @var string|null * @SerializedName("PayerDccReceiptEmail") */ - private $payerDccReceiptEmail; + private ?string $payerDccReceiptEmail = null; /** * @var string|null diff --git a/lib/SaferpayJson/Request/Container/Order.php b/lib/SaferpayJson/Request/Container/Order.php index c386938..326db6b 100644 --- a/lib/SaferpayJson/Request/Container/Order.php +++ b/lib/SaferpayJson/Request/Container/Order.php @@ -9,7 +9,7 @@ final class Order { /** - * @var array|null + * @var array * @SerializedName("Items") */ private ?array $items = []; diff --git a/lib/SaferpayJson/Request/Container/Payer.php b/lib/SaferpayJson/Request/Container/Payer.php index 1502412..df77e84 100644 --- a/lib/SaferpayJson/Request/Container/Payer.php +++ b/lib/SaferpayJson/Request/Container/Payer.php @@ -5,7 +5,6 @@ namespace Ticketpark\SaferpayJson\Request\Container; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; final class Payer { @@ -25,13 +24,11 @@ final class Payer /** * @SerializedName("DeliveryAddress") - * @Type("Ticketpark\SaferpayJson\Request\Container\Address") */ private ?Address $deliveryAddress = null; /** * @SerializedName("BillingAddress") - * @Type("Ticketpark\SaferpayJson\Request\Container\Address") */ private ?Address $billingAddress = null; diff --git a/lib/SaferpayJson/Request/Container/PaymentMeans.php b/lib/SaferpayJson/Request/Container/PaymentMeans.php index 2800711..fa126d5 100644 --- a/lib/SaferpayJson/Request/Container/PaymentMeans.php +++ b/lib/SaferpayJson/Request/Container/PaymentMeans.php @@ -5,13 +5,11 @@ namespace Ticketpark\SaferpayJson\Request\Container; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; final class PaymentMeans { /** * @SerializedName("Brand") - * @Type("Ticketpark\SaferpayJson\Request\Container\Brand") */ private ?Brand $brand = null; @@ -27,49 +25,41 @@ final class PaymentMeans /** * @SerializedName("Card") - * @Type("Ticketpark\SaferpayJson\Request\Container\Card") */ private ?Card $card = null; /** * @SerializedName("BankAccount") - * @Type("Ticketpark\SaferpayJson\Request\Container\BankAccount") */ private ?BankAccount $bankAccount = null; /** * @SerializedName("Twint") - * @Type("Ticketpark\SaferpayJson\Request\Container\Twint") */ private ?Twint $twint = null; /** * @SerializedName("SaferpayFields") - * @Type("Ticketpark\SaferpayJson\Request\Container\SaferpayFields") */ private ?SaferpayFields $saferpayFields = null; /** * @SerializedName("Alias") - * @Type("Ticketpark\SaferpayJson\Request\Container\Alias") */ private ?Alias $alias = null; /** * @SerializedName("SchemeToken") - * @Type("Ticketpark\SaferpayJson\Request\Container\SchemeToken") */ private ?SchemeToken $schemeToken = null; /** * @SerializedName("ApplePay") - * @Type("Ticketpark\SaferpayJson\Request\Container\ApplePay") */ private ?ApplePay $applePay = null; /** * @SerializedName("GooglePay") - * @Type("Ticketpark\SaferpayJson\Request\Container\GooglePay") */ private ?GooglePay $googlePay = null; diff --git a/lib/SaferpayJson/Request/Container/PaymentMethodsOptions.php b/lib/SaferpayJson/Request/Container/PaymentMethodsOptions.php index 8e5b744..a782cd5 100644 --- a/lib/SaferpayJson/Request/Container/PaymentMethodsOptions.php +++ b/lib/SaferpayJson/Request/Container/PaymentMethodsOptions.php @@ -5,20 +5,16 @@ namespace Ticketpark\SaferpayJson\Request\Container; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; final class PaymentMethodsOptions { /** - * @var Ideal|null * @SerializedName("Ideal") - * @Type("Ticketpark\SaferpayJson\Request\Container\Ideal") */ private ?Ideal $ideal = null; /** * @SerializedName("Klarna") - * @Type("Ticketpark\SaferpayJson\Request\Container\Klarna") */ private ?Klarna $klarna = null; diff --git a/lib/SaferpayJson/Request/Container/PendingNotification.php b/lib/SaferpayJson/Request/Container/PendingNotification.php index 254048b..b9f8d72 100644 --- a/lib/SaferpayJson/Request/Container/PendingNotification.php +++ b/lib/SaferpayJson/Request/Container/PendingNotification.php @@ -9,7 +9,7 @@ final class PendingNotification { /** - * @var array|null + * @var array * @SerializedName("MerchantEmails") */ private ?array $merchantEmails = []; diff --git a/lib/SaferpayJson/Request/Container/Refund.php b/lib/SaferpayJson/Request/Container/Refund.php index 08df477..7bc41ea 100644 --- a/lib/SaferpayJson/Request/Container/Refund.php +++ b/lib/SaferpayJson/Request/Container/Refund.php @@ -5,15 +5,13 @@ namespace Ticketpark\SaferpayJson\Request\Container; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; final class Refund { /** * @SerializedName("Amount") - * @Type("Ticketpark\SaferpayJson\Request\Container\Amount") */ - private ?Amount $amount = null; + private ?Amount $amount; /** * @SerializedName("OrderId") diff --git a/lib/SaferpayJson/Request/Container/RegisterAlias.php b/lib/SaferpayJson/Request/Container/RegisterAlias.php index 76e29f4..ef3fb4b 100644 --- a/lib/SaferpayJson/Request/Container/RegisterAlias.php +++ b/lib/SaferpayJson/Request/Container/RegisterAlias.php @@ -5,7 +5,6 @@ namespace Ticketpark\SaferpayJson\Request\Container; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; final class RegisterAlias { @@ -25,7 +24,6 @@ final class RegisterAlias /** * @SerializedName("Lifetime") - * @Type("integer") */ private ?int $lifetime = null; diff --git a/lib/SaferpayJson/Request/Container/RequestHeader.php b/lib/SaferpayJson/Request/Container/RequestHeader.php index 52910fb..5dd948c 100644 --- a/lib/SaferpayJson/Request/Container/RequestHeader.php +++ b/lib/SaferpayJson/Request/Container/RequestHeader.php @@ -21,12 +21,12 @@ final class RequestHeader /** * @SerializedName("RequestId") */ - private ?string $requestId = null; + private ?string $requestId; /** * @SerializedName("RetryIndicator") */ - private int $retryIndicator = 0; + private int $retryIndicator; /** * @SerializedName("ClientInfo") diff --git a/lib/SaferpayJson/Request/Container/ReturnUrl.php b/lib/SaferpayJson/Request/Container/ReturnUrl.php index 67e2f51..38ec4e6 100644 --- a/lib/SaferpayJson/Request/Container/ReturnUrl.php +++ b/lib/SaferpayJson/Request/Container/ReturnUrl.php @@ -9,10 +9,9 @@ final class ReturnUrl { /** - * @var string * @SerializedName("Url") */ - private $url; + private string $url; public function __construct(string $url) { diff --git a/lib/SaferpayJson/Request/Container/RiskFactors.php b/lib/SaferpayJson/Request/Container/RiskFactors.php index a21684d..942ab40 100644 --- a/lib/SaferpayJson/Request/Container/RiskFactors.php +++ b/lib/SaferpayJson/Request/Container/RiskFactors.php @@ -5,7 +5,6 @@ namespace Ticketpark\SaferpayJson\Request\Container; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; final class RiskFactors { @@ -22,7 +21,6 @@ final class RiskFactors /** * @SerializedName("PayerProfile") - * @Type("Ticketpark\SaferpayJson\Request\Container\PayerProfile") */ private ?PayerProfile $payerProfile = null; @@ -32,10 +30,9 @@ final class RiskFactors private ?bool $isB2B = null; /** - * @var string|null * @SerializedName("DeviceFingerprintTransactionId") */ - private $deviceFingerprintTransactionId; + private ?string $deviceFingerprintTransactionId = null; public function getDeliveryType(): ?string { diff --git a/lib/SaferpayJson/Request/Container/SchemeToken.php b/lib/SaferpayJson/Request/Container/SchemeToken.php index 193eb52..71819f8 100644 --- a/lib/SaferpayJson/Request/Container/SchemeToken.php +++ b/lib/SaferpayJson/Request/Container/SchemeToken.php @@ -5,7 +5,6 @@ namespace Ticketpark\SaferpayJson\Request\Container; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; final class SchemeToken { @@ -19,25 +18,21 @@ final class SchemeToken /** * @SerializedName("Number") - * @Type("string") */ private string $number; /** * @SerializedName("ExpMonth") - * @Type("integer") */ private int $expMonth; /** * @SerializedName("ExpYear") - * @Type("integer") */ private int $expYear; /** * @SerializedName("AuthValue") - * @Type("string") */ private string $authValue; @@ -47,10 +42,9 @@ final class SchemeToken private ?string $eci = null; /** - * @var string * @SerializedName("TokenType") */ - private $tokenType; + private string $tokenType; public function __construct(string $number, int $expMonth, int $expYear, string $authValue, string $tokenType) { diff --git a/lib/SaferpayJson/Request/Container/UpdateAlias.php b/lib/SaferpayJson/Request/Container/UpdateAlias.php index c2e7c4d..24235fb 100644 --- a/lib/SaferpayJson/Request/Container/UpdateAlias.php +++ b/lib/SaferpayJson/Request/Container/UpdateAlias.php @@ -5,7 +5,6 @@ namespace Ticketpark\SaferpayJson\Request\Container; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; final class UpdateAlias { @@ -16,7 +15,6 @@ final class UpdateAlias /** * @SerializedName("Lifetime") - * @Type("integer") */ private ?int $lifetime = null; diff --git a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php index b234200..b6d736a 100644 --- a/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php +++ b/lib/SaferpayJson/Request/PaymentPage/InitializeRequest.php @@ -74,10 +74,9 @@ final class InitializeRequest extends Request private Payment $payment; /** - * @var ReturnUrl * @SerializedName("ReturnUrl") */ - private ReturnUrls $returnUrls; + private ReturnUrl $returnUrl; /** * @SerializedName("ConfigSet") diff --git a/lib/SaferpayJson/Request/SecureCardData/AliasInsertDirectRequest.php b/lib/SaferpayJson/Request/SecureCardData/AliasInsertDirectRequest.php index cd4a7f4..43159ec 100755 --- a/lib/SaferpayJson/Request/SecureCardData/AliasInsertDirectRequest.php +++ b/lib/SaferpayJson/Request/SecureCardData/AliasInsertDirectRequest.php @@ -5,7 +5,6 @@ namespace Ticketpark\SaferpayJson\Request\SecureCardData; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; use Ticketpark\SaferpayJson\Request\Container\Check; use Ticketpark\SaferpayJson\Request\Container\IssuerReference; use Ticketpark\SaferpayJson\Request\Container\PaymentMeans; @@ -28,19 +27,16 @@ final class AliasInsertDirectRequest extends Request /** * @SerializedName("PaymentMeans") - * @Type("Ticketpark\SaferpayJson\Request\Container\PaymentMeans") */ private PaymentMeans $paymentMeans; /** * @SerializedName("Check") - * @Type("Ticketpark\SaferpayJson\Request\Container\Check") */ private ?Check $check = null; /** * @SerializedName("IssuerReference") - * @Type("Ticketpark\SaferpayJson\Request\Container\IssuerReference") */ private ?IssuerReference $issuerReference = null; diff --git a/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php b/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php index 73eae8d..883951b 100755 --- a/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php +++ b/lib/SaferpayJson/Request/SecureCardData/AliasInsertRequest.php @@ -5,7 +5,6 @@ namespace Ticketpark\SaferpayJson\Request\SecureCardData; use JMS\Serializer\Annotation\SerializedName; -use JMS\Serializer\Annotation\Type; use Ticketpark\SaferpayJson\Request\Container\CardForm; use Ticketpark\SaferpayJson\Request\Container\Check; use Ticketpark\SaferpayJson\Request\Container\PaymentMeans; @@ -50,15 +49,13 @@ final class AliasInsertRequest extends Request /** * @SerializedName("Type") - * @Type("string") */ private string $type; /** - * @var ReturnUrl * @SerializedName("ReturnUrl") */ - private $returnUrl; + private ReturnUrl $returnUrl; /** * @SerializedName("Styling") @@ -67,7 +64,6 @@ final class AliasInsertRequest extends Request /** * @SerializedName("LanguageCode") - * @Type("string") */ private ?string $languageCode = null; @@ -93,10 +89,9 @@ final class AliasInsertRequest extends Request private ?PaymentMeans $paymentMeans = null; /** - * @var Notification|null * @SerializedName("Notification") */ - private $notification; + private ?Notification $notification = null; public function __construct( RequestConfig $requestConfig, diff --git a/lib/SaferpayJson/Request/Transaction/AuthorizeReferencedRequest.php b/lib/SaferpayJson/Request/Transaction/AuthorizeReferencedRequest.php index 6615424..185d0f0 100644 --- a/lib/SaferpayJson/Request/Transaction/AuthorizeReferencedRequest.php +++ b/lib/SaferpayJson/Request/Transaction/AuthorizeReferencedRequest.php @@ -46,10 +46,9 @@ final class AuthorizeReferencedRequest extends Request private ?bool $suppressDcc = null; /** - * @var Notification|null * @SerializedName("Notification") */ - private $notification; + private ?Notification $notification = null; public function __construct( RequestConfig $requestConfig, diff --git a/lib/SaferpayJson/Request/Transaction/InitializeRequest.php b/lib/SaferpayJson/Request/Transaction/InitializeRequest.php index c584085..d8b1ba9 100644 --- a/lib/SaferpayJson/Request/Transaction/InitializeRequest.php +++ b/lib/SaferpayJson/Request/Transaction/InitializeRequest.php @@ -72,10 +72,9 @@ final class InitializeRequest extends Request private ?Payer $payer = null; /** - * @var ReturnUrl * @SerializedName("ReturnUrl") */ - private $returnUrl; + private ?ReturnUrl $returnUrl; /** * @SerializedName("Styling") @@ -109,10 +108,9 @@ final class InitializeRequest extends Request private ?RedirectNotifyUrls $redirectNotifyUrls = null; /** - * @var Notification|null * @SerializedName("Notification") */ - private $notification; + private ?Notification $notification = null; public function __construct( RequestConfig $requestConfig, @@ -234,7 +232,7 @@ public function getPayer(): ?Payer return $this->payer; } - public function getReturnUrl(): ReturnUrl + public function getReturnUrl(): ?ReturnUrl { return $this->returnUrl; } diff --git a/lib/SaferpayJson/Request/Transaction/RefundRequest.php b/lib/SaferpayJson/Request/Transaction/RefundRequest.php index 80fb294..dbee864 100644 --- a/lib/SaferpayJson/Request/Transaction/RefundRequest.php +++ b/lib/SaferpayJson/Request/Transaction/RefundRequest.php @@ -36,10 +36,9 @@ final class RefundRequest extends Request private ?PendingNotification $pendingNotification = null; /** - * @var PaymentMethodsOptions|null * @SerializedName("PaymentMethodsOptions") */ - private $paymentMethodsOptions; + private ?PaymentMethodsOptions $paymentMethodsOptions = null; public function __construct( RequestConfig $requestConfig, diff --git a/lib/SaferpayJson/Response/Container/MastercardIssuerInstallments.php b/lib/SaferpayJson/Response/Container/MastercardIssuerInstallments.php index 852068f..de1265f 100644 --- a/lib/SaferpayJson/Response/Container/MastercardIssuerInstallments.php +++ b/lib/SaferpayJson/Response/Container/MastercardIssuerInstallments.php @@ -10,11 +10,11 @@ final class MastercardIssuerInstallments { /** - * @var array|null + * @var array * @SerializedName("InstallmentPlans") * @Type("array") */ - private ?array $installmentPlans = null; + private array $installmentPlans = []; /** * @SerializedName("CustomPlan") diff --git a/lib/SaferpayJson/Response/Container/PaymentMeans.php b/lib/SaferpayJson/Response/Container/PaymentMeans.php index 2e908c0..80985a4 100644 --- a/lib/SaferpayJson/Response/Container/PaymentMeans.php +++ b/lib/SaferpayJson/Response/Container/PaymentMeans.php @@ -34,7 +34,6 @@ final class PaymentMeans private ?BankAccount $bankAccount = null; /** - * @var PayPal|null * @SerializedName("PayPal") */ private ?PayPal $payPal = null;