Quantcast
Channel: e-conomic Global API Forum
Viewing all articles
Browse latest Browse all 2527

Make a simple CashBook entry using SOAP and PHP

$
0
0

I would like to make a simple cashbook entry everytime a purcahse is made on our platform. The entry should contain:

  • Amount
  • Account number (e.g. 5820)
  • (optionally) some text

I have found a PHP Economic SOAP library and struggled with it for some hours, to then figure out that it does not seem to be able to make a cashbook entry: https://github.com/xown/economic-soap-php-client

Can someone help me out with a snippet or something that can solve this for me? I am lost...

Update:

Soldering on, I have tried to extend the CashBookService in the Economic SOAP PHP Client (https://github.com/xown/economic-soap-php-client).

I have created a new method in the model like this:


    public function createCashBookEntry(array $parameters)
    {
        $this->client->connect();
 
        try {
            $response = $this->client->CashBookEntry_CreateFromDataArray($parameters);
 
            return $response;
        } catch (\SoapFault $e) {
            throw new EconomicException($e->getMessage());
        }
    }

And then trying to call it like this:

$economicCashbook = Economic::getCashBookService();
 

$created = $economicCashbook->createCashBookEntry([
    'dataArray' => [
        'CashBookEntryData' => [
            'Handle' => [
                'id1' => '1',
                'id2' => '2',
            ]
        ]
    ]
]);

But I have no idea if this is the right direction. Especially, I think the way I provide the input parameters is wrong. Can anybody help?

 


Viewing all articles
Browse latest Browse all 2527

Trending Articles