Esraa Osama Esraa Osama - 1 year ago 89
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 );

Answer Source

There's a stray semicolon ;

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

Remove that

public function getCheckout($title,$disc,$price) {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download