PHPackages                             studio98/qb-payments-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. studio98/qb-payments-sdk

ActiveLibrary[HTTP &amp; Networking](/categories/http)

studio98/qb-payments-sdk
========================

The Official PHP SDK for QuickBooks Online Payments API

v1.0.8(5y ago)03Apache-2.0PHP

Since Jun 21Pushed 4y agoCompare

[ Source](https://github.com/studio98/PHP-Payments-SDK)[ Packagist](https://packagist.org/packages/studio98/qb-payments-sdk)[ Docs](http://developer.intuit.com)[ RSS](/packages/studio98-qb-payments-sdk/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (3)Versions (13)Used By (0)

[![Rate your SDK](views/RateSDK.png)](#)[![Yes](views/Thumbup.png)](https://customersurveys.intuit.com/jfe/form/SV_9LWgJBcyy3NAwHc?check=Yes&checkpoint=PHP-Payments-SDK&pageUrl=github)[![No](views/Thumbdown.png)](https://customersurveys.intuit.com/jfe/form/SV_9LWgJBcyy3NAwHc?check=No&checkpoint=PHP-Payments-SDK&pageUrl=github)

QuickBooks Payments PHP SDK
===========================

[](#quickbooks-payments-php-sdk)

[![Build status](https://camo.githubusercontent.com/5ceaa2ce3a190ce1aef4afc45fc49ac0d06ebcde414cbe278249df5b666a8fb2/68747470733a2f2f7472617669732d63692e636f6d2f696e747569742f5048502d5061796d656e74732d53444b2e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/5ceaa2ce3a190ce1aef4afc45fc49ac0d06ebcde414cbe278249df5b666a8fb2/68747470733a2f2f7472617669732d63692e636f6d2f696e747569742f5048502d5061796d656e74732d53444b2e7376673f6272616e63683d6d6173746572)[![Latest Stable Version](https://camo.githubusercontent.com/1bab2a1bde0b0c72847bc8ca62fcfb5ea8364169ef9d28f9baf94a5d0f1db487/68747470733a2f2f706f7365722e707567782e6f72672f717569636b626f6f6b732f7061796d656e74732d73646b2f762f737461626c65)](https://camo.githubusercontent.com/1bab2a1bde0b0c72847bc8ca62fcfb5ea8364169ef9d28f9baf94a5d0f1db487/68747470733a2f2f706f7365722e707567782e6f72672f717569636b626f6f6b732f7061796d656e74732d73646b2f762f737461626c65)

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:

- Standard OAuth 2.0 and OpenID Connect protocols
- Interceptors for logging and error handling
- Standard Payments API endpoints with requests/response handling

If you have not used the QuickBooks Payments API before, please go to our docs at:

Requirements
------------

[](#requirements)

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

Composer
--------

[](#composer)

You can install the package via [Composer](http://getcomposer.org/). Run the following command:

```
composer require studio98/qb-payments-sdk
```

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

```
composer update
```

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

```
composer require studio98/qb-payments-sdk 1.0.5
```

To use the package, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

```
require "vendor/autoload.php";
```

Manual Installation
-------------------

[](#manual-installation)

If you do not wish to use Composer, you can download the [latest release](https://github.com/studio98/qb-payments-sdk/releases). Then, to use the package, include the `config.php` file.

```
require_once('/path/to/config.php');
```

Dependencies
------------

[](#dependencies)

The following extensions are required in order to work properly:

- [`curl`](https://secure.php.net/manual/en/book.curl.php), although you can use your own non-cURL client if you prefer
- [`json`](https://secure.php.net/manual/en/book.json.php)

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
---------------

[](#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.

```
$client = new PaymentClient([
 'access_token' => "your access token",
 'environment' => "sandbox" //  or 'environment' => "production"
]);
```

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

```
