Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Feb 1, 2024
1 parent ddc171f commit 68710a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 2 additions & 6 deletions src/Gateway/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ public function getSuccessUrl(Order $order): string
{
$url = $this->config['success_url'] ?? Config::get('bazar.gateway.urls.success');

return URL::to(str_replace(['{order}'], [$order->uuid], $url ?? '/'), [
'driver' => $this->name,
]);
return URL::to(str_replace(['{order}'], [$order->uuid], $url ?? '/'));
}

/**
Expand All @@ -76,9 +74,7 @@ public function getFailureUrl(Order $order): string
{
$url = $this->config['failure_url'] ?? Config::get('bazar.gateway.urls.failure');

return URL::to(str_replace(['{order}'], [$order->uuid], $url ?? '/'), [
'driver' => $this->name,
]);
return URL::to(str_replace(['{order}'], [$order->uuid], $url ?? '/'));
}

/**
Expand Down
8 changes: 5 additions & 3 deletions src/Http/Controllers/GatewayController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Cone\Bazar\Http\Controllers;

use Cone\Bazar\Gateway\Response;
use Cone\Bazar\Support\Facades\Gateway;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;

class GatewayController extends Controller
{
Expand All @@ -15,14 +15,16 @@ public function capture(Request $request, string $driver): Response
{
$gateway = Gateway::driver($driver);

return $gateway->handleCapture($request, $gateway->resolveOrderForCapture($request))->toResponse($request);
return $gateway->handleCapture(
$request, $gateway->resolveOrderForCapture($request)
);
}

/**
* Handle the notification request.
*/
public function notification(Request $request, string $driver): Response
{
return Gateway::driver($driver)->handleNotification($request)->toResponse($request);
return Gateway::driver($driver)->handleNotification($request);
}
}

0 comments on commit 68710a0

Please sign in to comment.