Giter Club home page Giter Club logo

octobat-php's People

Contributors

timodwhit avatar vojtech-dobes avatar zuuno avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

octobat-php's Issues

Uncorrected "FIXME" in Util.php is throwing an error on PHP8.1

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 :
octobat-object

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,

Missing SingletonApiResource.php

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.

Bad Request

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'
]
]
];

Item create method does not work

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 ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.