2016-03-29 14 views
1

İşlemler için laravel Omni eklentisini kullanıyorum. Ödeme yapıldıktan sonra, başarı URL'si için hata alıyorum.paypal success url error laravel

public function checkOut(Request $request) 
{ 
    $params = array(
       'cancelUrl'  => 'http://localhost/vis/public/cancel_order', 
       'returnUrl'  => 'http://localhost/vis/public/payment_success', 
       'name'  => 'Meal', 
       'description' => 'Casper', 
       'amount' => '1.00', 
       'currency' => 'USD' 
      ); 

    Session::put('params', $params); 
    Session::save(); 
    $gateway = Omnipay::create('PayPal_Express'); 
    $gateway->setUsername('un'); 
    $gateway->setPassword('pwd'); 
    $gateway->setSignature('signature'); 
    $gateway->setTestMode(true); 
    $response = $gateway->purchase($params)->send(); 

    if ($response->isSuccessful()) { 
     print_r($params); 
     redirect('payment_success/' . $this->orderNo); 
     // payment was successful: update database 
     print_r($response); 
    } elseif ($response->isRedirect()) { 

     // redirect to offsite payment gateway 
     $response->redirect(); 
    } else { 
     // payment failed: display message to customer 
     echo $response->getMessage(); 
    } 
} 

public function getSuccessPayment() 
{ 
    $gateway = Omnipay::create('PayPal_Express'); 
    $gateway->setUsername('un'); 
    $gateway->setPassword('pwd'); 
    $gateway->setSignature('signature'); 
    $gateway->setTestMode(true); 

    $params = Session::get('params'); 
    $response = $gateway->completePurchase($params)->send(); 
    $paypalResponse = $response->getData(); // this is the raw response object 

    if(isset($paypalResponse['PAYMENTINFO_0_ACK']) && $paypalResponse['PAYMENTINFO_0_ACK'] === 'Success') { 
     // Response 
     print_r($params); 
//  print_r($paypalResponse); 

    } else { 

     //Failed transaction 

    } 
// return View('result'); 
    print_r($params); 
    print_r($paypalResponse); 
} 

aşağıdaki hatayı alıyorum

Bulunamadı HTTP Hatası 404. İstenen kaynak bulunamadı. Eğer emin ismine routes.php içinde

Route::get('/payment_success', '[email protected]'); 

Değişim StoreController böyle bir şey var olun, routes.php bu rotayı eklemeyi unutmuş olabilir gibi http://localhost/vis/public/payment_success?token=EC-1R845179Asss493N&PayerID=swdw3BS9REA4AN

cevap

0

görünüyor Bu fonksiyon kontrolördedir.