PHPackages                             ziyoren/pay-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. ziyoren/pay-sdk

ActiveLibrary

ziyoren/pay-sdk
===============

Ziyoren Pay SDK for payment integration

00PHP

Since Mar 24Pushed todayCompare

[ Source](https://github.com/ziyoren/pay-sdk)[ Packagist](https://packagist.org/packages/ziyoren/pay-sdk)[ RSS](/packages/ziyoren-pay-sdk/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Ziyoren Pay SDK
===============

[](#ziyoren-pay-sdk)

A PHP SDK for integrating with Ziyoren Pay payment gateway.

[English Version](README.md) | [中文版本](README_ZH.md)

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

[](#installation)

You can install the package via composer:

```
composer require ziyoren/pay-sdk
```

Usage
-----

[](#usage)

### Initialize Client

[](#initialize-client)

```
use Ziyoren\PaySdk\Client;

$client = new Client('your-api-key', 'your-secret-key', 'https://api.ziyoren.com');
```

### Create Payment Order

[](#create-payment-order)

```
$orderData = [
    'out_trade_no' => 'ORDER-' . time(),
    'total_amount' => 100.00,
    'subject' => 'Product Name',
    'notify_url' => 'https://your-domain.com/notify'
];

try {
    $result = $client->createPaymentOrder($orderData);
    // Handle result
    var_dump($result);
} catch (\Ziyoren\PaySdk\Exceptions\ApiException $e) {
    // Handle API error
    echo "API Error: " . $e->getMessage();
}
```

### Get Payment Status

[](#get-payment-status)

```
try {
    $result = $client->getPaymentStatus('ORDER-123456789');
    // Handle result
    var_dump($result);
} catch (\Ziyoren\PaySdk\Exceptions\ApiException $e) {
    // Handle API error
    echo "API Error: " . $e->getMessage();
}
```

### Verify Payment Notification

[](#verify-payment-notification)

```
// Example: in your notification endpoint
$notificationData = $_POST; // or however you receive the data

if ($client->verifyNotification($notificationData)) {
    // Signature is valid, process the notification
    echo "Valid notification";
} else {
    // Invalid signature, reject
    http_response_code(400);
    echo "Invalid signature";
}
```

Testing
-------

[](#testing)

Run the tests using PHPUnit:

```
composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

20

↑

LowBetter than 16% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

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.

### Community

Maintainers

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

### Embed Badge

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

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

PHPackages © 2026

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