Download the PHP package gocardless/gocardless-pro without Composer

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

GoCardless Pro PHP client library

A PHP client for interacting with the GoCardless Pro API.

PHP version CircleCI

Installation

The recommended way to install gocardless-pro is using Composer.

Next, run the Composer command to install the latest stable version of gocardless-pro.

After installing, you need to require Composer's autoloader:

Initialising A Client

Create a GoCardlessPro\Client instance, providing your access token and the environment you want to use. We strongly advise storing your access token as an environment variable, rather than directly in your code. You can easily load the environment variables from a .env file by using something like phpdotenv, though keep it out of version control!

You can create an access_token from the "Developers" tab in your GoCardless dashboard.

The environment can either be \GoCardlessPro\Environment::SANDBOX or \GoCardlessPro\Environment::LIVE, depending on whether you want to use the sandbox or live API.

For full documentation, see our API docs.

GET requests

You can make a request to get a list of resources using the list method.

Note: This README will use customers throughout but each of the resources in the API is available in this library.

If you need to pass any options, the last (or only, in the absence of URL params) argument to list() is an array of URL parameters:

A call to list() returns an instance of ListResponse. You can use its records attribute to iterate through the results.

In the case where a URL parameter is needed, the method signature will contain the required arguments:

As with list, the last argument can be an options array, with any URL parameters given:

Both individual resource and ListResponse instances have an api_response attribute, which lets you access the following properties of the request:

POST/PUT Requests

For POST and PUT requests, you need to provide a body for your request by passing it in as the first argument.

As with GET requests, if any parameters are required, these come first:

The GoCardless API includes idempotency keys. The library will automatically inject these into your request when you create a resource, preventing it from getting duplicated if something goes wrong with the API (e.g. networking issues or a timeout).

You can also specify your own idempotency key - you could, for example, use IDs of records in your database, protecting yourself not only from network or API issues, but also mistakes on your side which could lead to double-creation:

If the library hits an idempotency key conflict (that is, you try to create a resource with an idempotency key you've already used), it will automatically load and return the already-existing resource.

Handling Failures

When the API returns an error, the library will return a corresponding subclass of ApiException, one of:

These types of error are covered in the API documentation.

If the error is an HTTP transport layer error (e.g. timeouts or issues within GoCardless's infrastructure), requests will automatically be retried by the library up to 3 times, with a 500ms delay between attempts, before a ApiConnectionException is raised.

If the library can't parse the response from GoCardless, it will throw a MalformedResponseException.

Properties of the exception can be accessed with the following methods:

Handling webhooks

GoCardless supports webhooks, allowing you to receive real-time notifications when things happen in your account, so you can take automatic actions in response, for example:

The client allows you to validate that a webhook you receive is genuinely from GoCardless, and to parse it into GoCardlessPro\Resources\Event objects which are easy to work with:

For more details on working with webhooks, see our "Getting started" guide.

Supporting PHP >= 8.1

This client library only supports PHP >= 8.1 Earlier releases of PHP are now considered end of life and may be exposed to security vulnerabilities.

Contributing

This client is auto-generated from Crank, a toolchain that we hope to soon open source. Issues should for now be reported on this repository.

Please do not modify the source code yourself, your changes will be overridden!


All versions of gocardless-pro with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-curl Version *
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.4
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 gocardless/gocardless-pro contains the following files

Loading the files please wait ....