Skip to content

Commit

Permalink
Merge pull request #57 from Ticketpark/codesource-1.19
Browse files Browse the repository at this point in the history
Implement changes of Saferpay API 1.19
  • Loading branch information
sprain committed May 4, 2022
2 parents 482c70c + c05864e commit 9c444ab
Show file tree
Hide file tree
Showing 7 changed files with 376 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Have a look at the [example folder](/example) for more.
Find the most current documentation of the Saferpay JSON API here:<br>
https://saferpay.github.io/jsonapi/

This library is currently based on v1.18 of the Saferpay JSON API.
This library is currently based on v1.19 of the Saferpay JSON API.

## Contribution
You are [welcome to contribute](/.github/contributing.md) to this repo.
269 changes: 269 additions & 0 deletions lib/SaferpayJson/Request/Container/PayerProfile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
<?php declare(strict_types=1);

namespace Ticketpark\SaferpayJson\Request\Container;

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

final class PayerProfile
{
const GENDER_MALE = "MALE";
const GENDER_FEMALE = "FEMALE";
const GENDER_DIVERSE = "DIVERSE";
const GENDER_COMPANY = "COMPANY";

/**
* @var bool|null
* @SerializedName("HasAccount")
*/
private $hasAccount;

/**
* @var bool|null
* @SerializedName("HasPassword")
*/
private $hasPassword;

/**
* @var bool|null
* @SerializedName("PasswordForgotten")
*/
private $passwordForgotten;

/**
* @var string|null
* @SerializedName("FirstName")
*/
private $firstName;

/**
* @var string|null
* @SerializedName("LastName")
*/
private $lastName;

/**
* @var string|null
* @SerializedName("Company")
*/
private $company;

/**
* @var string|null
* @SerializedName("DateOfBirth")
*/
private $dateOfBirth;

/**
* @var \DateTime|null
* @SerializedName("LastLoginDate")
* @Type("DateTime<'Y-m-d\TH:i:s.uT'>")
*/
private $lastLoginDate;

/**
* @var string|null
* @SerializedName("Gender")
*/
private $gender;

/**
* @var \DateTime|null
* @SerializedName("CreationDate")
* @Type("DateTime<'Y-m-d\TH:i:s.uT'>")
*/
private $creationDate;

/**
* @var \DateTime|null
* @SerializedName("PasswordLastChangeDate")
* @Type("DateTime<'Y-m-d\TH:i:s.uT'>")
*/
private $passwordLastChangeDate;

/**
* @var string|null
* @SerializedName("Email")
*/
private $email;

/**
* @var string|null
* @SerializedName("SecondaryEmail")
*/
private $secondaryEmail;

/**
* @var Phone|null
* @SerializedName("Phone")
*/
private $phone;

public function getHasAccount(): ?bool
{
return $this->hasAccount;
}

public function setHasAccount(?bool $hasAccount): self
{
$this->hasAccount = $hasAccount;

return $this;
}

public function getHasPassword(): ?bool
{
return $this->hasPassword;
}

public function setHasPassword(?bool $hasPassword): self
{
$this->hasPassword = $hasPassword;

return $this;
}

public function getPasswordForgotten(): ?bool
{
return $this->passwordForgotten;
}

public function setPasswordForgotten(?bool $passwordForgotten): self
{
$this->passwordForgotten = $passwordForgotten;

return $this;
}

public function getFirstName(): ?string
{
return $this->firstName;
}

public function setFirstName(?string $firstName): self
{
$this->firstName = $firstName;

return $this;
}

public function getLastName(): ?string
{
return $this->lastName;
}

public function setLastName(?string $lastName): self
{
$this->lastName = $lastName;

return $this;
}

public function getCompany(): ?string
{
return $this->company;
}

public function setCompany(?string $company): self
{
$this->company = $company;

return $this;
}

public function getDateOfBirth(): ?string
{
return $this->dateOfBirth;
}

public function setDateOfBirth(?string $dateOfBirth): self
{
$this->dateOfBirth = $dateOfBirth;

return $this;
}

public function getLastLoginDate(): ?\DateTime
{
return $this->lastLoginDate;
}

public function setLastLoginDate(?\DateTime $lastLoginDate): self
{
$this->lastLoginDate = $lastLoginDate;

return $this;
}

public function getGender(): ?string
{
return $this->gender;
}

public function setGender(?string $gender): self
{
$this->gender = $gender;

return $this;
}

public function getCreationDate(): ?\DateTime
{
return $this->creationDate;
}

public function setCreationDate(?\DateTime $creationDate): self
{
$this->creationDate = $creationDate;

return $this;
}

public function getPasswordLastChangeDate(): ?\DateTime
{
return $this->passwordLastChangeDate;
}

public function setPasswordLastChangeDate(?\DateTime $passwordLastChangeDate): self
{
$this->passwordLastChangeDate = $passwordLastChangeDate;

return $this;
}

public function getEmail(): ?string
{
return $this->email;
}

public function setEmail(?string $email): self
{
$this->email = $email;

return $this;
}

public function getSecondaryEmail(): ?string
{
return $this->secondaryEmail;
}

public function setSecondaryEmail(?string $secondaryEmail): self
{
$this->secondaryEmail = $secondaryEmail;

return $this;
}

public function getPhone(): ?Phone
{
return $this->phone;
}

public function setPhone(?Phone $phone): self
{
$this->phone = $phone;

return $this;
}
}
62 changes: 62 additions & 0 deletions lib/SaferpayJson/Request/Container/Phone.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php declare(strict_types=1);

namespace Ticketpark\SaferpayJson\Request\Container;

use JMS\Serializer\Annotation\SerializedName;

final class Phone
{
/**
* @var string|null
* @SerializedName("Main")
*/
private $main;

/**
* @var string|null
* @SerializedName("Mobile")
*/
private $mobile;

/**
* @var string|null
* @SerializedName("Work")
*/
private $work;

public function getMain(): ?string
{
return $this->main;
}

public function setMain(?string $main): self
{
$this->main = $main;

return $this;
}

public function getMobile(): ?string
{
return $this->mobile;
}

public function setMobile(?string $mobile): self
{
$this->mobile = $mobile;

return $this;
}

public function getWork(): ?string
{
return $this->work;
}

public function setWork(?string $work): self
{
$this->work = $work;

return $this;
}
}
2 changes: 1 addition & 1 deletion lib/SaferpayJson/Request/Container/RequestHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class RequestHeader
* @var string
* @SerializedName("SpecVersion")
*/
private $specVersion = '1.18';
private $specVersion = '1.19';

/**
* @var string
Expand Down
Loading

0 comments on commit 9c444ab

Please sign in to comment.