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

Add/payment response fields #53

Merged
merged 10 commits into from
Nov 15, 2022
10 changes: 8 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ function ($decoded) {
return (new PaymentResponse())
->setTransactionId($decoded->transactionId ?? null)
->setHref($decoded->href ?? null)
->setProviders($decoded->providers ?? null);
->setTerms($decoded->terms ?? null)
->setGroups($decoded->groups ?? [])
->setReference($decoded->reference ?? null)
->setProviders($decoded->providers ?? []);
}
);

Expand Down Expand Up @@ -252,7 +255,10 @@ function ($decoded) {
return (new PaymentResponse())
->setTransactionId($decoded->transactionId ?? null)
->setHref($decoded->href ?? null)
->setProviders($decoded->providers ?? null);
->setTerms($decoded->terms ?? null)
->setGroups($decoded->groups ?? [])
->setReference($decoded->reference ?? null)
->setProviders($decoded->providers ?? []);
}
);

Expand Down
140 changes: 140 additions & 0 deletions src/Model/PaymentMethodGroup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<?php

declare(strict_types=1);

namespace Paytrail\SDK\Model;

use Paytrail\SDK\Util\PropertyBinder;
use Paytrail\SDK\Util\JsonSerializable;

/**
* Class PaymentMethodGroup
*
* @see https://docs.paytrail.com/#/?id=paymentmethodgroup
* @package Paytrail\SDK\Model
*/
class PaymentMethodGroup implements \JsonSerializable
{
use JsonSerializable;
use PropertyBinder;

/**
* Payment method group id.
*
* @var string|null
*/
protected $id;

/**
* Payment method group name.
*
* @var string|null
*/
protected $name;

/**
* Payment method group icon url.
*
* @var string|null
*/
protected $icon;

/**
* Payment method group svg url.
*
* @var string|null
*/
protected $svg;

/**
* Get payment method group id.
*
* @return string
*/
public function getId(): ?string
{
return $this->id;
}

/**
* Set payment method group id.
*
* @param string|null $id
* @return self
*/
public function setId(?string $id): self
{
$this->id = $id;

return $this;
}

/**
* Get payment method group name.
*
* @return string|null
*/
public function getName(): ?string
{
return $this->name;
}

/**
* Set payment method group name.
*
* @param string|null $name
* @return self
*/
public function setName(?string $name): self
{
$this->name = $name;

return $this;
}

/**
* Get payment method group svg url.
*
* @return string|null
*/
public function getSvg(): ?string
{
return $this->svg;
}

/**
* Set payment method group svg url.
*
* @param string|null $svg
* @return self
*/
public function setSvg(?string $svg): self
{
$this->svg = $svg;

return $this;
}

/**
* Get payment method group icon url.
*
* @return string|null
*/
public function getIcon(): ?string
{
return $this->icon;
}

/**
* Set payment method group icon url.
*
* @param string|null $icon
* @return self
*/
public function setIcon(?string $icon): self
{
$this->icon = $icon;

return $this;
}
}
7 changes: 3 additions & 4 deletions src/Response/CitPaymentResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ class CitPaymentResponse implements ResponseInterface
/**
* Set the transaction id.
*
* @param string $transactionId
* @param string|null $transactionId
*
* @return CitPaymentResponse Return self to enable chaining.
*/
public function setTransactionId(string $transactionId): CitPaymentResponse
public function setTransactionId(?string $transactionId): CitPaymentResponse
{
$this->transactionId = $transactionId;

return $this;
}

Expand All @@ -53,7 +52,7 @@ public function getTransactionId(): ?string
}

/**
* @param string $threeDSecureUrl
* @param string|null $threeDSecureUrl
* @return CitPaymentResponse
*/
public function setThreeDSecureUrl(?string $threeDSecureUrl): CitPaymentResponse
Expand Down
5 changes: 2 additions & 3 deletions src/Response/MitPaymentResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ class MitPaymentResponse implements ResponseInterface
/**
* Set the transaction id.
*
* @param string $transactionId
* @param string|null $transactionId
*
* @return MitPaymentResponse Return self to enable chaining.
*/
public function setTransactionId(string $transactionId): MitPaymentResponse
public function setTransactionId(?string $transactionId): MitPaymentResponse
{
$this->transactionId = $transactionId;

return $this;
}

Expand Down
Loading