mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Significant upgrade for GoCardless supporting their Billing Request Flows
This commit is contained in:
parent
17ceeb8a29
commit
e1a0a1a375
@ -30,6 +30,7 @@ use Illuminate\Http\Request;
|
|||||||
use Illuminate\Routing\Redirector;
|
use Illuminate\Routing\Redirector;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
|
|
||||||
|
//@deprecated
|
||||||
class ACH implements MethodInterface
|
class ACH implements MethodInterface
|
||||||
{
|
{
|
||||||
use MakesHash;
|
use MakesHash;
|
||||||
|
@ -11,23 +11,23 @@
|
|||||||
|
|
||||||
namespace App\PaymentDrivers;
|
namespace App\PaymentDrivers;
|
||||||
|
|
||||||
|
use App\Factory\ClientContactFactory;
|
||||||
|
use App\Factory\ClientFactory;
|
||||||
|
use App\Http\Requests\Payments\PaymentWebhookRequest;
|
||||||
|
use App\Jobs\Mail\PaymentFailedMailer;
|
||||||
|
use App\Jobs\Util\SystemLogger;
|
||||||
use App\Models\Client;
|
use App\Models\Client;
|
||||||
|
use App\Models\ClientGatewayToken;
|
||||||
use App\Models\Country;
|
use App\Models\Country;
|
||||||
|
use App\Models\GatewayType;
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Models\Payment;
|
use App\Models\Payment;
|
||||||
use App\Models\SystemLog;
|
|
||||||
use App\Models\GatewayType;
|
|
||||||
use App\Models\PaymentHash;
|
use App\Models\PaymentHash;
|
||||||
use App\Models\PaymentType;
|
use App\Models\PaymentType;
|
||||||
use App\Factory\ClientFactory;
|
use App\Models\SystemLog;
|
||||||
use App\Jobs\Util\SystemLogger;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Models\ClientGatewayToken;
|
|
||||||
use App\Factory\ClientContactFactory;
|
|
||||||
use App\Jobs\Mail\PaymentFailedMailer;
|
|
||||||
use App\Utils\Traits\GeneratesCounter;
|
use App\Utils\Traits\GeneratesCounter;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Database\QueryException;
|
use Illuminate\Database\QueryException;
|
||||||
use App\Http\Requests\Payments\PaymentWebhookRequest;
|
|
||||||
|
|
||||||
class GoCardlessPaymentDriver extends BaseDriver
|
class GoCardlessPaymentDriver extends BaseDriver
|
||||||
{
|
{
|
||||||
@ -133,7 +133,6 @@ class GoCardlessPaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
public function tokenBilling(ClientGatewayToken $cgt, PaymentHash $payment_hash)
|
public function tokenBilling(ClientGatewayToken $cgt, PaymentHash $payment_hash)
|
||||||
{
|
{
|
||||||
|
|
||||||
$amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total;
|
$amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total;
|
||||||
$converted_amount = $this->convertToGoCardlessAmount($amount, $this->client->currency()->precision);
|
$converted_amount = $this->convertToGoCardlessAmount($amount, $this->client->currency()->precision);
|
||||||
|
|
||||||
@ -244,7 +243,6 @@ class GoCardlessPaymentDriver extends BaseDriver
|
|||||||
$this->init();
|
$this->init();
|
||||||
|
|
||||||
nlog('GoCardless Event');
|
nlog('GoCardless Event');
|
||||||
nlog($request->all());
|
|
||||||
|
|
||||||
if (! $request->has('events')) {
|
if (! $request->has('events')) {
|
||||||
nlog('No GoCardless events to process in response?');
|
nlog('No GoCardless events to process in response?');
|
||||||
@ -280,7 +278,6 @@ class GoCardlessPaymentDriver extends BaseDriver
|
|||||||
->first();
|
->first();
|
||||||
|
|
||||||
if ($payment) {
|
if ($payment) {
|
||||||
|
|
||||||
if ($payment->status_id == Payment::STATUS_PENDING) {
|
if ($payment->status_id == Payment::STATUS_PENDING) {
|
||||||
$payment->service()->deletePayment();
|
$payment->service()->deletePayment();
|
||||||
}
|
}
|
||||||
@ -301,7 +298,6 @@ class GoCardlessPaymentDriver extends BaseDriver
|
|||||||
$payment->client,
|
$payment->client,
|
||||||
$error
|
$error
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user