-
Notifications
You must be signed in to change notification settings - Fork 30
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 #241 from TransbankDevelopers/feat/api-1.3
Feat/api 1.3
- Loading branch information
Showing
40 changed files
with
1,128 additions
and
53 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/Common/Responses/BaseDeferredCaptureHistoryResponse.php
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,19 @@ | ||
<?php | ||
|
||
namespace Transbank\Common\Responses; | ||
|
||
class BaseDeferredCaptureHistoryResponse | ||
{ | ||
public $operations; | ||
|
||
public function __construct($json) | ||
{ | ||
if (is_array($json)) { | ||
$this->operations = []; | ||
foreach ($json as $operation) { | ||
$this->operations[] = HistoryDetails::createFromArray($operation); | ||
} | ||
} | ||
|
||
} | ||
} |
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,63 @@ | ||
<?php | ||
|
||
namespace Transbank\Common\Responses; | ||
|
||
use Transbank\Utils\Utils; | ||
|
||
class BaseDeferredStatusResponse | ||
{ | ||
public $authorizationCode; | ||
public $authorizationDate; | ||
public $totalAmount; | ||
public $expirationDate; | ||
public $responseCode; | ||
|
||
public function __construct($json) | ||
{ | ||
$authorizationCode = Utils::returnValueIfExists($json, 'authorization_code'); | ||
$this->setAuthorizationCode($authorizationCode); | ||
$authorizationDate = Utils::returnValueIfExists($json, 'authorization_date'); | ||
$this->setAuthorizationDate($authorizationDate); | ||
$totalAmount = Utils::returnValueIfExists($json, 'total_amount'); | ||
$this->setTotalAmount($totalAmount); | ||
$expirationDate = Utils::returnValueIfExists($json, 'expiration_date'); | ||
$this->setExpirationDate($expirationDate); | ||
$responseCode = Utils::returnValueIfExists($json, 'response_code'); | ||
$this->setResponseCode($responseCode); | ||
} | ||
|
||
public function setAuthorizationCode($authorizationCode) | ||
{ | ||
$this->authorizationCode = $authorizationCode; | ||
|
||
return $this; | ||
} | ||
|
||
public function setAuthorizationDate($authorizationDate) | ||
{ | ||
$this->authorizationDate = $authorizationDate; | ||
|
||
return $this; | ||
} | ||
|
||
public function setTotalAmount($totalAmount) | ||
{ | ||
$this->totalAmount = $totalAmount; | ||
|
||
return $this; | ||
} | ||
|
||
public function setExpirationDate($expirationDate) | ||
{ | ||
$this->expirationDate = $expirationDate; | ||
|
||
return $this; | ||
} | ||
|
||
public function setResponseCode($responseCode) | ||
{ | ||
$this->responseCode = $responseCode; | ||
|
||
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,50 @@ | ||
<?php | ||
|
||
namespace Transbank\Common\Responses; | ||
|
||
use Transbank\Utils\Utils; | ||
|
||
class HistoryDetails | ||
{ | ||
|
||
public $type; | ||
public $amount; | ||
public $authorizationCode; | ||
public $authorizationDate; | ||
public $totalAmount; | ||
public $expirationDate; | ||
public $responseCode; | ||
|
||
public function __construct( | ||
$type, | ||
$amount, | ||
$authorizationCode, | ||
$authorizationDate, | ||
$totalAmount, | ||
$expirationDate, | ||
$responseCode | ||
) { | ||
$this->type = $type; | ||
$this->amount = $amount; | ||
$this->authorizationCode = $authorizationCode; | ||
$this->authorizationDate = $authorizationDate; | ||
$this->totalAmount = $totalAmount; | ||
$this->expirationDate = $expirationDate; | ||
$this->responseCode = $responseCode; | ||
} | ||
|
||
public static function createFromArray(array $array) | ||
{ | ||
$type = isset($array['type']) ? $array['type'] : null; | ||
$amount = isset($array['amount']) ? $array['amount'] : null; | ||
$authorizationCode = isset($array['authorization_code']) ? $array['authorization_code'] : null; | ||
$authorizationDate = isset($array['authorization_date']) ? $array['authorization_date'] : null; | ||
$totalAmount = isset($array['total_amount']) ? $array['total_amount'] : null; | ||
$expirationDate = isset($array['expiration_date']) ? $array['expiration_date'] : null; | ||
$responseCode = isset($array['response_code']) ? $array['response_code'] : null; | ||
|
||
return new static($type, $amount, $authorizationCode, $authorizationDate, $totalAmount, $expirationDate, | ||
$responseCode); | ||
} | ||
|
||
} |
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
9 changes: 9 additions & 0 deletions
9
src/TransaccionCompleta/Responses/DeferredCaptureHistoryResponse.php
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,9 @@ | ||
<?php | ||
|
||
namespace Transbank\TransaccionCompleta\Responses; | ||
|
||
use Transbank\Common\Responses\BaseDeferredCaptureHistoryResponse; | ||
|
||
class DeferredCaptureHistoryResponse extends BaseDeferredCaptureHistoryResponse | ||
{ | ||
} |
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,9 @@ | ||
<?php | ||
|
||
namespace Transbank\TransaccionCompleta\Responses; | ||
|
||
use Transbank\Common\Responses\BaseDeferredStatusResponse; | ||
|
||
class IncreaseAmountResponse extends BaseDeferredStatusResponse | ||
{ | ||
} |
9 changes: 9 additions & 0 deletions
9
src/TransaccionCompleta/Responses/IncreaseAuthorizationDateResponse.php
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,9 @@ | ||
<?php | ||
|
||
namespace Transbank\TransaccionCompleta\Responses; | ||
|
||
use Transbank\Common\Responses\BaseDeferredStatusResponse; | ||
|
||
class IncreaseAuthorizationDateResponse extends BaseDeferredStatusResponse | ||
{ | ||
} |
9 changes: 9 additions & 0 deletions
9
src/TransaccionCompleta/Responses/MallDeferredCaptureHistoryResponse.php
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,9 @@ | ||
<?php | ||
|
||
namespace Transbank\TransaccionCompleta\Responses; | ||
|
||
use Transbank\Common\Responses\BaseDeferredCaptureHistoryResponse; | ||
|
||
class MallDeferredCaptureHistoryResponse extends BaseDeferredCaptureHistoryResponse | ||
{ | ||
} |
9 changes: 9 additions & 0 deletions
9
src/TransaccionCompleta/Responses/MallIncreaseAmountResponse.php
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,9 @@ | ||
<?php | ||
|
||
namespace Transbank\TransaccionCompleta\Responses; | ||
|
||
use Transbank\Common\Responses\BaseDeferredStatusResponse; | ||
|
||
class MallIncreaseAmountResponse extends BaseDeferredStatusResponse | ||
{ | ||
} |
9 changes: 9 additions & 0 deletions
9
src/TransaccionCompleta/Responses/MallIncreaseAuthorizationDateResponse.php
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,9 @@ | ||
<?php | ||
|
||
namespace Transbank\TransaccionCompleta\Responses; | ||
|
||
use Transbank\Common\Responses\BaseDeferredStatusResponse; | ||
|
||
class MallIncreaseAuthorizationDateResponse extends BaseDeferredStatusResponse | ||
{ | ||
} |
9 changes: 9 additions & 0 deletions
9
src/TransaccionCompleta/Responses/MallReversePreAuthorizedAmountResponse.php
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,9 @@ | ||
<?php | ||
|
||
namespace Transbank\TransaccionCompleta\Responses; | ||
|
||
use Transbank\Common\Responses\BaseDeferredStatusResponse; | ||
|
||
class MallReversePreAuthorizedAmountResponse extends BaseDeferredStatusResponse | ||
{ | ||
} |
9 changes: 9 additions & 0 deletions
9
src/TransaccionCompleta/Responses/ReversePreAuthorizedAmountResponse.php
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,9 @@ | ||
<?php | ||
|
||
namespace Transbank\TransaccionCompleta\Responses; | ||
|
||
use Transbank\Common\Responses\BaseDeferredStatusResponse; | ||
|
||
class ReversePreAuthorizedAmountResponse extends BaseDeferredStatusResponse | ||
{ | ||
} |
Oops, something went wrong.