samedi 20 juin 2020

Laravel On payment Response POST Method is not supported.. supported method is GET, HEAD

I had developed the E-Program Website on the Laravel 7 Framework. I had integrated my CC Avenue payment Gateway with the help of indipay softon, package but on payment successful I am getting error i.e POST Method is not supported.. supported method is GET, HEAD

.env file

INDIPAY_MERCHANT_ID=26XXXX
INDIPAY_ACCESS_CODE=AVPXXXXXXXXXXXXXXXX
INDIPAY_WORKING_KEY=77XXXXXXXXXXXXXXXXXXXXXXX
INDIPAY_REDIRECT_URL="http://eprogram.lfwproducts.com/checkoutResponse"
INDIPAY_CANCEL_URL="http://eprogram.lfwproducts.com/cart"
INDIPAY_CURRENCY="INR"
INDIPAY_LANGUAGE="EN"

controller File

public function checkout(Request $request)
    {
        if (Auth::check()) {
            $courseId = $request->post('courseId');
            $courseTicket = $request->post('courseTicket');
            $userId = $request->post('uid');
            $total = $request->post('total');

            $letters = "LFW-EP";
            $digits = "1234567890";
            $randomString = "";

            for ($i = 0; $i < 3; $i++) {
                $randomString .= $digits[rand(0, strlen($digits) - 1)];
            }
            $orderId = $letters . $randomString;
            $parameters = [
                'merchant_id' => 26XXXX,
                'currency' => 'INR',
                'redirect_url' => 'http://eprogram.lfwproducts.com/checkoutResponse',
                'cancel_url' => 'http://eprogram.lfwproducts.com/cart',
                'language' => 'EN',
                'order_id' => $orderId,
                'amount' => $total,
                'merchant_param1' => $userId,
                'merchant_param2' => $courseId[0],
                'merchant_param3' => $courseTicket[0],
            ];
            $order = Indipay::gateway('CCAvenue')->prepare($parameters);
            return Indipay::process($order);
        } else {
            return \view('auth.login');
        }
    }

    public function myPaymentResponse(Request $request)
    {
        // For default Gateway
        $response = Indipay::response($request);
        // For Otherthan Default Gateway
        $response1 = Indipay::gateway('CCAvenue')->response($request);
        dd($response);
    }

verifycsrftoken file

    protected $except = [
        'https://secure.ccavenue.com/transaction/transaction.do?command=initiateTransaction',
        'http://eprogram.lfwproducts.com/checkoutResponse',
        '*/checkoutResponse',
        'ccavenue/*'
    ];

web.php file

Route::get('/checkoutResponse', 'CartController@myPaymentResponse')->name('checkoutResponse');

Error enter image description here



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Bnocca
via IFTTT

Aucun commentaire:

Enregistrer un commentaire