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

ActiveLibrary[Payment Processing](/categories/payments)

smart2pay/sdk-php
=================

Smart2Pay SDK - enable payments on your site easily 200+ methods, 80+ countries

3.0.12(8mo ago)520.6k↓50%31MITPHPPHP &gt;=5.3.3

Since Mar 27Pushed 1mo ago5 watchersCompare

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

READMEChangelog (10)DependenciesVersions (45)Used By (1)

Smart2Pay SDK
=============

[](#smart2pay-sdk)

**NB**: If you installed our SDK using composer, please read the note at the end of the file.

For quick information about available SDK methods and functionalities, please open `{SDK directory}/play.php` script in a browser (requires a web server).

For live demo of methods and functionalities available in current version of SDK, please open `{SDK directory}/demo.php` script in a browser (requires a web server).

Please note that in order to test a full end-to-end transaction you will require a valid Smart2Pay test account which you can obtain at . After you registered a test account, use API Key and Site ID found at *Technical Integration* &gt; *Integration Roadmap* &gt; *Integration Site* and configure your SDK by copying `config.dist.php` to `config.php` and fill in `S2P_SDK_SITE_ID`, `S2P_SDK_API_KEY` and `S2P_SDK_ENVIRONMENT` constants.

#### Creating your test merchant account

[](#creating-your-test-merchant-account)

1. Go to  and complete the form. Make sure you tick the checkbox *REST API interface* to let system know you will integrate SDK solution. If you will also use any e-commerce plugins specify this by ticking plugins checkbox.
2. Log into your account and go to *Technical Integration* &gt; *Integration Roadmap* &gt; *Integration Site*.
3. You should use Site ID and API Ke
4. y found on that page to fill constants in `config.php` of your test SDK environment.

#### Configuring your SDK

[](#configuring-your-sdk)

1. Copy `config.dist.php` file located in root directory of your SDK to `config.php` and edit the file.
2. Paste Site ID (from *Technical Integration* &gt; *Integration Roadmap* &gt; *Integration Site*) in constant definition `S2P_SDK_SITE_ID` like below:

    ```
        if( !defined( 'S2P_SDK_SITE_ID' ) )
            define( 'S2P_SDK_SITE_ID', 'SiteID_of_your_Integration_Site' );
    ```
3. Paste API Key (from *Technical Integration* &gt; *Integration Roadmap* &gt; *Integration Site*) in constant definition `S2P_SDK_API_KEY` like below:

    ```
        if( !defined( 'S2P_SDK_API_KEY' ) )
            define( 'S2P_SDK_API_KEY', 'APIKey_of_your_Integration_Site' );
    ```
4. Configure environment to test:

    ```
        if( !defined( 'S2P_SDK_ENVIRONMENT' ) )
            define( 'S2P_SDK_ENVIRONMENT', 'test' ); // live or test
    ```
5. When environment is set to custom, you can provide a custom REST API base URL (used for debugging purposes). In production leave this empty:

    ```
        if( !defined( 'S2P_SDK_CUSTOM_BASE_URL' ) )
            define( 'S2P_SDK_CUSTOM_BASE_URL', '' );
    ```
6. Setup return URL. This URL is the location where end-user will be redirected after a transaction finishes (successful or not):

    ```
        if( !defined( 'S2P_SDK_PAYMENT_RETURN_URL' ) )
            define( 'S2P_SDK_PAYMENT_RETURN_URL', 'https://www.myshop.com/sdk/samples/_return.php' );
    ```

Once all above steps are completed you can test a full end-to-end transaction and check log files generated.

`demo.php` script will generate logs when redirected back to return page in `log_return.log` and also for notifications in `log_demo.log`. Please make sure PHP has rights to create and write in these files located in root of SDK directory. If PHP doesn't have creation rights on SDK directory create these two log files first and give PHP write rights on them.

For quick samples on how you should implement SDK methods and functionalities please check `samples` directory.

#### Composer installs note

[](#composer-installs-note)

If you installed our SDK using composer and you don't want to create a custom `config.php` file, you will have to define `S2P_SDK_SITE_ID`, `S2P_SDK_API_KEY` and `S2P_SDK_ENVIRONMENT` constants in SDK wrapper script. Please check files in `samples` directory.

There were reports about composer deleting `config.php` file in SDK root dir when updating the SDK. To overcome this, you can define `S2P_SDK_CONFIG_PATH` constant in your wrapper script which contains directory where `config.php` file resides in your project.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance76

Regular maintenance activity

Popularity31

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 96% 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 ~65 days

Recently: every ~311 days

Total

40

Last Release

257d ago

Major Versions

2.1.32 → 3.0.02020-05-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/576c273e090053014999356a4f7040c3d1d0a8554e9e13482b78c5196908aaee?d=identicon)[andys2p](/maintainers/andys2p)

![](https://www.gravatar.com/avatar/83a517c5e2d0d3dcff227070f07190affc323023067dc75ba5e3b89fb7e9ac50?d=identicon)[smart2pay](/maintainers/smart2pay)

---

Top Contributors

[![andys2p](https://avatars.githubusercontent.com/u/11207827?v=4)](https://github.com/andys2p "andys2p (168 commits)")[![bogdan-lucaci](https://avatars.githubusercontent.com/u/11348627?v=4)](https://github.com/bogdan-lucaci "bogdan-lucaci (6 commits)")[![s2pstefan](https://avatars.githubusercontent.com/u/8901440?v=4)](https://github.com/s2pstefan "s2pstefan (1 commits)")

---

Tags

sdkpaymentsalternative paymentsSmart2Pay

### Embed Badge

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

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

###  Alternatives

[litle/payments-sdk

The Vantiv eCommerce PHP SDK is a PHP implementation of the \[Vantiv eCommerce\](https://developer.vantiv.com/community/ecommerce). XML API. This SDK was created to make it as easy as possible to connect process your payments with Vantiv eCommerce

19139.3k1](/packages/litle-payments-sdk)[tatter/stripe

Stripe SDK integration for CodeIgniter 4

115.3k](/packages/tatter-stripe)

PHPackages © 2026

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