riazXrazor / payumoey

PayUMoney library for Laravel and core PHP
MIT License
0 stars 6 forks source link

Success Url and Failure Url rendered but getting 404 error code #2

Open azadvarun opened 4 years ago

azadvarun commented 4 years ago

This is my code

$result = \Payumoney::pay([ 'txnid' => uniqid(), 'amount' => $payable, 'productinfo' => 'A book', 'firstname' => $user_info->name, 'email' => $user_info->email, 'phone' => '750XXXXXX', 'surl' => url('books/order-success'), 'furl' =>url('books/failure-order'), ])->send();

// $result = \Payumoney::completePay($_POST);

if ($result->checksumIsValid() AND isSuccess()) { print 'Payment was successful.'; } else { print 'Payment was not successful.'; }

riazXrazor commented 4 years ago

try adding the routes to Csrf exception list

u can also look at the example project i linked in the readme https://github.com/riazXrazor/riazXrazor-payumoey-example

app/Http/Middleware/VerifyCsrfToken.php
 protected $except = [
        'payumoney-test/return'
    ];
azadvarun commented 4 years ago

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Call to undefined function App\Http\Controllers\isSuccess()

public function payment_return(Request $request){ $result = \Payumoney::completePay($_POST);

   if ($result->checksumIsValid() AND isSuccess()) {

print 'Payment was successful.'; } else { print 'Payment was not successful.'; }

  // dd($result->getParams());

}

riazXrazor commented 4 years ago

if ($result->checksumIsValid() and $result->isSuccess()) {

print 'Payment was successful.';

} else {

print 'Payment was not successful.';

}

azadvarun commented 4 years ago

Here We only able to pay using card can we costomize it for netbanking and upi payment.

I am thankful to you sir If we provide me suggestion.

riazXrazor commented 4 years ago

you can check check their documentation once, if its available in paid services