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

ActiveLibrary[API Development](/categories/api)

jpay-api/php-sdk
================

Php API SDK for J-Pay payment gateway

v1.0.0(yesterday)01↑2900%MITPHPPHP ^7.2 || ^8.0

Since Jun 26Pushed yesterdayCompare

[ Source](https://github.com/jpay-api/php-sdk)[ Packagist](https://packagist.org/packages/jpay-api/php-sdk)[ Docs](https://github.com/jpay-api/php-sdk)[ RSS](/packages/jpay-api-php-sdk/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Getting Started with J-Pay API
==============================

[](#getting-started-with-j-pay-api)

Introduction
------------

[](#introduction)

Php API SDK for J-Pay payment gateway

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

[](#installation)

### With Composer

[](#with-composer)

```
$ composer require jpay-api/php-sdk

```

```
{
  "require": {
    "jpay-api/php-sdk": "~1.0"
  }
}
```

Initialize the API Client
-------------------------

[](#initialize-the-api-client)

***Note:*** Documentation for the client can be found [here.](doc/client.md)

The following parameters are configurable for the API Client:

ParameterTypeDescriptionapiKey`string`Merchant API key for automatic MD5 request signing on Payments API calls.environment[`Environment`](README.md#environments)The API environment.
 **Default: `Environment.PRODUCTION`**timeout`int`Timeout for API calls in seconds.
*Default*: `30`enableRetries`bool`Whether to enable retries and backoff feature.
*Default*: `false`numberOfRetries`int`The number of retries to make.
*Default*: `0`retryInterval`float`The retry time interval between the endpoint calls.
*Default*: `1`backOffFactor`float`Exponential backoff factor to increase interval between retries.
*Default*: `2`maximumRetryWaitTime`int`The maximum wait time in seconds for overall retrying requests.
*Default*: `0`retryOnTimeout`bool`Whether to retry on request timeout.
*Default*: `true`httpStatusCodesToRetry`array`Http status codes to retry against.
*Default*: `408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524`httpMethodsToRetry`array`Http methods to retry against.
*Default*: `'GET', 'PUT', 'GET', 'PUT'`loggingConfiguration[`LoggingConfigurationBuilder`](doc/logging-configuration-builder.md)Represents the logging configurations for API callsproxyConfiguration[`ProxyConfigurationBuilder`](doc/proxy-configuration-builder.md)Represents the proxy configurations for API callsverifyPeer`bool`Whether to verify SSL certificates.
*Default*: `true`verifyHost`bool`Whether to verify SSL host names.
*Default*: `true`The API client can be initialized as follows:

```
use JPayApiLib\Logging\LoggingConfigurationBuilder;
use JPayApiLib\Logging\RequestLoggingConfigurationBuilder;
use JPayApiLib\Logging\ResponseLoggingConfigurationBuilder;
use Psr\Log\LogLevel;
use JPayApiLib\Environment;
use JPayApiLib\JPayApiClientBuilder;

$client = JPayApiClientBuilder::init()
    ->apiKey('your-merchant-api-key')
    ->environment(Environment::PRODUCTION)
    ->loggingConfiguration(
        LoggingConfigurationBuilder::init()
            ->level(LogLevel::INFO)
            ->requestConfiguration(RequestLoggingConfigurationBuilder::init()->body(true))
            ->responseConfiguration(ResponseLoggingConfigurationBuilder::init()->headers(true))
    )
    ->build();
```

Environments
------------

[](#environments)

The SDK can be configured to use a different environment for making API calls. Available environments are:

### Fields

[](#fields)

NameDescriptionPRODUCTIONSandbox (**Default**)ENVIRONMENT2ProductionRequest Models &amp; Builders
-----------------------------

[](#request-models--builders)

Each API endpoint supports typed request models with fluent builders aligned to the OpenAPI spec. All parameters use `string` types as defined in the API.

```
use JPayApiLib\Models\Requests\Builders\CreatePayoutRequestBuilder;

$request = CreatePayoutRequestBuilder::init()
    ->orderType('1')
    ->memberid('10010')
    ->outTradeNo('PO20260101001')
    ->amount('100.00')
    ->currency('USD')
    ->notifyurl('https://example.com/payout/notify')
    ->remark('Salary payout')
    ->sign($md5Sign)
    ->firstname('John')
    ->payeeCountry('US')
    ->payeeaccount('1234567890')
    ->bankcode('001')
    ->bankname('Test Bank')
    ->build();

$response = $client->getPayoutsApi()->createFromRequest($request);
/** @var \JPayApiLib\Models\ApiV1PaymentCreateOrderResponse $result */
$result = $response->getResult();
```

Response models are automatically deserialized (e.g. `PayTradeQueryResponse`, `PaymentResponse`).

Automatic Request Signing
-------------------------

[](#automatic-request-signing)

When `apiKey` is configured, `PaymentsApi` automatically generates the MD5 signature (`pay_md5sign`) before sending outbound requests. You do not need to set `payMd5Sign` manually unless you want to override the computed value.

Signing follows the [J-Pay signature algorithm](https://docs.j-pay.net/docs/start): non-empty sign fields are sorted by name, joined as `key=value&...`, appended with `&key={apiKey}`, then MD5-hashed in uppercase.

For card payment creation (`POST /pay_index`), the signed fields are: `pay_memberid`, `pay_orderid`, `pay_applydate`, `pay_bankcode`, `pay_notifyurl`, `pay_callbackurl`, `pay_amount`.

List of APIs
------------

[](#list-of-apis)

- [Payments API](doc/controllers/payments-api.md)
- [Payments Link Payment](doc/controllers/payments-link-payment.md)
- [Agency](doc/controllers/agency.md)
- [Files](doc/controllers/files.md)
- [Payouts](doc/controllers/payouts.md)

SDK Infrastructure
------------------

[](#sdk-infrastructure)

### Configuration

[](#configuration)

- [ProxyConfigurationBuilder](doc/proxy-configuration-builder.md)
- [LoggingConfigurationBuilder](doc/logging-configuration-builder.md)
- [RequestLoggingConfigurationBuilder](doc/request-logging-configuration-builder.md)
- [ResponseLoggingConfigurationBuilder](doc/response-logging-configuration-builder.md)

### HTTP

[](#http)

- [HttpRequest](doc/http-request.md)

### Utilities

[](#utilities)

- [FileWrapper](doc/file-wrapper.md)
- [ApiResponse](doc/api-response.md)

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

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

1d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/296405831?v=4)[jpay-api](/maintainers/jpay-api)[@jpay-api](https://github.com/jpay-api)

---

Top Contributors

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

---

Tags

apisdkJ-Pay API

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[square/square

Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.

763.7M26](/packages/square-square)

PHPackages © 2026

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