Skip to content
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.1.2.0]
### Added
* Payment type ApplePay.

## [1.1.1.1]

### Fix
Expand Down Expand Up @@ -60,3 +64,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
[1.1.0.0]: https://github.com/unzerdev/php-sdk/compare/1260b8314af1ac461e33f0cfb382ffcd0e87c105..1.1.0.0
[1.1.1.0]: https://github.com/unzerdev/php-sdk/compare/1.1.0.0..1.1.1.0
[1.1.1.1]: https://github.com/unzerdev/php-sdk/compare/1.1.1.0..1.1.1.1
[1.1.2.0]: https://github.com/unzerdev/php-sdk/compare/1.1.1.1..1.1.2.0
2 changes: 2 additions & 0 deletions src/Constants/IdStrings.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class IdStrings

// Payment Types
public const ALIPAY = 'ali';
public const APPLEPAY = 'apl';
public const BANCONTACT = 'bct';
public const CARD = 'crd';
public const EPS = 'eps';
Expand Down Expand Up @@ -66,6 +67,7 @@ class IdStrings
public const WEBHOOK = 'whk';
public const PAYMENT_TYPES = [
self::ALIPAY,
self::APPLEPAY,
self::BANCONTACT,
self::CARD,
self::EPS,
Expand Down
110 changes: 110 additions & 0 deletions src/Resources/EmbeddedResources/ApplePayHeader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?php
/**
* Represents the Applepay header resource.
*
* Copyright (C) 2021 - today Unzer E-Com GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://docs.unzer.com/
*
* @author David Owusu <development@unzer.com>
*
* @package UnzerSDK\Resources\EmbeddedResources
*/
namespace UnzerSDK\Resources\EmbeddedResources;

use UnzerSDK\Resources\AbstractUnzerResource;

class ApplePayHeader extends AbstractUnzerResource
{
/** @var string|null */
protected $ephemeralPublicKey;

/** @var string|null */
protected $publicKeyHash;

/** @var string|null */
protected $transactionId;

/**
* ApplePayHeader constructor.
*
* @param string|null $ephemeralPublicKey
* @param string|null $publicKeyHash
* @param string|null $transactionId
*/
public function __construct(?string $ephemeralPublicKey, ?string $publicKeyHash, ?string $transactionId = null)
{
$this->ephemeralPublicKey = $ephemeralPublicKey;
$this->publicKeyHash = $publicKeyHash;
$this->transactionId = $transactionId;
}

/**
* @param string|null $ephemeralPublicKey
*
* @return ApplePayHeader
*/
public function setEphemeralPublicKey(?string $ephemeralPublicKey): ApplePayHeader
{
$this->ephemeralPublicKey = $ephemeralPublicKey;
return $this;
}

/**
* @param string|null $publicKeyHash
*
* @return ApplePayHeader
*/
public function setPublicKeyHash(?string $publicKeyHash): ApplePayHeader
{
$this->publicKeyHash = $publicKeyHash;
return $this;
}

/**
* @param string|null $transactionId
*
* @return ApplePayHeader
*/
public function setTransactionId(?string $transactionId): ApplePayHeader
{
$this->transactionId = $transactionId;
return $this;
}

/**
* @return string|null
*/
public function getEphemeralPublicKey(): ?string
{
return $this->ephemeralPublicKey;
}

/**
* @return string|null
*/
public function getPublicKeyHash(): ?string
{
return $this->publicKeyHash;
}

/**
* @return string|null
*/
public function getTransactionId(): ?string
{
return $this->transactionId;
}
}
Loading