Download the PHP package hugomarques62/juno-sdk-php-laravel without Composer

On this page you can find all versions of the php package hugomarques62/juno-sdk-php-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package juno-sdk-php-laravel

juno-sdk-php-laravel

Make sure to add JUNO_PRIVATE_TOKEN, JUNO_CLIENT_ID and JUNO_CLIENT_SECRET to your .env file to identify your account in every request.

JUNO_PRIVATE_TOKEN is also referred as X-Resource-Token in the docs.

Installing

Using Composer:

Publishing configurations

The command below will publish the configuration file to Laravel's config folder.

Config file

Usage

Import the API namespace and use it with:

Where $requestObject MUST be an instance of the Request class.

Every class inside the Jetimob\Juno\Lib\Http namespace implements Request.\ $response will always return an instance of Response.

$resourceToken is required to make sure that the request is being made to the right endpoint with the right credentials.

Simple requests as DocumentListRequest can be made passing the class the request function:

Complex objects MUST be manually configured, as:

Response

Every request made with the API will return an instance of the Response object.\ All objects that implement Request have they own Response object. i.e.: ChargeConsultRequest has its ChargeConsultResponse.\ If an error occurs during the request (a non 200 code), the returned object will be an instance of ErrorResponse.

Errors

When a request is made, several problems can arise, so to prevent this from happening, wrap the request call with a try/catch block.\ Every Juno exception is a child of JunoException so all exceptions that can arise during a request can be handled within a single try block.

Access Token caching

The authorization token (access token) is cached to Laravel's default Cache facade, make sure to have it correctly configured.

If you change the environment from production to sandbox or vice-versa, you MUST clear the cache with: php artisan juno:clear-cache. Otherwise, the cached access token will be used and you'll receive a 401 error.

Creating a custom request

If you need to make a custom request to Juno's API, you'll need to create two classes, the Request and the Response.\ Let's imagine that we need to make a request to docs endpoint.\ We'll need to create DocsCustomRequest and DocsCustomResponse as exemplified:

DocsCustomRequest.php

OddResponseObject.php

DocsCustomResponse.php

usage:

For more information about Juno's API, see the docs here and here (detailed PDF).


All versions of juno-sdk-php-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4
guzzlehttp/guzzle Version ^7.2
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hugomarques62/juno-sdk-php-laravel contains the following files

Loading the files please wait ....