2016-08-27 44 views
1

我有這樣的錯誤,我想配置貝寶laravel錯誤與netshel貝寶getCheckout functoin

FatalErrorException在Paypalel.php線32:非抽象方法 應用程序\ HTTP \控制器\ Paypalel :: getCheckout()必須包含身體

這是代碼

public function getCheckout($title,$disc,$price); 
{ 


// get the id of the product 
$payer = PayPal::Payer(); 
$payer->setPaymentMethod('paypal'); 

$amount = PayPal:: Amount(); 
$amount->setCurrency('USD'); 
$amount->setTotal($price); // This is the simple way, 
// you can alternatively describe everything in the order separately; 
// Reference the PayPal PHP REST SDK for details. 

$transaction = PayPal::Transaction(); 
$transaction->setAmount($amount); 
$transaction->setDescription($disc); 

$redirectUrls = PayPal:: RedirectUrls(); 
$redirectUrls->setReturnUrl(action('[email protected]')); 
$redirectUrls->setCancelUrl(action('[email protected]')); 

$payment = PayPal::Payment(); 
$payment->setIntent('sale'); 
$payment->setPayer($payer); 
$payment->setRedirectUrls($redirectUrls); 
$payment->setTransactions(array($transaction)); 

$response = $payment->create($this->_apiContext); 
$redirectUrl = $response->links[1]->href; 

return Redirect::to($redirectUrl); 
} 

回答

0

有一個流浪分號;

public function getCheckout($title,$disc,$price); { 
               ^

刪除

public function getCheckout($title,$disc,$price) {