PHPackages                             ryuske/wepay-laravel - 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. [API Development](/categories/api)
4. /
5. ryuske/wepay-laravel

ActiveLibrary[API Development](/categories/api)

ryuske/wepay-laravel
====================

WePay API wrapper for Laravel 4

2481[1 issues](https://github.com/Ryuske/wepay-laravel/issues)PHP

Since Aug 31Pushed 10y ago2 watchersCompare

[ Source](https://github.com/Ryuske/wepay-laravel)[ Packagist](https://packagist.org/packages/ryuske/wepay-laravel)[ RSS](/packages/ryuske-wepay-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Wepay Wrapper For Laravel 4
---------------------------

[](#wepay-wrapper-for-laravel-4)

This wrapper allows you to use the WePay API within Laravel using the standard Facade structure. If you would like more information on wepay, please checkout

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

[](#installation)

First you need edit your `composer.json` file with the following:

```
"require-dev": {
    "ryuske/wepay-laravel": "dev-master",
    "wepay/PHP-SDK": "*"
}
```

And then run `composer install`.

Once that has finished, you need to edit 2 sections of your `app/config/app.php` configuration file. The first section is the providers array, like so:

```
'providers' => array(
    // ...

    'Ryuske\WepayLaravel\WepayLaravelServiceProvider'
)
```

The 2nd section is within the aliases array, like this:

```
'aliases' => array(
    // ...

    'WepayWrapper'    => 'Ryuske\WepayLaravel\Facades\WepayLaravel'
)
```

You just finished the installation of the Wrapper! Whoo! But... Now we have to configure it.

Configuration
-------------

[](#configuration)

First, run the command `php artisan config:publish ryuske/wepay-laravel`

Once you've run that command, open up the file `app/config/packages/ryuske/wepay-laravel/config.php`

Now, primarily what you need to change in this file are the production values for `client_id`, `client_secret`, `access_token` and `account_id`.

If you don't have a development environment setup, then set `useStaging = false` otherwise, file in the values for the staging array as well.

After those configuration values are set, you're ready to go.

Code Example
------------

[](#code-example)

```
// This is the route where you would POST a form to
Route::post('/checkout', function() {
    $reference_id = 89678578; // This is some randomly generate ID for your records

    // On most API calls, the first parameter needs to be the access token of the person relieving money, the 2nd is the endpoint as per the WePay API docs and lastly the parameters for the API call as per the docs.
    $response = WepayWrapper::request($user->wepay_token, '/credit_card/create', [
        'client_id' 		=> WepayWrapper::get('client_id'),
        'cc_number' 		=> Input::get('cc_number'),
        'cvv' 				=> Input::get('cvv'),
        'expiration_month' 	=> Input::get('expiration_month'),
        'expiration_year' 	=> Input::get('expiration_year'),
        'user_name' 		=> Input::get('name'),
        'email' 			=> Input::get('email'),
        'address' 			=> [
            'zip' 		=> Input::get('zip'),
            'country' 	=> Input::get('country')
        ]
    ]);

    WepayWrapper::request($user->wepay_token, '/credit_card/authorize', [
        'client_id' 		=> WepayWrapper::get('client_id'),
        'client_secret'		=> WepayWrapper::get('client_secret'),
        'credit_card_id'	=> $response->credit_card_id
    ]);

    WepayWrapper::request($user->wepay_token, '/checkout/create', [
        'account_id' 			=> $user->wepay_id, // This is the account id for whoever is recieving money
        'amount' 				=> Input::get('amount'),
        'currency' 				=> 'USD',
        'short_description' 	=> '',
        'type'					=> 'GOODS',
        'long_description'		=> 'Purchase for , ',
        'reference_id'			=> $reference_id,
        'fallback_uri' 			=> action('CheckoutController@error'),
        'redirect_uri' 			=> action('ProductsController@show', ['id' => '']),
        'funding_sources' 		=> 'cc',
        'payment_method_id' 	=> $response->credit_card_id,
        'payment_method_type' 	=> 'credit_card'
    ]);

    $response = WepayWrapper::request($user->wepay_token, '/checkout/find', [
        'account_id' 			=> $user->wepay_id, // Again, this is the account id for whoever recieved the money
        'reference_id'			=> $reference_id,
    ]);

    // Here you would use the response to store values into the database or however you want to keep track of money that has been processed.
    return $response;
});
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/89f7ba7d80b2fdf8d5ae47bf71c1cdbc348f660910810aeff5a15f587e0106f6?d=identicon)[Ryuske](/maintainers/Ryuske)

### Embed Badge

![Health badge](/badges/ryuske-wepay-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/ryuske-wepay-laravel/health.svg)](https://phpackages.com/packages/ryuske-wepay-laravel)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
