Download the PHP package weisl/hellocash-php-sdk without Composer

On this page you can find all versions of the php package weisl/hellocash-php-sdk. 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 hellocash-php-sdk

Hellocash PHP SDK

This is an unofficial PHP SDK implementation for the Hellocash API. It helps accessing the API in an object oriented way and uses Saloon as a wrapper for the API.

Requirements

Installation

Usage

Start making requests by creating a object:

Please have a look at to see how the API resources are accessible. Each Resource has an own Interface, e.g. with more detailed information about the methods and the response types.

Error Handling

Basically, the SDK differs between 2 errors:

You can see the difference in the examples below. Just note that e.g. if you pass a wrong type as parameter to the SDK, it will throw an Exception. More specifically, the SDK throws one exception named . If you can get through and make an actual request to the API, which fails because there is e.g. no invoice with the ID you passed, you will always get a response in the format of:

Example: Invoices

This example will guide you through the usage of the SDK.

all()

Every resource in the SDK provides an method, which does what you may expect: It gets all documents from the resource. This also handles pagination for you (so you don't need to handle the limit, offset, etc.).

This returns the documents directly as array, or an empty array, if there are no documents.

query()

Say you want to search for specific invoices. Some resources support parameters, e.g. . A full API request could look something like this: . Since might take a long time to fetch and is also unusable in case there are many, many documents, you can take full advantage of all the query parameters with the method.

This returns 1:1 the response from the API, so you can define the logic on your own. The SDK does some additional things for you: Validating the attributes you pass into the query function. If you pass a parameter, which is not supported by the API, the SDK will throw an with information what parameter is not valid. It also type-checks the value. When the API refers to the type number, it can either be an integer, a float or a double. The other types should be straight forward.

get()

Get one specific invoice with the method.

Since the API is not quite consistent with their error messages, the SDK does that for you. If no invoice is found with the ID you entered, the SDK provides a uniform error message, which looks like:

cancel()

Cancel takes the ID of the invoice as parameter. You can also specify the cashier in the request body. In the SDK, you simply pass an array to the cancel method:

Again, the SDK checks the parameters passed and handles type-checks for you. Interestingly, the API is not consistent with error messages (and also does not provide much information about the error). The SDK gives you the same format as with all errors:

create()

Creates an invoice.

Again, the body will be validated and type-checked (first array hierarchy only).

pdf()

Get a pdf invoice.

Contributing

If you would like to improve something, or if there are any bugs, feel free to contact me via email or create an issue.

Testing

Documentation

See the Hellocash API documentation or the Interfaces inside the directory of this package.

License

This package is licensed under MIT License.

Please note that I am not affiliated with Hellocash in any kind. All copyrights to this name, brand, etc. belong to the respective owner(s) and not me.


All versions of hellocash-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
sammyjo20/saloon Version ^1.4
illuminate/collections Version ^9.34
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 weisl/hellocash-php-sdk contains the following files

Loading the files please wait ....