forked from mollie/PrestaShop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PIPRES-352: Billie payment method additional data send (#18)
- Loading branch information
Showing
7 changed files
with
250 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace Mollie\DTO\Object; | ||
|
||
class Company implements \JsonSerializable | ||
{ | ||
/** @var string */ | ||
private $vatNumber; | ||
/** @var string */ | ||
private $registrationNumber; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getVatNumber(): string | ||
{ | ||
return $this->vatNumber; | ||
} | ||
|
||
/** | ||
* @param string $vatNumber | ||
* | ||
* @maps vatNumber | ||
*/ | ||
public function setVatNumber(string $vatNumber) | ||
{ | ||
$this->vatNumber = $vatNumber; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getRegistrationNumber(): string | ||
{ | ||
return $this->registrationNumber; | ||
} | ||
|
||
/** | ||
* @param string $registrationNumber | ||
* | ||
* @maps registrationNumber | ||
*/ | ||
public function setRegistrationNumber(string $registrationNumber) | ||
{ | ||
$this->registrationNumber = $registrationNumber; | ||
} | ||
|
||
public function jsonSerialize() | ||
{ | ||
$json = []; | ||
$json['vatNumber'] = $this->getVatNumber(); | ||
$json['registrationNumber'] = $this->getRegistrationNumber(); | ||
|
||
return array_filter($json, static function ($val) { | ||
return $val !== null && $val !== ''; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
<?php | ||
|
||
namespace Mollie\DTO\Object; | ||
|
||
class Payment implements \JsonSerializable | ||
{ | ||
/** @var ?string */ | ||
private $cardToken; | ||
/** @var string */ | ||
private $webhookUrl; | ||
/** @var ?string */ | ||
private $issuer; | ||
/** @var ?string */ | ||
private $customerId; | ||
/** @var ?string */ | ||
private $applePayPaymentToken; | ||
/** @var ?Company */ | ||
private $company; | ||
|
||
/** | ||
* @return ?string | ||
*/ | ||
public function getCardToken() | ||
{ | ||
return $this->cardToken; | ||
} | ||
|
||
/** | ||
* @param string $cardToken | ||
* | ||
* @maps cardToken | ||
*/ | ||
public function setCardToken(string $cardToken) | ||
{ | ||
$this->cardToken = $cardToken; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getWebhookUrl(): string | ||
{ | ||
return $this->webhookUrl; | ||
} | ||
|
||
/** | ||
* @param string $webhookUrl | ||
* | ||
* @maps webhookUrl | ||
*/ | ||
public function setWebhookUrl(string $webhookUrl) | ||
{ | ||
$this->webhookUrl = $webhookUrl; | ||
} | ||
|
||
/** | ||
* @return ?string | ||
*/ | ||
public function getIssuer() | ||
{ | ||
return $this->issuer; | ||
} | ||
|
||
/** | ||
* @param string $issuer | ||
* | ||
* @maps issuer | ||
*/ | ||
public function setIssuer(string $issuer) | ||
{ | ||
$this->issuer = $issuer; | ||
} | ||
|
||
/** | ||
* @return ?string | ||
*/ | ||
public function getCustomerId() | ||
{ | ||
return $this->customerId; | ||
} | ||
|
||
/** | ||
* @param string $customerId | ||
* | ||
* @maps customerId | ||
*/ | ||
public function setCustomerId(string $customerId) | ||
{ | ||
$this->customerId = $customerId; | ||
} | ||
|
||
/** | ||
* @return ?string | ||
*/ | ||
public function getApplePayPaymentToken() | ||
{ | ||
return $this->applePayPaymentToken; | ||
} | ||
|
||
/** | ||
* @param string $applePayPaymentToken | ||
* | ||
* @maps applePayPaymentToken | ||
*/ | ||
public function setApplePayPaymentToken(string $applePayPaymentToken) | ||
{ | ||
$this->applePayPaymentToken = $applePayPaymentToken; | ||
} | ||
|
||
/** | ||
* @return ?Company | ||
*/ | ||
public function getCompany() | ||
{ | ||
return $this->company; | ||
} | ||
|
||
/** | ||
* @param \Mollie\DTO\Object\Company $company | ||
* | ||
* @maps company | ||
*/ | ||
public function setCompany(Company $company) | ||
{ | ||
$this->company = $company; | ||
} | ||
|
||
public function jsonSerialize() | ||
{ | ||
$result = []; | ||
$result['cardToken'] = $this->getCardToken(); | ||
$result['webhookUrl'] = $this->getWebhookUrl(); | ||
$result['issuer'] = $this->getIssuer(); | ||
$result['customerId'] = $this->getCustomerId(); | ||
$result['applePayPaymentToken'] = $this->getApplePayPaymentToken(); | ||
$result['company'] = $this->getCompany() ? $this->getCompany()->jsonSerialize() : null; | ||
|
||
return array_filter($result, static function ($val) { | ||
return $val !== null && $val !== ''; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters