0

I'm just starting to implement PayPal's PHP API into a website I'm building and I'm coming across an error. Whenever I include any of there php my page just dies with errors all resembling this

Fatal error: Class 'PayPal\Common\PPModel' not found in /xxx/xxx/public_html/xxx/libs/PayPal/Api/Amount.php on line 6  

The start of Amount.php is this

<?php
namespace PayPal\Api;

use PayPal\Common\PPModel;

class Amount extends PPModel { //This is line number 6

What do the namespace and use commands do? I don't have a PayPal/Common/PPModel file anywhere, should I have one?

TMH
  • 6,096
  • 7
  • 51
  • 88

2 Answers2

1

I can't help you with the Paypal API, but you can read about namespace and use.

Community
  • 1
  • 1
Скач от
  • 212
  • 2
  • 14
1

It appears you have not included class PayPal\Common\PPModel manually, or your __autoload function doesn't supports namespaces properly (at least Paypal namespace) Whether you are using any framework?

Mihail
  • 1,543
  • 1
  • 10
  • 6