Esraa Osama Esraa Osama - 7 months ago 36
PHP Question

Error with getCheckout functoin in netshel paypal

I have this error while I am trying to configure paypal with laravel

FatalErrorException in Paypalel.php line 32: Non-abstract method
App\Http\Controllers\Paypalel::getCheckout() must contain body

This is the code

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

// get the id of the product
$payer = PayPal::Payer();

$amount = PayPal:: Amount();
$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();

$redirectUrls = PayPal:: RedirectUrls();

$payment = PayPal::Payment();

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

return Redirect::to( $redirectUrl );


There's a stray semicolon ;

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

Remove that

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