Giter Site home page Giter Site logo

Comments (6)

devtronic avatar devtronic commented on August 20, 2024

Can you please provide a minimal example including your composer.json?

Psr\Log\NullLogger comes from https://github.com/php-fig/log/blob/master/src/NullLogger.php which is outside of the billbee-php-sdk scope.

You could also try to update the psr/log package in your project.

from billbee-php-sdk.

Goldfischpeter avatar Goldfischpeter commented on August 20, 2024

{
"name": "billbee/billbee-api",
"description": "The official Billbee API SDK for PHP",
"type": "library",
"require": {
"php-64bit": "^7.3 || ^8.0",
"ext-curl": "",
"ext-json": "
",
"guzzlehttp/guzzle": "^7.4.0",
"psr/log": "^1.1.0 || ^2.0.0 || ^3.0.0",
"jms/serializer": "^3.18"
},
"require-dev": {
"phpunit/phpunit": "^9.4.1",
"friendsofphp/php-cs-fixer": "^2.15",
"phpstan/phpstan": "^1.8.2"
},
"license": "MIT",
"authors": [
{
"name": "Julian Finkler",
"email": "[email protected]"
}
],
"minimum-stability": "stable",
"autoload": {
"psr-4": {
"BillbeeDe\BillbeeAPI\": "src/",
"BillbeeDe\Tests\BillbeeAPI\": "tests/"
}
},
"scripts": {
"fix-cs": [
"php-cs-fixer fix ./src/ --using-cache=no --rules=@psr2",
"php-cs-fixer fix ./tests/ --using-cache=no --rules=@psr2"
],
"analyse": "phpstan analyse"
},
"archive": {
"exclude": [
"/tests",
"/doc"
]
}
}

from billbee-php-sdk.

devtronic avatar devtronic commented on August 20, 2024

That's the composer.json of the SDK. I need a striped down version of the composer.json + the caller code to the SDK from your project. I need to reproduce the issue.

from billbee-php-sdk.

Goldfischpeter avatar Goldfischpeter commented on August 20, 2024

Did you get setup?

from billbee-php-sdk.

devtronic avatar devtronic commented on August 20, 2024

Did you get setup?

I'll take look at it today.

from billbee-php-sdk.

devtronic avatar devtronic commented on August 20, 2024

I can't reproduce the problem. I followed the steps described in the Docs and it works as expected:

git clone https://github.com/billbeeio/billbee-php-sdk.git
cd billbee-php-sdk
git checkout tags/v2.1.0
composer install --no-dev --optimize-autoloader
mkdir sdk-dist

# On Windows:
move vendor\autoload.php sdk-dist
move src sdk-dist/src
move vendor sdk-dist/vendor

# Open the sdk-dist\autoload.php and replace
# require_once __DIR__ . '/composer/autoload_real.php';
# with
# require_once __DIR__ . '/vendor/composer/autoload_real.php';

Example Script:

<?php

use BillbeeDe\BillbeeAPI\Client;
use BillbeeDe\BillbeeAPI\Response;

require_once __DIR__ . '/sdk-dist/autoload.php';

$user = 'Your Billbee username';
$apiPassword = 'Your Billbee API Password'; // https://app.billbee.io/de/settings/api
$apiKey = 'Your Billbee API Key';
 
$client = new Client($user, $apiPassword, $apiKey);
$client->enableBatchMode(); # Enable batching
 
$client->products()->getProducts(1, 1); # Adds the request to the batch pool / returns null
$client->orders()->getOrders(1, 1); # Adds the request to the batch pool / returns null
$client->events()->getEvents(1, 1); # Adds the request to the batch pool / returns null
 
$results = $client->executeBatch(); # Results contain all responses in the added order
 
/** @var Response\GetProductsResponse $productsResult */
$productsResult = $results[0];
 
/** @var Response\GetOrdersResponse $ordersResult */
$ordersResult = $results[1];
 
/** @var Response\GetEventsResponse $eventsResult */
$eventsResult = $results[2];

from billbee-php-sdk.

Related Issues (20)

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.