Skip to content

Commit

Permalink
Update service request and response stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
r-kujawa committed Apr 21, 2024
1 parent b656c45 commit a342200
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 40 deletions.
7 changes: 0 additions & 7 deletions src/CheckoutRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,4 @@
abstract class CheckoutRequest extends ServiceRequest implements CheckoutRequester
{
use CheckoutRequests;

/**
* The service response class.
*
* @var \Payavel\Orchestration\ServiceResponse
*/
protected $serviceResponse = CheckoutResponse::class;
}
2 changes: 2 additions & 0 deletions src/CheckoutServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ protected function registerPublishableAssets()
$this->publishes([
__DIR__ . '/../stubs/service-requester.stub' => base_path('stubs/orchestration/checkout/service-requester.stub'),
__DIR__ . '/../stubs/service-responder.stub' => base_path('stubs/orchestration/checkout/service-responder.stub'),
__DIR__ . '/../stubs/service-request.stub' => base_path('stubs/orchestration/checkout/service-request.stub'),
__DIR__ . '/../stubs/service-response.stub' => base_path('stubs/orchestration/checkout/service-response.stub'),
], ['payavel', 'payavel-checkout', 'payavel-stubs', 'payavel-checkout-stubs']);
}

Expand Down
4 changes: 2 additions & 2 deletions stubs/service-request.stub
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace App\Services\Checkout;

use App\Services\Checkout\Contracts\CheckoutRequester;
use Payavel\Orchestration\ServiceRequest;
use Payavel\Checkout\CheckoutRequest;

class {{ Provider }}CheckoutRequest extends ServiceRequest implements CheckoutRequester
class {{ Provider }}CheckoutRequest extends CheckoutRequest implements CheckoutRequester
{
/**
* Set up the request.
Expand Down
42 changes: 11 additions & 31 deletions stubs/service-response.stub
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Services\Checkout;

use App\Services\Checkout\Contracts\CheckoutResponder;
use Payavel\Orchestration\ServiceResponse;
use Payavel\Checkout\CheckoutResponse;

class {{ Provider }}CheckoutResponse extends ServiceResponse implements CheckoutResponder
{
Expand All @@ -17,6 +17,16 @@ class {{ Provider }}CheckoutResponse extends ServiceResponse implements Checkout
//
}

/**
* Determines the status code based on the request's raw response.
*
* @return int
*/
public function getStatusCode()
{
//
}

/**
* Maps details from the getWallet() response to the expected format.
*
Expand Down Expand Up @@ -116,34 +126,4 @@ class {{ Provider }}CheckoutResponse extends ServiceResponse implements Checkout
{
//
}

/**
* 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()
{
//
}
}

0 comments on commit a342200

Please sign in to comment.