-
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.
Add service request and response stubs
- Loading branch information
Showing
2 changed files
with
284 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,135 @@ | ||
<?php | ||
|
||
namespace App\Services\Checkout; | ||
|
||
use App\Services\Checkout\Contracts\CheckoutRequester; | ||
use Payavel\Orchestration\ServiceRequest; | ||
|
||
class {{ Provider }}CheckoutRequest extends ServiceRequest implements CheckoutRequester | ||
{ | ||
/** | ||
* Set up the request. | ||
* | ||
* @return void | ||
*/ | ||
protected function setUp() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Retrieve the wallet's details from the provider. | ||
* | ||
* @param \Payavel\Checkout\Models\Wallet $wallet | ||
* @return \Payavel\Checkout\CheckoutResponse | ||
*/ | ||
public function getWallet(Wallet $wallet) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Retrieve the payment method's details from the provider. | ||
* | ||
* @param \Payavel\Checkout\Models\PaymentMethod $paymentMethod | ||
* @return \Payavel\Checkout\CheckoutResponse | ||
*/ | ||
public function getPaymentMethod(PaymentMethod $paymentMethod) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Store the payment method details at the provider. | ||
* | ||
* @param \Payavel\Checkout\Contracts\Billable $billable | ||
* @param array|mixed $data | ||
* @return \Payavel\Checkout\CheckoutResponse | ||
*/ | ||
public function tokenizePaymentMethod(Billable $billable, $data) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Update the payment method's details at the provider. | ||
* | ||
* @param \Payavel\Checkout\Models\PaymentMethod $paymentMethod | ||
* @param array|mixed $data | ||
* @return \Payavel\Checkout\CheckoutResponse | ||
*/ | ||
public function updatePaymentMethod(PaymentMethod $paymentMethod, $data) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Delete the payment method at the provider. | ||
* | ||
* @param \Payavel\Checkout\Models\PaymentMethod $paymentMethod | ||
* @return \Payavel\Checkout\CheckoutResponse | ||
*/ | ||
public function deletePaymentMethod(PaymentMethod $paymentMethod) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Authorize a transaction. | ||
* | ||
* @param array|mixed $data | ||
* @param \Payavel\Checkout\Contracts\Billable|null $billable | ||
* @return \Payavel\Checkout\CheckoutResponse | ||
*/ | ||
public function authorize($data, Billable $billable = null) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Capture a previously authorized transaction. | ||
* | ||
* @param \Payavel\Checkout\Models\PaymentTransaction $transaction | ||
* @param array|mixed $data | ||
* @return \Payavel\Checkout\CheckoutResponse | ||
*/ | ||
public function capture(PaymentTransaction $transaction, $data = []) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Retrieve the transaction details from the provider. | ||
* | ||
* @param \Payavel\Checkout\Models\PaymentTransaction $transaction | ||
* @return \Payavel\Checkout\CheckoutResponse | ||
*/ | ||
public function getTransaction(PaymentTransaction $transaction) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Void a previously authorized transaction. | ||
* | ||
* @param \Payavel\Checkout\Models\PaymentTransaction $transaction | ||
* @param array|mixed $data | ||
* @return \Payavel\Checkout\CheckoutResponse | ||
*/ | ||
public function void(PaymentTransaction $transaction, $data = []) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Refund a previously captured transaction. | ||
* | ||
* @param \Payavel\Checkout\Models\PaymentTransaction $transaction | ||
* @param array|mixed | ||
* @return \Payavel\Checkout\CheckoutResponse | ||
*/ | ||
public function refund(PaymentTransaction $transaction, $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,149 @@ | ||
<?php | ||
|
||
namespace App\Services\Checkout; | ||
|
||
use App\Services\Checkout\Contracts\CheckoutResponder; | ||
use Payavel\Orchestration\ServiceResponse; | ||
|
||
class {{ Provider }}CheckoutResponse extends ServiceResponse implements CheckoutResponder | ||
{ | ||
/** | ||
* Set up the response. | ||
* | ||
* @return void | ||
*/ | ||
protected function setUp() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Maps details from the getWallet() response to the expected format. | ||
* | ||
* @return array|mixed | ||
*/ | ||
public function getWalletResponse() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Maps details from the getPaymentMethod() response to the expected format. | ||
* | ||
* @return array|mixed | ||
*/ | ||
public function getPaymentMethodResponse() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Maps details from the tokenizePaymentMethod() response to the expected format. | ||
* | ||
* @return array|mixed | ||
*/ | ||
public function tokenizePaymentMethodResponse() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Maps details from the updatePaymentMethod() response to the expected format. | ||
* | ||
* @return array|mixed | ||
*/ | ||
public function updatePaymentMethodResponse() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Maps details from the deletePaymentMethod() response to the expected format. | ||
* | ||
* @return array|mixed | ||
*/ | ||
public function deletePaymentMethodResponse() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Maps details from the authorize() response to the expected format. | ||
* | ||
* @return array|mixed | ||
*/ | ||
public function authorizeResponse() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Maps details from the capture() response to the expected format. | ||
* | ||
* @return array|mixed | ||
*/ | ||
public function captureResponse() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Maps details from the getTransaction() response to the expected format. | ||
* | ||
* @return array|mixed | ||
*/ | ||
public function getTransactionResponse() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Maps details from the void() response to the expected format. | ||
* | ||
* @return array|mixed | ||
*/ | ||
public function voidResponse() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Maps details from the refund() response to the expected format. | ||
* | ||
* @return array|mixed | ||
*/ | ||
public function refundResponse() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Determines the status code based on the request's raw response. | ||
* | ||
* @return int | ||
*/ | ||
public function getStatusCode() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Get a string representation of the response's status. | ||
* | ||
* @return string|null | ||
*/ | ||
public function getStatusMessage() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Get a description of the response's status. | ||
* | ||
* @return string|null | ||
*/ | ||
public function getStatusDescription() | ||
{ | ||
// | ||
} | ||
} |