Documentation for base driver

This commit is contained in:
David Bomba 2020-06-12 10:19:26 +10:00
parent 57da585a59
commit 8e7ae83739
2 changed files with 29 additions and 6 deletions

View File

@ -94,12 +94,12 @@ class AuthorizePaymentDriver extends BaseDriver
return $this->authorizeView($payment_method);
}
public function purchase()
public function purchase($amount, $return_client_response = false)
{
return ()
}
public function refund()
public function refund($amount, $transaction_reference, $return_client_response = false)
{
}

View File

@ -17,7 +17,6 @@ use App\Models\CompanyGateway;
use App\PaymentDrivers\AbstractPaymentDriver;
use App\Utils\Traits\MakesHash;
use App\Utils\Traits\SystemLogTrait;
use Omnipay\Omnipay;
/**
* Class BaseDriver
@ -44,6 +43,8 @@ class BaseDriver extends AbstractPaymentDriver
/* Authorise payment methods */
protected $can_authorise_credit_card = false;
/* The client */
protected $client;
public function __construct(CompanyGateway $company_gateway, Client $client = null, $invitation = false)
{
@ -54,10 +55,32 @@ class BaseDriver extends AbstractPaymentDriver
$this->client = $client;
}
/**
* Authorize a payment method.
*
* Returns a reusable token for storage for future payments
* @param const $payment_method the GatewayType::constant
* @return view Return a view for collecting payment method information
*/
public function authorize($payment_method) {}
public function purchase() {}
/**
* Executes purchase attempt for a given amount
*
* @param float $amount The amount to be collected
* @param boolean $return_client_response Whether the method needs to return a response (otherwise we assume an unattended payment)
* @return mixed
*/
public function purchase($amount, $return_client_response = false) {}
/**
* Executes a refund attempt for a given amount with a transaction_reference
*
* @param float $amount The amount to be refunded
* @param string $transaction_reference The transaction reference
* @param boolean $return_client_response Whether the method needs to return a response (otherwise we assume an unattended payment)
* @return mixed
*/
public function refund($amount, $transaction_reference, $return_client_response = false) {}
public function refund() {}
}