Fixes from refactor

This commit is contained in:
Hillel Coren 2016-07-21 14:28:06 +03:00
parent 00f1c935cf
commit ee937d9994
9 changed files with 22 additions and 21 deletions

View File

@ -66,8 +66,8 @@ class BasePaymentDriver
* @param bool $gatewayType
*/
public function __construct(
AccountGateway $accountGateway = false,
Invitation $invitation = false,
AccountGateway $accountGateway = null,
Invitation $invitation = null,
$gatewayType = false
)
{
@ -173,7 +173,7 @@ class BasePaymentDriver
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\View\View
* @throws Exception
*/
public function startPurchase(array $input = false, $sourceId = false)
public function startPurchase(array $input = null, $sourceId = false)
{
$this->input = $input;
$this->sourceId = $sourceId;
@ -312,7 +312,7 @@ class BasePaymentDriver
* @return Payment|mixed|void
* @throws Exception
*/
public function completeOnsitePurchase($input = false, PaymentMethod $paymentMethod = false)
public function completeOnsitePurchase($input = false, PaymentMethod $paymentMethod = null)
{
$this->input = count($input) ? $input : false;
$gateway = $this->gateway();
@ -411,7 +411,7 @@ class BasePaymentDriver
*
* @return array
*/
protected function paymentDetails(PaymentMethod $paymentMethod = false)
protected function paymentDetails(PaymentMethod $paymentMethod = null)
{
$invoice = $this->invoice();
$completeUrl = url('complete/' . $this->invitation->invitation_key . '/' . $this->gatewayType);
@ -779,7 +779,7 @@ class BasePaymentDriver
*
* @return Payment
*/
protected function creatingPayment(Payment $payment, $paymentMethod)
protected function creatingPayment(Payment $payment, PaymentMethod $paymentMethod)
{
return $payment;
}
@ -860,7 +860,7 @@ class BasePaymentDriver
* @return bool|mixed
* @throws Exception
*/
public function completeOffsitePurchase($input)
public function completeOffsitePurchase(array $input)
{
$this->input = $input;
$ref = array_get($this->input, 'token') ?: $this->invitation->transaction_reference;

View File

@ -6,6 +6,7 @@ use App\Models\PaymentMethod;
use Exception;
use Session;
use Braintree\Customer;
use App\Models\Payment;
/**
* Class BraintreePaymentDriver
@ -53,7 +54,7 @@ class BraintreePaymentDriver extends BasePaymentDriver
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\View\View
*/
public function startPurchase(array $input = false, $sourceId = false)
public function startPurchase(array $input = null, $sourceId = false)
{
$data = parent::startPurchase($input, $sourceId);
@ -87,7 +88,7 @@ class BraintreePaymentDriver extends BasePaymentDriver
*
* @return array
*/
protected function paymentDetails(PaymentMethod $paymentMethod = false)
protected function paymentDetails(PaymentMethod $paymentMethod = null)
{
$data = parent::paymentDetails($paymentMethod);

View File

@ -36,7 +36,7 @@ class CheckoutComPaymentDriver extends BasePaymentDriver
*
* @return array
*/
protected function paymentDetails(PaymentMethod $paymentMethod = false)
protected function paymentDetails(PaymentMethod $paymentMethod = null)
{
$data = parent::paymentDetails();

View File

@ -12,7 +12,7 @@ class MolliePaymentDriver extends BasePaymentDriver
*
* @return \App\Models\Payment|mixed
*/
public function completeOffsitePurchase($input)
public function completeOffsitePurchase(array $input)
{
$details = $this->paymentDetails();

View File

@ -12,7 +12,7 @@ class PayFastPaymentDriver extends BasePaymentDriver
*/
protected $transactionReferenceParam = 'm_payment_id';
public function completeOffsitePurchase($input)
public function completeOffsitePurchase(array $input)
{
if ($accountGateway->isGateway(GATEWAY_PAYFAST) && Request::has('pt')) {
$token = Request::query('pt');

View File

@ -25,7 +25,7 @@ class PayPalExpressPaymentDriver extends BasePaymentDriver
*
* @return array
*/
protected function paymentDetails(PaymentMethod $paymentMethod = false)
protected function paymentDetails(PaymentMethod $paymentMethod = null)
{
$data = parent::paymentDetails();

View File

@ -24,7 +24,7 @@ class PayPalProPaymentDriver extends BasePaymentDriver
*
* @return array
*/
protected function paymentDetails(PaymentMethod $paymentMethod = false)
protected function paymentDetails(PaymentMethod $paymentMethod = null)
{
$data = parent::paymentDetails();

View File

@ -98,7 +98,7 @@ class StripePaymentDriver extends BasePaymentDriver
*
* @return array
*/
protected function paymentDetails(PaymentMethod $paymentMethod = false)
protected function paymentDetails(PaymentMethod $paymentMethod = null)
{
$data = parent::paymentDetails($paymentMethod);

View File

@ -70,7 +70,7 @@ class WePayPaymentDriver extends BasePaymentDriver
*
* @return array
*/
protected function paymentDetails(PaymentMethod $paymentMethod = false)
protected function paymentDetails(PaymentMethod $paymentMethod = null)
{
$data = parent::paymentDetails($paymentMethod);