-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename "Payment" to "Checkout" where relevant
- Loading branch information
Showing
24 changed files
with
283 additions
and
284 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
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,19 @@ | ||
<?php | ||
|
||
namespace Payavel\Checkout; | ||
|
||
use Payavel\Checkout\Contracts\CheckoutRequester; | ||
use Payavel\Checkout\Traits\CheckoutRequests; | ||
use Payavel\Orchestration\ServiceRequest; | ||
|
||
abstract class CheckoutRequest extends ServiceRequest implements CheckoutRequester | ||
{ | ||
use CheckoutRequests; | ||
|
||
/** | ||
* The service response class. | ||
* | ||
* @var \Payavel\Orchestration\ServiceResponse | ||
*/ | ||
protected $serviceResponse = CheckoutResponse::class; | ||
} |
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,54 @@ | ||
<?php | ||
|
||
namespace Payavel\Checkout; | ||
|
||
use Payavel\Checkout\Contracts\CheckoutResponder; | ||
use Payavel\Checkout\Traits\CheckoutResponses; | ||
use Payavel\Orchestration\ServiceResponse; | ||
|
||
abstract class CheckoutResponse extends ServiceResponse implements CheckoutResponder | ||
{ | ||
use CheckoutResponses; | ||
|
||
/** | ||
* Statuses in this array are considered successful. | ||
* | ||
* @var array | ||
*/ | ||
protected $successStatuses = [ | ||
CheckoutStatus::AUTHORIZED, | ||
CheckoutStatus::APPROVED, | ||
CheckoutStatus::CAPTURED, | ||
CheckoutStatus::PARTIALLY_CAPTURED, | ||
CheckoutStatus::SETTLED, | ||
CheckoutStatus::CANCELED, | ||
CheckoutStatus::VOIDED, | ||
CheckoutStatus::REFUNDED, | ||
CheckoutStatus::PARTIALLY_REFUNDED, | ||
CheckoutStatus::REFUND_SETTLED, | ||
CheckoutStatus::REFUND_FAILED, | ||
CheckoutStatus::REFUND_REVERSED, | ||
CheckoutStatus::PENDING, | ||
CheckoutStatus::PROCESSING_ASYNC, | ||
]; | ||
|
||
/** | ||
* Get a string representation of the response's status. | ||
* | ||
* @return string|null | ||
*/ | ||
public function getStatusMessage() | ||
{ | ||
return CheckoutStatus::get($this->getStatusCode()); | ||
} | ||
|
||
/** | ||
* Get a description of the response's status. | ||
* | ||
* @return string|null | ||
*/ | ||
public function getStatusDescription() | ||
{ | ||
return CheckoutStatus::getMessage($this->getStatusCode()); | ||
} | ||
} |
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
Oops, something went wrong.