PHPackages                             smartpay-co/sdk-php - 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. smartpay-co/sdk-php

ActiveLibrary[API Development](/categories/api)

smartpay-co/sdk-php
===================

The Smartpay PHP SDK offers easy access to Smartpay API from applications written in PHP.

v0.8.0(2y ago)38.1k11MITPHPPHP &gt;= 5.6

Since Nov 13Pushed 2y ago3 watchersCompare

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

READMEChangelog (5)Dependencies (8)Versions (18)Used By (1)

[![Contributors](https://camo.githubusercontent.com/a479fbc2f4bca7f3bb39cf01732e662cf8d56f50b2e8def6447e9d3dfac8feca/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f736d6172747061792d636f2f73646b2d7068702e737667)](https://github.com/smartpay-co/sdk-php/graphs/contributors)[![Forks](https://camo.githubusercontent.com/a8c17d57c43004556e9161bebfa374222ee7e6efc6fb25fee51ca930ca921a24/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f736d6172747061792d636f2f73646b2d7068702e737667)](https://github.com/smartpay-co/sdk-php/network/members)[![Stargazers](https://camo.githubusercontent.com/964fca0a9164d8ffab325b0206883f246c86471df160fde50de61ced459af532/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f736d6172747061792d636f2f73646b2d7068702e737667)](https://github.com/smartpay-co/sdk-php/stargazers)[![Issues](https://camo.githubusercontent.com/9ca8aaeca80d395e1c64e0db456699b012ef02e05fc34ea0aaadd430f4d9e5e3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f736d6172747061792d636f2f73646b2d7068702e737667)](https://github.com/smartpay-co/sdk-php/issues)[![Packagist](https://camo.githubusercontent.com/7a220d730f7ea3cfffce7f13936962cc16e95e94c196ce97f1e5cb7688fc1b0c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736d6172747061792d636f2f73646b2d7068702e737667)](https://packagist.org/packages/smartpay-co/sdk-php)[![PHP Version](https://camo.githubusercontent.com/01b427c89af95d728e92e8b39ae6d302859b7026ca053137e2a132b6cd9d900b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736d6172747061792d636f2f73646b2d7068702e7376673f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/smartpay-co/sdk-php)[![MIT License](https://camo.githubusercontent.com/a920ad77c3d1de2a5a3c1bc9d67009818ad20a44ed0994dfa5c9b1e9366a5419/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736d6172747061792d636f2f73646b2d7068702e737667)](https://github.com/smartpay-co/sdk-php/blob/main/LICENSE)[![Workflow](https://github.com/smartpay-co/sdk-php/actions/workflows/master.yml/badge.svg)](https://github.com/smartpay-co/sdk-php/actions/workflows/master.yml)

 [    ![Smartpay](https://camo.githubusercontent.com/2f520b6bac7a9dafd425c659e4ea2b6f01c5560aed034f535f2cef933915f326/68747470733a2f2f6173736574732e736d6172747061792e636f2f6c6f676f2f62616e6e65722f736d6172747061792d6c6f676f2e706e67)  ](https://github.com/smartpay-co/sdk-php) [**Explore the docs »**](https://docs.smartpay.co/)

 [Report Bug](https://github.com/smartpay-co/sdk-php/issues) · [Request Feature](https://github.com/smartpay-co/sdk-php/issues)

Smartpay PHP Library
====================

[](#smartpay-php-library)

The Smartpay PHP library offers easy access to Smartpay API from applications written in PHP.

Documentation
-------------

[](#documentation)

- [Payment Flow](https://docs.smartpay.co/#payment_flow)
- [API Document](https://api-doc.smartpay.co)

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

[](#requirements)

- PHP 5.6+
- Smartpay `API keys & secrets`. You can find your credential at the `settings > credentials` page on your [dashboard](https://dashboard.smartpay.co/settings/credentials).

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

[](#installation)

#### Install Composer

[](#install-composer)

[Composer](https://getcomposer.org/) is a dependency manager for PHP projects.

Download Composer from their website:

If you are using macos to develop with [homebrew](https://docs.brew.sh/), you can use the command to install Composer:

```
brew install composer
```

#### Install package to your repository:

[](#install-package-to-your-repository)

```
composer install smartpay-co/sdk-php
```

Usage
-----

[](#usage)

The package needs to be configured with your own API keys, you can find them on your dashboard.

```
$api = new \Smartpay\Api('', '')
```

### Create Checkout session

[](#create-checkout-session)

You can find the description and requirement for request payload in [API Document](https://api-doc.smartpay.co/#8a3538b1-530c-448c-8bae-4a41cdf0b8fd).

```
$payload = [
  'items' => [
    [
      'name' => 'オリジナルス STAN SMITH',
      'amount' => 1000,
      'currency' => 'JPY',
      'quantity' => 1,
    ],
    [
      'currency' => 'JPY',
      'amount' => 500,
      'name' => 'Merchant special discount',
      'kind' => 'discount'
    ],
    [
      'currency' => 'JPY',
      'amount' => 100,
      'name' => 'explicit taxes',
      'kind' => 'tax'
    ]
  ],
  'customerInfo' => [
    'accountAge' => 20,
    'email' => 'merchant-support@smartpay.co',
    'firstName' => '田中',
    'lastName' => '太郎',
    'firstNameKana' => 'たなか',
    'lastNameKana' => 'たろう',
    'address' => [
      'line1' => '北青山 3-6-7',
      'line2' => '青山パラシオタワー 11階',
      'subLocality' => '',
      'locality' => '港区',
      'administrativeArea' => '東京都',
      'postalCode' => '107-0061',
      'country' => 'JP',
    ],
    'dateOfBirth' => '1985-06-30',
    'gender' => 'male',
  ],
  'shippingInfo' => [
    'line1' => '北青山 3-6-7',
    'line2' => '青山パラシオタワー 11階',
    'subLocality' => '',
    'locality' => '港区',
    'administrativeArea' => '東京都',
    'postalCode' => '107-0061',
    'country' => 'JP',
  ],
  'reference' => 'order_ref_1234567',
  'successUrl' => 'https://docs.smartpay.co/example-pages/checkout-successful',
  'cancelUrl' => 'https://docs.smartpay.co/example-pages/checkout-canceled'
];
```

Create a checkout session by using `checkoutSession` method with your request payload.

```
$session = $api->checkoutSession($payload);
```

Then, you can redirect your customer to the session url by calling `redirectUrl` method:

```
$session->redirectUrl()
```

Test
----

[](#test)

Install dependencies

```
composer i
```

Run test in the folder

```
./vendor/bin/phpunit tests
```

License
-------

[](#license)

The package is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 56.1% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~51 days

Recently: every ~113 days

Total

16

Last Release

883d ago

PHP version history (2 changes)v0.0.1PHP &gt;= 7.0

v0.1.0PHP &gt;= 5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/cbcea5114b9a7a5b62bd5a1e44110ff94d207701a139e1291c52ab887016542e?d=identicon)[carawangtw](/maintainers/carawangtw)

![](https://www.gravatar.com/avatar/5f2565f2a0b46ab8aefe66802c2ae6eb54865bc8fa840a0c2814766bc8583420?d=identicon)[othree](/maintainers/othree)

![](https://www.gravatar.com/avatar/380b418958ac13db31b318f1af1af899b49a83505da2082dda117efcfc597dc9?d=identicon)[linmic](/maintainers/linmic)

![](https://www.gravatar.com/avatar/3d503bfc94b2ddfa3ccca8826a92e484ddb885a2a1a7495a1296784f696b3cd1?d=identicon)[hSATAC](/maintainers/hSATAC)

---

Top Contributors

[![hSATAC](https://avatars.githubusercontent.com/u/88208?v=4)](https://github.com/hSATAC "hSATAC (46 commits)")[![othree](https://avatars.githubusercontent.com/u/16474?v=4)](https://github.com/othree "othree (25 commits)")[![carawangtw](https://avatars.githubusercontent.com/u/92106570?v=4)](https://github.com/carawangtw "carawangtw (10 commits)")[![arussel](https://avatars.githubusercontent.com/u/1053342?v=4)](https://github.com/arussel "arussel (1 commits)")

---

Tags

phpsmartpaysmartpay-sdksmartpay

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/smartpay-co-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/smartpay-co-sdk-php/health.svg)](https://phpackages.com/packages/smartpay-co-sdk-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[moe-mizrak/laravel-openrouter

Laravel package for OpenRouter (A unified interface for LLMs)

153107.2k2](/packages/moe-mizrak-laravel-openrouter)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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