Skip to content

Commit

Permalink
Add 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 f048ed9 commit b656c45
Show file tree
Hide file tree
Showing 2 changed files with 284 additions and 0 deletions.
135 changes: 135 additions & 0 deletions stubs/service-request.stub
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 = [])
{
//
}
}
149 changes: 149 additions & 0 deletions stubs/service-response.stub
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()
{
//
}
}

0 comments on commit b656c45

Please sign in to comment.