-
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
028c113
commit e833ecb
Showing
10 changed files
with
220 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 | ||
--- | ||
|
||
chore(ci): renable php sdk update workflow Rebilly/rebilly#5485 |
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 | ||
--- | ||
|
||
SDK Generator updated |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?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 PayU extends GatewayAccount | ||
{ | ||
private array $fields = []; | ||
|
||
public function __construct(array $data = []) | ||
{ | ||
parent::__construct([ | ||
'gatewayName' => 'PayU', | ||
] + $data); | ||
|
||
if (array_key_exists('credentials', $data)) { | ||
$this->setCredentials($data['credentials']); | ||
} | ||
if (array_key_exists('threeDSecureServer', $data)) { | ||
$this->setThreeDSecureServer($data['threeDSecureServer']); | ||
} | ||
} | ||
|
||
public static function from(array $data = []): self | ||
{ | ||
return new self($data); | ||
} | ||
|
||
public function getCredentials(): PayUCredentials | ||
{ | ||
return $this->fields['credentials']; | ||
} | ||
|
||
public function setCredentials(PayUCredentials|array $credentials): static | ||
{ | ||
if (!($credentials instanceof PayUCredentials)) { | ||
$credentials = PayUCredentials::from($credentials); | ||
} | ||
|
||
$this->fields['credentials'] = $credentials; | ||
|
||
return $this; | ||
} | ||
|
||
public function getThreeDSecureServer(): ?ThreeDSecureIO3dsServer | ||
{ | ||
return $this->fields['threeDSecureServer'] ?? null; | ||
} | ||
|
||
public function setThreeDSecureServer(null|ThreeDSecureIO3dsServer|array $threeDSecureServer): static | ||
{ | ||
if ($threeDSecureServer !== null && !($threeDSecureServer instanceof ThreeDSecureIO3dsServer)) { | ||
$threeDSecureServer = ThreeDSecureIO3dsServer::from($threeDSecureServer); | ||
} | ||
|
||
$this->fields['threeDSecureServer'] = $threeDSecureServer; | ||
|
||
return $this; | ||
} | ||
|
||
public function jsonSerialize(): array | ||
{ | ||
$data = []; | ||
if (array_key_exists('credentials', $this->fields)) { | ||
$data['credentials'] = $this->fields['credentials']->jsonSerialize(); | ||
} | ||
if (array_key_exists('threeDSecureServer', $this->fields)) { | ||
$data['threeDSecureServer'] = $this->fields['threeDSecureServer']?->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,73 @@ | ||
<?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 PayUCredentials implements JsonSerializable | ||
{ | ||
private array $fields = []; | ||
|
||
public function __construct(array $data = []) | ||
{ | ||
if (array_key_exists('merchantKey', $data)) { | ||
$this->setMerchantKey($data['merchantKey']); | ||
} | ||
if (array_key_exists('merchantSalt', $data)) { | ||
$this->setMerchantSalt($data['merchantSalt']); | ||
} | ||
} | ||
|
||
public static function from(array $data = []): self | ||
{ | ||
return new self($data); | ||
} | ||
|
||
public function getMerchantKey(): string | ||
{ | ||
return $this->fields['merchantKey']; | ||
} | ||
|
||
public function setMerchantKey(string $merchantKey): static | ||
{ | ||
$this->fields['merchantKey'] = $merchantKey; | ||
|
||
return $this; | ||
} | ||
|
||
public function getMerchantSalt(): string | ||
{ | ||
return $this->fields['merchantSalt']; | ||
} | ||
|
||
public function setMerchantSalt(string $merchantSalt): static | ||
{ | ||
$this->fields['merchantSalt'] = $merchantSalt; | ||
|
||
return $this; | ||
} | ||
|
||
public function jsonSerialize(): array | ||
{ | ||
$data = []; | ||
if (array_key_exists('merchantKey', $this->fields)) { | ||
$data['merchantKey'] = $this->fields['merchantKey']; | ||
} | ||
if (array_key_exists('merchantSalt', $this->fields)) { | ||
$data['merchantSalt'] = $this->fields['merchantSalt']; | ||
} | ||
|
||
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