PHPackages                             wepay/php-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. [Payment Processing](/categories/payments)
4. /
5. wepay/php-sdk

ActiveLibrary[Payment Processing](/categories/payments)

wepay/php-sdk
=============

WePay APIv2 SDK for PHP

0.3.1(9y ago)56426.3k↑12.6%44[4 issues](https://github.com/wepay/PHP-SDK/issues)[1 PRs](https://github.com/wepay/PHP-SDK/pulls)1Apache-2.0PHPPHP &gt;=5.3.0

Since Apr 20Pushed 2y ago39 watchersCompare

[ Source](https://github.com/wepay/PHP-SDK)[ Packagist](https://packagist.org/packages/wepay/php-sdk)[ RSS](/packages/wepay-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (6)Used By (1)

WePay SDK for PHP
=================

[](#wepay-sdk-for-php)

WePay's API allows you to easily add payments into your application.

For full documentation, see [WePay's developer documentation](https://www.wepay.com/developer)

Installation
------------

[](#installation)

Using [Composer](http://getcomposer.org):

```
composer require wepay/php-sdk=^0.3
```

And include it in your scripts:

```
require_once 'vendor/autoload.php';
```

Usage
-----

[](#usage)

In addition to the samples below, we have included a very basic demo application in the `demoapp` directory. See its README file for additional information.

### Configuration

[](#configuration)

For all requests, you must initialize the SDK with your Client ID and Client Secret, into either Staging or Production mode. All API calls made against WePay's staging environment mirror production in functionality, but do not actually move money. This allows you to develop your application and test the checkout experience from the perspective of your users without spending any money on payments. Our [full documentation](https://www.wepay.com/developer) contains additional information on test account numbers you can use in addition to "magic" amounts you can use to trigger payment failures and reversals (helpful for testing IPNs).

**Note:** Staging and Production are two completely independent environments and share NO data with each other. This means that in order to use staging, you must register at [stage.wepay.com](https://stage.wepay.com/developer) and get a set of API keys for your Staging application, and must do the same on Production when you are ready to go live. API keys and access tokens granted on stage *can not* be used on Production, and vice-versa.

```
