0

I cant figure out what is causing this error. I have checked to see if the parameters are correct and they seem to be. Also if anybody has an alternative way to get all the parameters in the route rather than listing them all please do tell. I can't find another way.

public function savePaymentDetails(Request $request, $code, $message, $mPAN, $type, $exp, $name, $TxnGUID,
     $ApprovalCode, $CVVMatch, $GT_MID, $GT_TRANS_ID, $GT_Val_Code, $ProcTxnID,
     $session, $card_brand_selected, $CRE_Verbose_Request, $CRESecureID,
     $trans_type, $content_template_url, $allowed_types, $order_desc, $sess_id,
     $sess_name, $return_url, $total_amt, $submit, $ip_address, $customer_lastname, $customer_firstname)
{
    $code2 = $request->get('code');

    echo $code2;
    echo $code; 
}

The route

Route::get('return/{code}/{message}/{mPAN}/{type}/{exp}/{name}/{TxnGUID}/{ApprovalCode}/{CVVMatch}/{GT_MID}/{GT_Trans_Id
}/{GT_Val_Code}/{ProcTxnID}/{session}/{card_brand_selected}/{CRE_Verbose_Request}/{CRESecureID  }/{trans_type}/{content_template_url}/{allowed_types}/{order_desc}/{sess_id}/{sess_name}/{return_url}/{total_amt
}/{submit}/{ip_address}/{customer_lastname}/{customer_firstname}', 'PaymentController@savePaymentDetails');

Here are the parameters returned by the URL that I need to get

/return?code=000&message=Success&mPAN=XXXXXXXXXXXX1111&type=Visa&exp=1218&name=test+visa&TxnGUID=6041323& ApprovalCode=VI0151&CVVMatch=M&GT_MID=672840408068703&GT_Trans_Id=016142173277748&GT_Val_Code=AACA&ProcTxnID=6041323&session=e91dd8af53j35k072s0bubjtn7&card_brand_selected=Visa&CRE_Verbose_Request=1&CRESecureID=gt153545888233SB&trans_type=+2&content_template_url=https%3A%2F%2Fexample.com%2Fpublic%2Ftemplate&allowed_types=Visa|MasterCard|American+Express&order_desc=6&sess_id=e91dd8af53j35k072s0bubjtn7&sess_name=session&return_url=https%3A%2F%2Fexample.com%2Fpublic%2Freturn&total_amt=1.51&submit=submit&ip_address=10.108.231.98&customer_lastname=visa&customer_firstname=test

noname
  • 305
  • 4
  • 15

1 Answers1

0

The route rule you define actually match the url like this

code/message/mPAN/type/exp/name/TxnGUID/ApprovalCode/CVVMatch/GT_MID/GT_Val_Code/ProcTxnID/session/card_brand_selected/CRE_Verbose_Request/trans_type/content_template_url/allowed_types/order_desc/sess_id/sess_name/return_url/submit/ip_address/customer_lastname/customer_firstname

instead of

return?code=blab&blablabal=blab

You url dismatch any route you define , so a not found exception was thrown .

If you are trying to get all url parameters you can just write your route like that .

Route::get('return', 'PaymentController@savePaymentDetails');

And get parameters in your controller :

$parameters = $requests->all();

What's more , if you are trying to save something to your database , you'd better use the post method , you can find more When should i use post or get.

Community
  • 1
  • 1
KIDJourney
  • 1,200
  • 1
  • 9
  • 22
  • So I should be using `Route::post('return', 'PaymentController@savePaymentDetails');` ? If so how would I get the parameters? Using `request->input('code')` ? – noname May 22 '16 at 01:13