picqer / moneybird-php-client

PHP Client for Moneybird V2
MIT License
82 stars 77 forks source link

Fatal error: Class 'Picqer\Financials\Moneybird\Connection' not found in #45

Closed ScreamerHS closed 8 years ago

ScreamerHS commented 8 years ago

Hello,

I tried the lastest version but for some reason I can't connect. It's giving me this error all the time

Fatal error: Class 'Picqer\Financials\Moneybird\Connection' not found in /......

Seems its hanging somewhere on:

`require DIR . '/autoload.php';

$connection = new \Picqer\Financials\Moneybird\Connection(); `

If i look in the folder, I see this: Picqer/Financials/Moneybird/Connection.php (file, not folder Connection)

I have autoload.php listed in the same folder as my test file.

What do i do wrong? Hope someone can help me out, trying for over 2 weeks now to get it working right.

Marco

casperbakker commented 8 years ago

The last item should be the file, not a folder, so the inclusion part is right.

Did you install it via composer? Otherwise you do not have a autoload.php file. Or the autoload file is included from the wrong location. What is the location of your file you try to run? And what is te location of your autoload.php file and vendor directory?

ScreamerHS commented 8 years ago

I think i get something to work. Its creating a new contact inside my moneybird account now using the following code:

$contact = $moneybird->contact();

$contact->company_name = ''; $contact->firstname = 'Test'; $contact->lastname = 'Account'; $contact->email = 'info@domain.com'; $contact->save(); var_dump($contact); // Contact object (as saved in Moneybird)

but what code do i use to create a new payment that is automaticly marked as paid? I can't seem to find this anywhere.

casperbakker commented 8 years ago

Good to here that you got it working.

Most of the things that are possible with the API are possible with this client. You should look up in the Moneybird API docs how you can create a payment and mark it as paid. Ones you know that, it should be easy to figure out how to do that with this client.