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

ActiveLibrary[API Development](/categories/api)

sbpay/sdk
=========

SBPay.me PHP Library

0.1.3(2y ago)1637—0%1MITPHPPHP &gt;=8.1.0

Since Jun 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/dimkasb/sbpay-sdk)[ Packagist](https://packagist.org/packages/sbpay/sdk)[ Docs](https://sbpay.me/)[ RSS](/packages/sbpay-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (6)Used By (0)

SBPay.me PHP SDK
================

[](#sbpayme-php-sdk)

[![Build Status](https://github.com/dimkasb/sbpay-sdk/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/dimkasb/sbpay-sdk/actions?query=branch%3Amain)[![Latest Stable Version](https://camo.githubusercontent.com/c047b3c80aff45461c42dd086ab1fea4858454486546348b08be8d51c89dcd85/68747470733a2f2f706f7365722e707567782e6f72672f73627061792f73646b2f762f737461626c652e737667)](https://packagist.org/packages/sbpay/sdk)[![Total Downloads](https://camo.githubusercontent.com/0cd86c5385370a659373ca50ef4a220e9a892ea992a10c121d64e085ea76a20c/68747470733a2f2f706f7365722e707567782e6f72672f73627061792f73646b2f646f776e6c6f6164732e737667)](https://packagist.org/packages/sbpay/sdk)[![License](https://camo.githubusercontent.com/c52f703e14c0ac022f0434dd6d1ba754d0797a8d8cb4fff27e6e87aed5910dae/68747470733a2f2f706f7365722e707567782e6f72672f73627061792f73646b2f6c6963656e73652e737667)](https://packagist.org/packages/sbpay/sdk)[![PHP Version Require](https://camo.githubusercontent.com/88f7dc4b27199c131164259f7bb6916e49fefb14cc8fd6d3cee89ef382044067/687474703a2f2f706f7365722e707567782e6f72672f73627061792f73646b2f726571756972652f706870)](https://packagist.org/packages/sbpay/sdk)

The SBPay.me PHP library provides convenient access to the SBPay.me API from applications written in the PHP language.

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

[](#requirements)

PHP 8.1.0 and later.

Composer
--------

[](#composer)

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

```
composer require sbpay/sdk
```

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

[](#dependencies)

The bindings require the following extensions 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
- [`guzzlehttp/guzzle`](https://packagist.org/packages/guzzlehttp/guzzle), although you can use your own РЕЕЗ client if you prefer

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)

Simple usage looks like:

```
$client = new \SBPay\SBPayClient(SBPAY_TOKEN, SBPAY_SECRET ,SBPAY_MERCHANT, SBPAY_HOST);
$order = $client->payments()->getOrder($orderId);
```

Reference
---------

[](#reference)

### Payments

[](#payments)

To access payments API methods, get `payments` object from `SBPayClient` object:

```
$payments = $client->payments();
```

Available methods:

MethodDescriptiongetOrderReturns order details by Order IDapproveOrderApprove payment order.
Pass $paymentMethodReferenceId and $paymentMethodName to save payment method for future use (recurring payments or rebilling)refundOrderRefund payment ordervalidateCustomPaymentProcessorRequestValidate custom payment processor request. (Required for implementing custom payment processor)### Subscriptions

[](#subscriptions)

To access subscriptions API methods, get `subscriptions` object from `SBPayClient` object:

```
$subscriptions = $client->subscriptions();
```

Available methods:

MethodDescriptiongetCustomerSubscriptionsReturns customer subscriptions list by Customer reference ID### Custom payment processor callbacks

[](#custom-payment-processor-callbacks)

Using SBPay.me, you have the flexibility to integrate a personalized payment processor. Whenever SBPay needs to initiate a specific action, it will trigger a callback to the URL you have designated. You can configure these callback URLs within your SBPay.me account settings.

Here is a list of the callback URLs you can configure:

- Payment form URL. You will receive POST request from browser with following data:

Parameter nameDescriptionorder\_idOrder id in SBPayamountAmountcurrencyCurrencycustomer\_idCustomer reference idsave\_payment\_method1 if customer selected to store payment method/0 if customer selected to not store payment methodrecurring\_period\_typeRecurring period type for recurring payments only (year/month/week/day)recurring\_periodRecurring period for recurring payments only (number)return\_urlReturn URL (you should redirect customer here after payment)cancel\_urlCancel URL (you should redirect customer here if customer cancels payment)timestampTime stamp of request (to validate signature)algoAlgorithm of signaturesignatureSignature to validate request- Rebilling URL. You will receive HTTP request from our servers, when we need to charge customer again (when he selected to pay with Vaulted payment method or when it is time to charge recurring payment) with following data:

Parameter nameDescriptionorder\_idOrder id in SBPayamountAmountcurrencyCurrencycustomer\_idCustomer reference idpayment\_method\_reference\_idPayment method reference id (You should pass it during confirm initial payment)timestampTime stamp of request (to validate signature)algoAlgorithm of signaturesignatureSignature to validate request- Delete payment method URL. You will receive HTTP request from our servers, when customer decided to delete Vaulted payment method (remove card, etc.) with following data:

Parameter nameDescriptioncustomer\_idCustomer reference idpayment\_method\_reference\_idPayment method reference id (You should pass it during confirm initial payment)timestampTime stamp of request (to validate signature)algoAlgorithm of signaturesignatureSignature to validate request- Refund URL. You will receive HTTP request from our servers, when user of SBPay (SimplyBook) makes refund. You will receive following data:

Parameter nameDescriptionorder\_idOrder id in SBPayamountAmountcurrencyCurrencytransaction\_idTransaction ID of payment (you should pass it during payment confirmation)timestampTime stamp of request (to validate signature)algoAlgorithm of signaturesignatureSignature to validate requestYou can use SDK to validate request:

```
$client = new \SBPay\SBPayClient(SBPAY_TOKEN, SBPAY_SECRET ,SBPAY_MERCHANT, SBPAY_HOST);
$client->payments()->validateCustomPaymentProcessorRequest($_POST);
```

Examples
--------

[](#examples)

You can find custom payment processor example [`here`](https://github.com/dimkasb/sbpay-sdk/tree/main/example/custom_payment_processor)

Documentation for API Endpoints
-------------------------------

[](#documentation-for-api-endpoints)

You can find API documentation [`here`](https://app.sbpay.me/en/api-documentation)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

4

Last Release

1064d ago

### Community

Maintainers

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

---

Top Contributors

[![dimkasb](https://avatars.githubusercontent.com/u/87759477?v=4)](https://github.com/dimkasb "dimkasb (22 commits)")

---

Tags

apisbpaypayment procesing

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[get-stream/stream-chat

A PHP client for Stream Chat (https://getstream.io/chat/)

301.8M2](/packages/get-stream-stream-chat)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)

PHPackages © 2026

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