PHPackages                             durianpay/dpay-php - 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. durianpay/dpay-php

ActiveLibrary

durianpay/dpay-php
==================

SDK that wraps collections of Durianpay's APIs, written in php

1.0.0(3y ago)218.6kMITPHPPHP &gt;=7.2

Since Jul 20Pushed 1y agoCompare

[ Source](https://github.com/durianpay/dpay-php)[ Packagist](https://packagist.org/packages/durianpay/dpay-php)[ Docs](https://github.com/durianpay/dpay-php)[ RSS](/packages/durianpay-dpay-php/feed)WikiDiscussions main Synced today

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

Durianpay-PHP
=============

[](#durianpay-php)

- [API References](#api-references)
- [Getting Started](#getting-started)
- [Initialize the SDK](#initialize-the-sdk)
- [Features and Resources](#features-and-resources)
    - [Order](#orders)
    - [Payment](#payment)
    - [Order Durianpay Resources](#other-durianpay-resources)
- [Error Handling](#error-handling)

API References
--------------

[](#api-references)

For full documentations regarding Durianpay APIs, visit [our docs](https://durianpay.id/docs/api).

Getting Started
---------------

[](#getting-started)

If you already set up `composer` in your project, then type the command below:

```
composer require durianpay/dpay-php
```

Initialize the SDK
------------------

[](#initialize-the-sdk)

Set up the SDK by passing your dashboard **API key** to Durianpay class.

```
use Durianpay\Durianpay;

Durianpay::setApiKey('');
```

To find your API key, go to your dashboard [settings](https://dashboard.durianpay.id/#/settings) and click on **API keys**.

Features and Resources
----------------------

[](#features-and-resources)

### Orders

[](#orders)

For detailed information regarding Order APIs, visit our [docs](https://durianpay.id/docs/api/orders/overview/).

#### 1. Create Order

[](#1-create-order)

```
$res = \Durianpay\Resources\Order::create($body);
```

Pass order details to function.

Example call:

```
$res = \Durianpay\Resources\Order::create(
    [
        'amount' => '10000',
        'payment_option' => 'full_payment',
        'currency' => 'IDR',
        'order_ref_id' => 'order_ref_001',
        'customer' => [
            'customer_ref_id' => 'cust_001',
            'given_name' => 'Jane Doe',
            'email' => 'jane_doe@nomail.com',
            'mobile' => '85722173217',
        ],
        'items' => [
            [
                'name' => 'LED Television',
                'qty' => 1,
                'price' => '10000',
                'logo' => 'https://merchant.com/product_001/tv_image.jpg',
            ],
        ]
    ]
);

var_dump($res);
```

#### 2. Fetch Orders

[](#2-fetch-orders)

```
$res = \Durianpay\Resources\Order::fetch($queryParams);
```

Note: Passing `$queryParams` is optional. If `limit` property is not specified in the `$queryParams`, then the SDK immediately limits the amount of orders returned to the **five** latest ones.

Example call:

```
$res = \Durianpay\Resources\Order::fetch(
    [
        'from' => '2021-01-01',
        'to' => '2022-12-31',
        'skip' => '0',
        'limit' => '8'
    ]
);

var_dump($res);
```

#### 3. Fetch a Single Order

[](#3-fetch-a-single-order)

```
$res = \Durianpay\Resources\Order::fetchOne($id);
```

Pass **order id** as an argument to the function.

Example call:

```
$res = \Durianpay\Resources\Order::fetchOne('ord_JYF9EqFOiJ8812');
var_dump($res);
```

#### 4. Create a Payment Link

[](#4-create-a-payment-link)

```
$res = \Durianpay\Resources\Order::createPaymentLink($body);
```

Pass order details to function. This function will automatically append property `'is_payment_link' => true` to the request body.

Example call:

```
$res = \Durianpay\Resources\Order::createPaymentLink(
    [
        'amount' => '10000',
        'currency' => 'IDR',
        'customer' => [
            'given_name' => 'John Doe',
            'email' => 'john_doe@nomail.com',
            'mobile' => '01234567890',
            'given_name' => 'John Doe'
        ],
        'items' => [[
            'name' => 'LED Television',
            'qty' => 1,
            'price' => '10000',
            'logo' => 'https://merchant.com/product_001/tv_image.jpg'
        ]]
    ]
);

var_dump($res);
```

---

### Payments

[](#payments)

For detailed information regarding Payment APIs, visit our [docs](https://durianpay.id/docs/api/payments/overview/).

#### 1. Create Payment Charge

[](#1-create-payment-charge)

```
$res = \Durianpay\Resources\Payment::charge($type, $request);
```

Pass order details to function.

Example call:

```
$type = 'EWALLET'; // EWALLET, VA, RETAILSTORE, ONLINE_BANKING, BNPL, or QRIS

$res = \Durianpay\Resources\Payment::charge($type, [
    'order_id' => 'ord_xrc0BvcVIF1680',
    'wallet_type' => 'DANA',
    'mobile' => '01234567890',
    'amount' => '15000'
]);

var_dump($res);
```

#### 2. Fetch Payments

[](#2-fetch-payments)

```
$res = \Durianpay\Resources\Payment::fetch($queryParams);
```

Note: Passing `$queryParams` is optional. If `limit` property is not specified in the `$queryParams`, then the SDK immediately limits the amount of payments returned to the **five** latest ones.

Example call:

```
$res = \Durianpay\Resources\Payment::fetch();
var_dump($res);
```

#### 3. Fetch a Single Payment

[](#3-fetch-a-single-payment)

```
$res = \Durianpay\Resources\Payment::fetchOne($id);
```

Pass **payment id** as an argument to the function.

Example call:

```
$res = \Durianpay\Resources\Order::fetchOne('pay_7UnK1zvIjB5787');
var_dump($res);
```

#### 4. Check Payment Status

[](#4-check-payment-status)

```
$res = \Durianpay\Resources\Payment::checkStatus($id);
```

The function will return the current state of the payment (completed, processing, cancelled, or failed).

Example call:

```
$res = \Durianpay\Resources\Order::checkStatus('pay_7UnK1zvIjB5787');
var_dump($res);
```

#### 5. Verify Payments

[](#5-verify-payments)

```
$res = \Durianpay\Resources\Payment::verify($id, $verificationSignature);
```

Example call:

```
$signature = 'adf9a1a37af514c91225f6680e2df723fefebb7638519bcc7e7c9de02f2a3ab2';
$res = \Durianpay\Resources\Order::checkStatus('pay_7UnK1zvIjB5787', $signature);
var_dump($res);
```

#### 6. Cancel Payment

[](#6-cancel-payment)

```
$res = \Durianpay\Resources\Payment::cancel($id);
```

Will immediately set the payment status to **cancelled**.

Example call:

```
$res = \Durianpay\Resources\Order::cancel('pay_7UnK1zvIjB5787');
var_dump($res);
```

#### 7. Calculate MDR Fees

[](#7-calculate-mdr-fees)

```
$res = \Durianpay\Resources\Payment::calculateMDRFees($queryParams);
```

Example call:

```
$res = \Durianpay\Resources\Order::calculateMDRFees(['amount' => '50000']);
var_dump($res);
```

---

### Other Durianpay Resources

[](#other-durianpay-resources)

We are continuously expanding this documentation, so stay tune for more features. Meanwhile, you can explore our docs first at .

Error Handling
--------------

[](#error-handling)

Our SDK comes with various exception handlers. Whenever you call a function, it is recommended to always wrap it inside a `try-catch` block.

```
use Durianpay\Exceptions\BadRequestException;

try {
    // Some Durianpay functions
} catch(BadRequestException $error) {
    $errorDesc = $error->getDetailedErrorDesc();

    echo $error;
    var_dump($errorDesc);
}
```

###  Health Score

29

—

LowBetter than 63% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.1% 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

1341d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/086c05cec7e03d18f3fb4c93692c1f494198c4dcfa93730acd32128abc1128d4?d=identicon)[ErnestDurianpay](/maintainers/ErnestDurianpay)

---

Top Contributors

[![ErnestDurianpay](https://avatars.githubusercontent.com/u/107240165?v=4)](https://github.com/ErnestDurianpay "ErnestDurianpay (32 commits)")[![supriyadi687](https://avatars.githubusercontent.com/u/68528338?v=4)](https://github.com/supriyadi687 "supriyadi687 (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/durianpay-dpay-php/health.svg)

```
[![Health](https://phpackages.com/badges/durianpay-dpay-php/health.svg)](https://phpackages.com/packages/durianpay-dpay-php)
```

PHPackages © 2026

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