PHPackages                             progalaxyelabs/stonescriptphp-pay - 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. progalaxyelabs/stonescriptphp-pay

ActiveLibrary[Payment Processing](/categories/payments)

progalaxyelabs/stonescriptphp-pay
=================================

Payment provider abstraction for StoneScriptPHP — Razorpay driver included. Paddle, Square, and Apple Pay are future drivers.

0.1.0(1mo ago)067MITPHPPHP ^8.2

Since Jun 14Pushed 1mo agoCompare

[ Source](https://github.com/progalaxyelabs/stonescriptphp-pay)[ Packagist](https://packagist.org/packages/progalaxyelabs/stonescriptphp-pay)[ Docs](https://stonescriptphp.org)[ RSS](/packages/progalaxyelabs-stonescriptphp-pay/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

stonescriptphp-pay
==================

[](#stonescriptphp-pay)

Payment provider abstraction for [StoneScriptPHP](https://stonescriptphp.org). Razorpay is the first driver; the interface is designed for Paddle, Square, Apple Pay, and others as future drivers.

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

[](#installation)

```
composer require progalaxyelabs/stonescriptphp-pay
```

Usage
-----

[](#usage)

```
use StoneScriptPay\Drivers\RazorpayDriver;
use StoneScriptPay\DTO\CreateOrderRequest;
use StoneScriptPay\DTO\VerifyRequest;
use StoneScriptPay\DTO\WebhookRequest;

// Instantiate — credentials are runtime-injected from env, never hardcoded
$provider = new RazorpayDriver(
    keyId:         $_ENV['RAZORPAY_KEY_ID'],
    keySecret:     $_ENV['RAZORPAY_KEY_SECRET'],
    webhookSecret: $_ENV['RAZORPAY_WEBHOOK_SECRET'],
);

// 1. Create an order (server-set amount — never trust client)
$order = $provider->createOrder(new CreateOrderRequest(
    amountMinorUnits: 49900,   // paise for INR
    currency:         'INR',
    receipt:          'order_ref_001',
    notes:            ['tenant_id' => $tenantId],
));
// Pass $order->orderId and $order->publishableKeyId to the frontend

// 2. Verify the checkout response from the frontend
$result = $provider->verifySignature(new VerifyRequest(
    paymentId: $request->razorpay_payment_id,
    orderId:   $request->razorpay_order_id,
    signature: $request->razorpay_signature,
));
// $result->verified === true → safe to fulfil the order

// 3. Handle webhooks
$event = $provider->handleWebhook(new WebhookRequest(
    rawBody:   file_get_contents('php://input'),
    signature: $_SERVER['HTTP_X_RAZORPAY_SIGNATURE'] ?? '',
));
if ($event->isPaymentCaptured()) {
    // Activate subscription / fulfil order
}
```

Security
--------

[](#security)

- **Backend is the verification authority** — amount is set server-side; the frontend only receives `order_id` and the publishable `key_id`.
- **Secrets are runtime-injected** — `key_secret` and `webhookSecret` are never in source.
- **Hosted checkout only** — card details never pass through your app (Razorpay's hosted surface).

Running tests
-------------

[](#running-tests)

```
composer test
```

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/395201d5852ab3828cb1de9eda82667c405c5dd11b55d9b5be4d768f93955c1d?d=identicon)[pradeepkumardesk](/maintainers/pradeepkumardesk)

---

Top Contributors

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

---

Tags

phppaymentssubscriptionpayment gatewayrazorpaystonescriptphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/progalaxyelabs-stonescriptphp-pay/health.svg)

```
[![Health](https://phpackages.com/badges/progalaxyelabs-stonescriptphp-pay/health.svg)](https://phpackages.com/packages/progalaxyelabs-stonescriptphp-pay)
```

###  Alternatives

[razorpay/magento

Razorpay Magento 2.0 plugin for accepting payments.

3079.2k1](/packages/razorpay-magento)

PHPackages © 2026

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