PHPackages                             spare-technologies/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. spare-technologies/php-sdk

ActiveLibrary[Payment Processing](/categories/payments)

spare-technologies/php-sdk
==========================

Spare payment sdk

1.1.2(3y ago)028MITPHPPHP &gt;=7.4

Since Oct 16Pushed 3y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (7)Versions (7)Used By (0)

php-sdk
=======

[](#php-sdk)

### Usage

[](#usage)

#### I- Installation

[](#i--installation)

```
composer require spare-technologies/php-sdk "^1.1"
```

Include these files in your application and do this at the top of your file:

```
require __DIR__ . '/vendor/autoload.php';
```

#### II- To Generate ECC key pair

[](#ii--to-generate-ecc-key-pair)

```
use Helpers\Crypto\SpCrypto;

public class MyClass {
    $keys = SpCrypto::GenerateKeyPair();

    echo "Private key \n" . nl2br($keys->getPrivateKey());
    echo "\n\n";
    echo "Public key \n" . nl2br($keys->getPublicKey())
}
```

#### III- To create your first payment request

[](#iii--to-create-your-first-payment-request)

```
use Helpers\Security\DigitalSignature\EccSignatureManager;
use Helpers\Serialization\SpSerializer;
use Payment\Client\SpPaymentClient;

public class MyClass {

    // Business ECC private key
    public static string $privateKey = "";

    // Spare ECC public key
    public static string $serverPublicKey = "";

    public static function createPayment(): void {

        // Configure client
        $clientOptions = new SpPaymentClientOptions(
        "https://payment.tryspare.com",
        "Your app id",
        "Your API key"
        );

        $client = new SpPaymentClient($clientOptions);

        // Initialize payment
        $paymentRequest = new SpPaymentRequest();
        $paymentRequest->setAmount(10.0);
        $paymentRequest->setDescription("Test payment");
        $paymentRequest->setOrderId("8jwaQ");

        // Sign the payment
        $signature = EccSignatureManager::Sign($paymentRequest->toJonsString(), $privateKey);

        // Create payment
        $paymentResponse = $this->paymentClient->CreateDomesticPayment($paymentRequest, $signature);

        // To verify signature of the created payment
        if (EccSignatureManager::Verify($serverPublicKey, $paymentResponse->getPayment()->toJonsString(), createPayment->getSignature())) {
            // signature verified
        }
    }
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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 ~12 days

Total

5

Last Release

1261d ago

PHP version history (2 changes)1.0.0PHP ^7.4 || ^8.0

1.1.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/e828907349298e9c3aa1334b47cffb9398d2f648c7d9bd0dc5736aeba50c5a9f?d=identicon)[Spare Technologies Ltd.](/maintainers/Spare%20Technologies%20Ltd.)

---

Top Contributors

[![hasnimehdi91](https://avatars.githubusercontent.com/u/50323226?v=4)](https://github.com/hasnimehdi91 "hasnimehdi91 (21 commits)")[![YassinBenTaher](https://avatars.githubusercontent.com/u/66250010?v=4)](https://github.com/YassinBenTaher "YassinBenTaher (8 commits)")[![YassinBTaher](https://avatars.githubusercontent.com/u/75974113?v=4)](https://github.com/YassinBTaher "YassinBTaher (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[imdhemy/google-play-billing

Google Play Billing

491.3M5](/packages/imdhemy-google-play-billing)[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.3M25](/packages/googleads-googleads-php-lib)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

50570.7k1](/packages/web-auth-webauthn-framework)

PHPackages © 2026

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