-
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.
Merge pull request #17 from Plasma-Platform/features/BIL-34/frontend
BIL-34 - add getInvoiceUrl and getTransactionStatusUrl methods
- Loading branch information
Showing
4 changed files
with
191 additions
and
2 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
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,71 @@ | ||
<?php | ||
|
||
namespace API2Client\Entities\Order; | ||
|
||
/** | ||
* Class BillingPortal | ||
* @package API2Client\Entities\Order | ||
* @property string $url | ||
* @property array $messages | ||
* @property bool $status | ||
*/ | ||
class BillingPortal | ||
{ | ||
private $url; | ||
private $status = false; | ||
private $messages = array(); | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getUrl() | ||
{ | ||
return $this->url; | ||
} | ||
|
||
/** | ||
* @param mixed $url | ||
* @return BillingPortal | ||
*/ | ||
public function setUrl($url) | ||
{ | ||
$this->url = $url; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isStatus() | ||
{ | ||
return $this->status; | ||
} | ||
|
||
/** | ||
* @param bool $status | ||
* @return BillingPortal | ||
*/ | ||
public function setStatus($status) | ||
{ | ||
$this->status = $status; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getMessages() | ||
{ | ||
return $this->messages; | ||
} | ||
|
||
/** | ||
* @param array $messages | ||
* @return BillingPortal | ||
*/ | ||
public function setMessages($messages) | ||
{ | ||
$this->messages = $messages; | ||
return $this; | ||
} | ||
} |
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,28 @@ | ||
<?php | ||
|
||
namespace API2Client\Setters; | ||
|
||
use API2Client\Entities\Order\BillingPortal; | ||
|
||
class BillingPortalFactory extends FactoryAbstract implements FactoryInterface | ||
{ | ||
/** | ||
* Create Entity Object from array | ||
* | ||
* @param array $data | ||
* @return BillingPortal | ||
*/ | ||
public function create($data) | ||
{ | ||
$portal = new BillingPortal(); | ||
$portal->setUrl($this->getValue('url', $data, null)); | ||
$portal->setStatus((bool)$this->getValue('status', $data, false)); | ||
$messages = $this->getValue('messages', $data, array()); | ||
|
||
if (is_array($messages) && !empty($messages)) { | ||
$portal->setMessages($messages); | ||
} | ||
|
||
return $portal; | ||
} | ||
} |