Download the PHP package quickbooks/payments-sdk without Composer

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

QuickBooks Payments PHP SDK

Build status Latest Stable Version

This SDK is designed to facilitate developers using the QuickBooks Payments API by providing a set of methods that make it easier to work with. It supports the following operations:

If you have not used the QuickBooks Payments API before, please go to our docs at: https://developer.intuit.com/app/developer/qbpayments/docs/get-started

Requirements

  1. PHP 7.2.0 and later.
  2. App for QuickBooks Online Payments API.

Composer

You can install the package via Composer. Run the following command:

If you encounter a problem during composer installation, try to update composer first:

and see if specifying a version resolves the issue, example:

To use the package, use Composer's autoload:

Manual Installation

If you do not wish to use Composer, you can download the latest release. Then, to use the package, include the config.php file.

Dependencies

The following extensions are required in order to work properly:

If you specify the Guzzle client, then Guzzle is also required.

If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.

Getting Started

To begin using the Payments SDK, the first step is to create the PaymentClient. The minimum required properties are access_token and environment. The access_token is the OAuth 2.0 token to access the API, the environment is defining the base url for the API endpoint. This can be either sandbox or production. If you do not provide these two properties, the PaymentClient will still be created, however, it will not be able to make any Payments API calls.

Once the Payment Client is created, you can start making API calls to the Payments API endpoints. Simple usage looks like:

If the request is made successfully, then the getBody() function will return the casted object. The above example will return the following $responseCharge object from $response->getBody():

Each casted object will have the same property names as stated in our API reference: https://developer.intuit.com/app/developer/qbpayments/docs/api/resources/all-entities/charges page,

A call could fail for reasons such as an expired token, server outrage, or invalid request body. You can check this by using $response->failed(). Check with our Response Interface for a list of supported operations to diagnose a failed request.

OAuth support

Developers can use this library to handle the OAuth 2.0 protocol. It supports:

In order to use OAuth 2.0, developers will need to create two objects

The Payments SDK does not provide any parsing support for parsing the OAuth 2.0 response. Since the response for OAuth 2.0 requests are always in JSON format, a simple json_decode($response->getBody(), true) will work.

Example:

Operations

The PHP Payments SDK supports all six Payments endpoints: BankAccounts, Cards, Charges, EChecks, Tokens, Transactions. These can be found in our QuickBooks Payments API Explorer.

To construct the body for each API endpoint, developers will need to first construct the body of the request in array format, then use the Operations's buildFrom method to convert the array to an object.

For example, to convert an array representation of a card to a $card object, use:

All supported operations are availble here: Operations

Once the object is created, you can use it to send the request. The function names of all the endpoints are derived from the API reference. For example, to create a card, you should use:

If you want to provide a custom Request-Id for the request, use:

otherwise, a system generated random request ID will be provided.

To check a list of available functions, refer here: API endpoints operations

Interceptors

Interceptors are used to intercept requests and responses. It can be used to log a request or response. This can be used as a retry mechanism for issues such as connection timeouts or token expirations.

The default interceptors provided in this SDK are:

Based on the need, you can define your own interceptors to intercept requests and responses by inheriting the InterceptorInterface:

In order to add an interceptor to the client, use:

To delete an interceptor by its name, use:

Example: To enable file storage for each acutal request and response sent by the SDK:

To enable logging of each transaction sent by the SDK:

Error Handling

By default, each $response object has a failed() method to determine if a request was made successfully. A successful request is defined by having a status code of 200/201. Any other status code will cause the $response->failed() method to return true. If a request failed, you can use our supported diagnose function to find out more information.

Questions

If you find any bugs for the SDK, or want to request for a feature, create a support ticket at https://help.developer.intuit.com/s/ or send us a pull request. Contributions are always welcomed!


All versions of payments-sdk with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.3
psr/log Version ^1.0.1
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 quickbooks/payments-sdk contains the following files

Loading the files please wait ....