0ctobat / octobat-php Goto Github PK
View Code? Open in Web Editor NEWOctobat API bindings for PHP
License: MIT License
Octobat API bindings for PHP
License: MIT License
Hello,
We're using PHP library with Symfony.
We noticed that your library was throwing an error when upgrading from PHP7 to PHP8.1.
Indeed, on the return of our API, you're library seems to be converting Octobat objects as array by calling the method "convertOctobatObjectToArray" from the file "/lib/Util.php".
However, you let a line commented with "FIXME" on line 45 followed by these lines of codes :
// FIXME: this is an encapsulation violation
if ($k[0] == '_') {
continue;
}
that are throwing the exception in our code.
To help you understand the bug, we've got an Octobat object such as follow :
And you're recursively parsing this object to array. However when reaching tax_details, $k will be 0 and hence, 0[0] can't be understood and is throwing the following exception:
Warning: Trying to access array offset on value of type int
In our case it seems that commenting those 3 lines is resolving the problem but maybe that this code is necessary and just need to be corrected.
Could you please correct this fixme that has been forgotten in your code or at least inform us of when you're planning to do it.
Thank you in advance,
Downloading https://github.com/0ctobat/octobat-php/archive/2.0.2.zip
and integrating without using Composer fails with the error:
require(): Failed opening required 'some-path/octobat/lib/SingletonApiResource.php'
SingletonApiResource.php
does not appear to exists in the repo or source archive.
Version: 2.1.0
\Octobat\Plaza\Account::create([
'settings' => [
'tax' => [
'default_product_type' => 'NOT_VALID_VALUE',
]
]
]);
results in ErrorException
thrown with message Array to string conversion
in file vendor/0ctobat/octobat-php/lib/Error/InvalidRequest.php:48
.
I m trying \Octobat\Plaza\Account::create(
$accountData
);
I m getting "Bad Request" all the time, no matter what I fix.
I already fixed phone number format and country as required by api.
$accountData = [
'type' => 'custom',
'email' => $email,
'country' => $ISO3166,
'requested_capabilities' => ['tax','invoicing'],
'business_type' => 'company',
'company' => [
'name' => $societe->getRaisonSociale(),
'address' => [
'city' => $adresse->getVille(),
'country' => $ISO3166,
'line1' => $line,
'line2' => null,
'zip' => $adresse->getCodePostal(),
'state' => null
],
'phone_number' => $telephone,
'legal' => [
'registration_id' => $societe->getSiret(),
'registry_office' => $adresseSiegeSocial,
'capital' => $capital
]
],
"individual"=> [],
'settings' => [
'tax' => [
"collection"=> true,
'default_product_type' => 'standard',
'exemption_due_to_threshold' => false,
'vat_moss_registration' => false
],
'invoicing' => [
'mandate' => 'standard'
]
]
];
Hello,
I'll try to use your package for PHP and it's not possible to create an item with Item::create() method.
The result is a 404 error from server. This error is caused by the url that was called by the create method (/item) instead of /invoices/{id}/item.
Can you please made a correction ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.