mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes from refactor
This commit is contained in:
parent
00f1c935cf
commit
ee937d9994
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -33,10 +33,10 @@ class CheckoutComPaymentDriver extends BasePaymentDriver
|
||||
|
||||
/**
|
||||
* @param PaymentMethod $paymentMethod
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function paymentDetails(PaymentMethod $paymentMethod = false)
|
||||
protected function paymentDetails(PaymentMethod $paymentMethod = null)
|
||||
{
|
||||
$data = parent::paymentDetails();
|
||||
|
||||
|
@ -9,10 +9,10 @@ class MolliePaymentDriver extends BasePaymentDriver
|
||||
{
|
||||
/**
|
||||
* @param $input
|
||||
*
|
||||
*
|
||||
* @return \App\Models\Payment|mixed
|
||||
*/
|
||||
public function completeOffsitePurchase($input)
|
||||
public function completeOffsitePurchase(array $input)
|
||||
{
|
||||
$details = $this->paymentDetails();
|
||||
|
||||
|
@ -11,8 +11,8 @@ class PayFastPaymentDriver extends BasePaymentDriver
|
||||
* @var string
|
||||
*/
|
||||
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');
|
||||
|
@ -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();
|
||||
|
||||
@ -37,7 +37,7 @@ class PayPalExpressPaymentDriver extends BasePaymentDriver
|
||||
/**
|
||||
* @param Payment $payment
|
||||
* @param PaymentMethod $paymentMethod
|
||||
*
|
||||
*
|
||||
* @return Payment
|
||||
*/
|
||||
protected function creatingPayment(Payment $payment, PaymentMethod $paymentMethod)
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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);
|
||||
|
||||
@ -394,7 +394,7 @@ class StripePaymentDriver extends BasePaymentDriver
|
||||
|
||||
/**
|
||||
* @param $input
|
||||
*
|
||||
*
|
||||
* @return array|string
|
||||
* @throws Exception
|
||||
*/
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user