Fix route

This commit is contained in:
Lars Kusch 2022-12-16 15:19:00 +01:00
parent bd77acf705
commit 10cc02c14d
2 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,7 @@ namespace App\Http\Controllers\ClientPortal;
use App\Events\Payment\Methods\MethodDeleted; use App\Events\Payment\Methods\MethodDeleted;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Requests\ClientPortal\PaymentMethod\CreatePaymentMethodRequest; use App\Http\Requests\ClientPortal\PaymentMethod\CreatePaymentMethodRequest;
use App\Http\Requests\ClientPortal\PaymentMethod\VerifyPaymentMethodRequest;
use App\Http\Requests\Request; use App\Http\Requests\Request;
use App\Models\ClientGatewayToken; use App\Models\ClientGatewayToken;
use App\Models\GatewayType; use App\Models\GatewayType;

View File

@ -29,6 +29,7 @@ use App\Utils\Number;
class BACS class BACS
{ {
public $stripe; public $stripe;
public $session;
public function __construct(StripePaymentDriver $stripe) public function __construct(StripePaymentDriver $stripe)
{ {
@ -45,14 +46,16 @@ class BACS
'success_url' => $this->buildReturnUrl(), 'success_url' => $this->buildReturnUrl(),
'cancel_url' => 'https://example.com/cancel', 'cancel_url' => 'https://example.com/cancel',
]); ]);
$session = $data['session'];
return render('gateways.stripe.bacs.authorize', $data); return render('gateways.stripe.bacs.authorize', $data);
} }
private function buildReturnUrl(): string private function buildReturnUrl(): string
{ {
return route('client.payments.response', [ return route('client.payments.store', [
'company_gateway_id' => $this->stripe->company_gateway->id, 'company_gateway_id' => $this->stripe->company_gateway->id,
'payment_method_id' => GatewayType::BACS, 'payment_method_id' => GatewayType::BACS,
'session_id' => "{CHECKOUT_SESSION_ID}",
]); ]);
} }