Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

saferpay api update 1.31 => 1.40 #92

Closed
wants to merge 12 commits into from
7 changes: 3 additions & 4 deletions example/PaymentPage/example-initialize.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);

// -----------------------------
Expand All @@ -41,7 +40,7 @@
$requestConfig,
$terminalId,
$payment,
$returnUrls
$returnUrl
);

// Note: More data can be provided to InitializeRequest with setters,
Expand Down
7 changes: 3 additions & 4 deletions example/SecureCardData/example-alias-insert.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);

// -----------------------------
Expand All @@ -37,7 +36,7 @@
$requestConfig,
$registerAlias,
AliasInsertRequest::TYPE_CARD,
$returnUrls
$returnUrl
);

// -----------------------------
Expand Down
7 changes: 3 additions & 4 deletions example/Transaction/example-initialize.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);

// -----------------------------
Expand All @@ -41,7 +40,7 @@
$requestConfig,
$terminalId,
$payment,
$returnUrls
$returnUrl
);

// Note: More data can be provided to InitializeRequest with setters,
Expand Down
26 changes: 26 additions & 0 deletions lib/SaferpayJson/Request/Container/A2a.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;

final class A2a
{
/**
* @var string
* @SerializedName("AccountHolderName")
*/
private $accountHolderName;

public function __construct(string $accountHolderName)
{
$this->accountHolderName = $accountHolderName;
}

public function getAccountHolderName(): string
{
return $this->accountHolderName;
}
}
18 changes: 0 additions & 18 deletions lib/SaferpayJson/Request/Container/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ final class Address
*/
private $dateOfBirth;

/**
* @var string|null
* @SerializedName("LegalForm")
*/
private $legalForm;

/**
* @var string|null
* @SerializedName("Street2")
Expand Down Expand Up @@ -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;
Expand Down
27 changes: 0 additions & 27 deletions lib/SaferpayJson/Request/Container/Alipay.php

This file was deleted.

17 changes: 17 additions & 0 deletions lib/SaferpayJson/Request/Container/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ final class Notification
*/
private $payerEmail;

/**
* @var string|null
* @SerializedName("PayerDccReceiptEmail")
*/
private $payerDccReceiptEmail;

/**
* @var string|null
* @SerializedName("SuccessNotifyUrl")
Expand Down Expand Up @@ -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;
Expand Down
19 changes: 0 additions & 19 deletions lib/SaferpayJson/Request/Container/PaymentMethodsOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/SaferpayJson/Request/Container/RequestHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class RequestHeader
* @var string
* @SerializedName("SpecVersion")
*/
private $specVersion = '1.31';
private $specVersion = '1.40';

/**
* @var string
Expand Down
26 changes: 26 additions & 0 deletions lib/SaferpayJson/Request/Container/ReturnUrl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;

final class ReturnUrl
{
/**
* @var string
* @SerializedName("Url")
*/
private $url;

public function __construct(string $url)
{
$this->url = $url;
}

public function getUrl(): string
{
return $this->url;
}
}
57 changes: 0 additions & 57 deletions lib/SaferpayJson/Request/Container/ReturnUrls.php

This file was deleted.

12 changes: 6 additions & 6 deletions lib/SaferpayJson/Request/Container/RiskFactors.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ final class RiskFactors

/**
* @var string|null
* @SerializedName("DeviceFingerprint")
* @SerializedName("DeviceFingerprintTransactionId")
*/
private $deviceFingerprint;
private $deviceFingerprintTransactionId;

public function getDeliveryType(): ?string
{
Expand Down Expand Up @@ -75,14 +75,14 @@ public function setIsB2B(?bool $isB2B): self
return $this;
}

public function getDeviceFingerprint(): ?string
public function getDeviceFingerprintTransactionId(): ?string
{
return $this->deviceFingerprint;
return $this->deviceFingerprintTransactionId;
}

public function setDeviceFingerprint(?string $deviceFingerprint): self
public function setDeviceFingerprintTransactionId(?string $deviceFingerprintTransactionId): self
{
$this->deviceFingerprint = $deviceFingerprint;
$this->deviceFingerprintTransactionId = $deviceFingerprintTransactionId;
return $this;
}
}
22 changes: 21 additions & 1 deletion lib/SaferpayJson/Request/Container/SchemeToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -43,12 +51,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
Expand Down Expand Up @@ -81,4 +96,9 @@ public function setEci(?string $eci): self
$this->eci = $eci;
return $this;
}

public function getTokenType(): string
{
return $this->tokenType;
}
}
Loading
Loading