-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ddc7a6
commit 508161e
Showing
8 changed files
with
177 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rebilly/client-php": patch | ||
--- | ||
|
||
feat(be): Add Limepay integration Rebilly/rebilly#9321 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
/** | ||
* This source file is proprietary and part of Rebilly. | ||
* | ||
* (c) Rebilly SRL | ||
* Rebilly Ltd. | ||
* Rebilly Inc. | ||
* | ||
* @see https://www.rebilly.com | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rebilly\Sdk\Model; | ||
|
||
class Limepay extends GatewayAccount | ||
{ | ||
private array $fields = []; | ||
|
||
public function __construct(array $data = []) | ||
{ | ||
parent::__construct([ | ||
'gatewayName' => 'Limepay', | ||
] + $data); | ||
|
||
if (array_key_exists('credentials', $data)) { | ||
$this->setCredentials($data['credentials']); | ||
} | ||
} | ||
|
||
public static function from(array $data = []): self | ||
{ | ||
return new self($data); | ||
} | ||
|
||
public function getCredentials(): LimepayCredentials | ||
{ | ||
return $this->fields['credentials']; | ||
} | ||
|
||
public function setCredentials(LimepayCredentials|array $credentials): static | ||
{ | ||
if (!($credentials instanceof LimepayCredentials)) { | ||
$credentials = LimepayCredentials::from($credentials); | ||
} | ||
|
||
$this->fields['credentials'] = $credentials; | ||
|
||
return $this; | ||
} | ||
|
||
public function jsonSerialize(): array | ||
{ | ||
$data = []; | ||
if (array_key_exists('credentials', $this->fields)) { | ||
$data['credentials'] = $this->fields['credentials']->jsonSerialize(); | ||
} | ||
|
||
return parent::jsonSerialize() + $data; | ||
} | ||
} |
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,92 @@ | ||
<?php | ||
|
||
/** | ||
* This source file is proprietary and part of Rebilly. | ||
* | ||
* (c) Rebilly SRL | ||
* Rebilly Ltd. | ||
* Rebilly Inc. | ||
* | ||
* @see https://www.rebilly.com | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rebilly\Sdk\Model; | ||
|
||
use JsonSerializable; | ||
|
||
class LimepayCredentials implements JsonSerializable | ||
{ | ||
private array $fields = []; | ||
|
||
public function __construct(array $data = []) | ||
{ | ||
if (array_key_exists('xLogin', $data)) { | ||
$this->setXLogin($data['xLogin']); | ||
} | ||
if (array_key_exists('xTransKey', $data)) { | ||
$this->setXTransKey($data['xTransKey']); | ||
} | ||
if (array_key_exists('secretKey', $data)) { | ||
$this->setSecretKey($data['secretKey']); | ||
} | ||
} | ||
|
||
public static function from(array $data = []): self | ||
{ | ||
return new self($data); | ||
} | ||
|
||
public function getXLogin(): string | ||
{ | ||
return $this->fields['xLogin']; | ||
} | ||
|
||
public function setXLogin(string $xLogin): static | ||
{ | ||
$this->fields['xLogin'] = $xLogin; | ||
|
||
return $this; | ||
} | ||
|
||
public function getXTransKey(): string | ||
{ | ||
return $this->fields['xTransKey']; | ||
} | ||
|
||
public function setXTransKey(string $xTransKey): static | ||
{ | ||
$this->fields['xTransKey'] = $xTransKey; | ||
|
||
return $this; | ||
} | ||
|
||
public function getSecretKey(): string | ||
{ | ||
return $this->fields['secretKey']; | ||
} | ||
|
||
public function setSecretKey(string $secretKey): static | ||
{ | ||
$this->fields['secretKey'] = $secretKey; | ||
|
||
return $this; | ||
} | ||
|
||
public function jsonSerialize(): array | ||
{ | ||
$data = []; | ||
if (array_key_exists('xLogin', $this->fields)) { | ||
$data['xLogin'] = $this->fields['xLogin']; | ||
} | ||
if (array_key_exists('xTransKey', $this->fields)) { | ||
$data['xTransKey'] = $this->fields['xTransKey']; | ||
} | ||
if (array_key_exists('secretKey', $this->fields)) { | ||
$data['secretKey'] = $this->fields['secretKey']; | ||
} | ||
|
||
return $data; | ||
} | ||
} |
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