2021-10-07 16:35:58 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\PaymentDrivers\Razorpay;
|
|
|
|
|
|
|
|
use App\Http\Requests\ClientPortal\Payments\PaymentResponseRequest;
|
2021-10-07 16:54:56 +02:00
|
|
|
use App\Http\Requests\Request;
|
2021-10-07 16:35:58 +02:00
|
|
|
use App\PaymentDrivers\Common\MethodInterface;
|
2021-10-07 16:52:41 +02:00
|
|
|
use App\PaymentDrivers\RazorpayPaymentDriver;
|
2021-10-07 16:54:56 +02:00
|
|
|
use Illuminate\Http\RedirectResponse;
|
|
|
|
use Illuminate\View\View;
|
2021-10-07 16:35:58 +02:00
|
|
|
|
|
|
|
class Hosted implements MethodInterface
|
|
|
|
{
|
2021-10-07 16:52:41 +02:00
|
|
|
protected RazorpayPaymentDriver $razorpay;
|
|
|
|
|
|
|
|
public function __construct(RazorpayPaymentDriver $razorpay)
|
|
|
|
{
|
|
|
|
$this->razorpay = $razorpay;
|
|
|
|
|
|
|
|
$this->razorpay->init();
|
|
|
|
}
|
|
|
|
|
2021-10-07 16:54:56 +02:00
|
|
|
/**
|
|
|
|
* Show the authorization page for Razorpay.
|
|
|
|
*
|
|
|
|
* @param array $data
|
|
|
|
* @return View
|
|
|
|
*/
|
|
|
|
public function authorizeView(array $data): View
|
|
|
|
{
|
|
|
|
return render('gateways.razorpay.hosted.authorize', $data);
|
|
|
|
}
|
2021-10-07 16:35:58 +02:00
|
|
|
|
2021-10-07 16:54:56 +02:00
|
|
|
/**
|
|
|
|
* Handle the authorization page for Razorpay.
|
|
|
|
*
|
|
|
|
* @param Request $request
|
|
|
|
* @return RedirectResponse
|
|
|
|
*/
|
|
|
|
public function authorizeResponse(Request $request): RedirectResponse
|
|
|
|
{
|
|
|
|
return redirect()->route('client.payment_methods.index');
|
|
|
|
}
|
2021-10-07 16:35:58 +02:00
|
|
|
|
2021-10-07 16:54:56 +02:00
|
|
|
public function paymentView(array $data)
|
|
|
|
{
|
|
|
|
}
|
2021-10-07 16:35:58 +02:00
|
|
|
|
2021-10-07 16:54:56 +02:00
|
|
|
public function paymentResponse(PaymentResponseRequest $request)
|
|
|
|
{
|
|
|
|
}
|
2021-10-07 16:35:58 +02:00
|
|
|
}
|