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 – with updates #97

Merged
merged 14 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
25 changes: 25 additions & 0 deletions lib/SaferpayJson/Request/Container/A2a.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;

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

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

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

/**
* @SerializedName("LegalForm")
*/
private ?string $legalForm = null;

/**
* @SerializedName("Street2")
*/
Expand Down Expand Up @@ -208,18 +203,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
25 changes: 0 additions & 25 deletions lib/SaferpayJson/Request/Container/Alipay.php

This file was deleted.

2 changes: 0 additions & 2 deletions lib/SaferpayJson/Request/Container/Amount.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 0 additions & 3 deletions lib/SaferpayJson/Request/Container/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

final class Card
{
Expand All @@ -16,13 +15,11 @@ final class Card

/**
* @SerializedName("ExpYear")
* @Type("integer")
*/
private ?int $expYear = null;

/**
* @SerializedName("ExpMonth")
* @Type("integer")
*/
private ?int $expMonth = null;

Expand Down
6 changes: 0 additions & 6 deletions lib/SaferpayJson/Request/Container/ChosenPlan.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -22,7 +20,6 @@ final class ChosenPlan

/**
* @SerializedName("InstallmentFee")
* @Type("Ticketpark\SaferpayJson\Request\Container\Amount")
*/
private ?Amount $installmentFee = null;

Expand All @@ -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;

Expand Down
3 changes: 0 additions & 3 deletions lib/SaferpayJson/Request/Container/IssuerReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 0 additions & 2 deletions lib/SaferpayJson/Request/Container/Klarna.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
20 changes: 19 additions & 1 deletion lib/SaferpayJson/Request/Container/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
final class Notification
{
/**
* @var array<string>|null
* @var array<string>
* @SerializedName("MerchantEmails")
*/
private ?array $merchantEmails = [];
Expand All @@ -20,6 +20,13 @@ final class Notification
private ?string $payerEmail = null;

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

/**
* @var string|null
* @SerializedName("SuccessNotifyUrl")
*/
private ?string $successNotifyUrl = null;
Expand Down Expand Up @@ -53,6 +60,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
2 changes: 1 addition & 1 deletion lib/SaferpayJson/Request/Container/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
final class Order
{
/**
* @var array<OrderItem>|null
* @var array<OrderItem>
* @SerializedName("Items")
*/
private ?array $items = [];
Expand Down
3 changes: 0 additions & 3 deletions lib/SaferpayJson/Request/Container/Payer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

final class Payer
{
Expand All @@ -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;

Expand Down
Loading
Loading