PHPackages                             gobliggg/php-jenius - 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. gobliggg/php-jenius

ActiveLibrary

gobliggg/php-jenius
===================

PHP Wrapper for Jenius BTPN Payment API.

01PHP

Since Oct 13Pushed 5y ago1 watchersCompare

[ Source](https://github.com/gobliggg/php-jenius)[ Packagist](https://packagist.org/packages/gobliggg/php-jenius)[ RSS](/packages/gobliggg-php-jenius/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Build Status](https://camo.githubusercontent.com/bd4637606ae6aefb5c4fcc96b54e9582f32e02887a8cd1ef2c41a361481def23/68747470733a2f2f7472617669732d63692e6f72672f676f626c696767672f7068702d6a656e6975732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/gobliggg/php-jenius)[![codecov](https://camo.githubusercontent.com/729ef55b812ba49b5f953b053f32f9b56af482be7810468407c55b797ba70ec6/68747470733a2f2f636f6465636f762e696f2f67682f676f626c696767672f7068702d6a656e6975732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/gobliggg/php-jenius)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/cae45b2eec26a2ad1c53a7df521fb62f2e9630bb8fb79eb1a7a526dcf50932bc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676f626c696767672f7068702d6a656e6975732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gobliggg/php-jenius/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/8abf66443d3e0af8a0a66c3d4f39c4d97c70008f021edc399029ef0ccd1d03e1/68747470733a2f2f706f7365722e707567782e6f72672f676f626c696767672f7068702d6a656e6975732f762f737461626c65)](https://packagist.org/packages/gobliggg/php-jenius)[![Latest Unstable Version](https://camo.githubusercontent.com/47edca986d03a2171ded193ab42aa6798c7925d1decc642112a2afcee1227e33/68747470733a2f2f706f7365722e707567782e6f72672f676f626c696767672f7068702d6a656e6975732f762f756e737461626c65)](https://packagist.org/packages/gobliggg/php-jenius)[![Total Downloads](https://camo.githubusercontent.com/89d55fed2342cedbe61615edce7fc6a3afca093bca1409e17661e8e395c635e1/68747470733a2f2f706f7365722e707567782e6f72672f676f626c696767672f7068702d6a656e6975732f646f776e6c6f616473)](https://packagist.org/packages/gobliggg/php-jenius)

Jenius BTPN
===========

[](#jenius-btpn)

Native PHP library untuk mengintegrasikan Aplikasi Anda dengan sistem Jenius BTPN. Untuk dokumentasi lebih jelas dan lengkap, silahkan kunjungi website resminya di [Developer Jenius](https://developers.btpn.com/api-documentation).

Jika merasa terbantu dengan adanya library ini, jangan lupa untuk kasih STAR untuk library ini.

PHP Version Support
-------------------

[](#php-version-support)

- PHP 5.4.x
- PHP 5.5.x
- PHP 5.6.x
- PHP 7.0.x
- PHP 7.1.x
- PHP 7.2.x
- PHP 7.3.x

Untuk lebih detail silahkan kunjungi [PHP Jenius TravisCI](https://travis-ci.org/gobliggg/php-jenius)

Fitur Library
-------------

[](#fitur-library)

- [Installasi](https://github.com/gobliggg/php-jenius#instalasi)
- [Setting](https://github.com/gobliggg/php-jenius#koneksi-dan-setting)
- [Login](https://github.com/gobliggg/php-jenius#login)
- [Payment Request](https://github.com/gobliggg/php-jenius#payment-request)
- [Payment Status](https://github.com/gobliggg/php-jenius#payment-status)
- [Payment Refund](https://github.com/gobliggg/php-jenius#payment-refund)
- [How to contribute](https://github.com/gobliggg/php-jenius#how-to-contribute)

### INSTALASI

[](#instalasi)

```
composer require "gobliggg/php-jenius"
```

### KONEKSI DAN SETTING

[](#koneksi-dan-setting)

Sebelum masuk ke tahap `LOGIN` pastikan seluruh kebutuhan seperti `X_CHANNEL_ID, CLIENT_KEY, CLIENT_SECRET, API_KEY, SECRET_KEY` telah diketahui.

```
    $options = array(
        'scheme'        => 'https',
        'port'          => 443,
        'host'          => 'apidev.btpn.com',
        'timezone'      => 'Asia/Jakarta',
        'timeout'       => 30,
        'debug'         => true,
        'development'   => true
    );

    // Setting default timezone Anda
    \Jenius\JeniusHttp::setTimeZone('Asia/Jakarta');

    // ATAU

    // \Jenius\JeniusHttp::setTimeZone('Asia/Singapore');

    $x_channel_id = "NILAI-X-CHANNEL-ID-ANDA";
    $client_key = "NILAI-CLIENT-KEY-ANDA";
    $client_secret = "NILAI-CLIENT-SECRET-ANDA";
    $apikey = "NILAI-APIKEY-ANDA";
    $secret = "SECRETKEY-ANDA";

    $jenius = new \Jenius\JeniusHttp($x_channel_id, $client_key, $client_secret, $apikey, $secret);

    // ATAU

    $jenius = new \Jenius\JeniusHttp($x_channel_id, $client_key, $client_secret, $apikey, $secret, $options);
```

Menggunakan custom **Curl Options**

```
    $options = array(
        'curl_options'  => array(
            CURLOPT_SSL_VERIFYHOST => 0,
            CURLOPT_SSLVERSION => 6,
            CURLOPT_SSL_VERIFYPEER => false,
            CURLOPT_TIMEOUT => 60
        ),
        'scheme'        => 'https',
        'port'          => 443,
        'host'          => 'apidev.btpn.com',
        'timezone'      => 'Asia/Jakarta',
        'timeout'       => 30,
        'debug'         => true,
        'development'   => true
    );

    // Setting default timezone Anda
    \Jenius\JeniusHttp::setTimeZone('Asia/Jakarta');

    // ATAU

    // \Jenius\JeniusHttp::setTimeZone('Asia/Singapore');

    $x_channel_id = "NILAI-X-CHANNEL-ID-ANDA";
    $client_key = "NILAI-CLIENT-KEY-ANDA";
    $client_secret = "NILAI-CLIENT-SECRET-ANDA";
    $apikey = "NILAI-APIKEY-ANDA";
    $secret = "SECRETKEY-ANDA";

    $jenius = new \Jenius\JeniusHttp($x_channel_id, $client_key, $client_secret, $apikey, $secret, $options);
```

### LOGIN

[](#login)

```
    $x_channel_id = "NILAI-X-CHANNEL-ID-ANDA";
    $client_key = "NILAI-CLIENT-KEY-ANDA";
    $client_secret = "NILAI-CLIENT-SECRET-ANDA";
    $apikey = "NILAI-APIKEY-ANDA";
    $secret = "SECRETKEY-ANDA";

    $jenius = new \Jenius\JeniusHttp($x_channel_id, $client_key, $client_secret, $apikey, $secret);

    // Request Login dan dapatkan nilai OAUTH
    $response = $jenius->httpAuth();

    // Cek hasil response berhasil atau tidak
    echo json_encode($response);
```

Setelah Login berhasil pastikan anda menyimpan nilai `TOKEN` di tempat yang aman, karena nilai `TOKEN` tersebut agar digunakan untuk tugas tugas berikutnya.

### PAYMENT REQUEST

[](#payment-request)

Pastikan anda mendapatkan nilai `TOKEN` dan `TOKEN` tersebut masih berlaku (Tidak Expired).

```
    // Ini adalah nilai token yang dihasilkan saat login
    $token = "MvXPqa5bQs5U09Bbn8uejBE79BjI3NNCwXrtMnjdu52heeZmw9oXgB";

    $amount = '50000';

    // Cashtag jenius btpn
    $cashTag = '$getha36';

    // Kode promo
    $promoCode = '';

    // Url Callback ketika pembayaran sudah dilakukan, silahkan disesuaikan
    $urlCallback = "http://www.mocky.io/v2/5c7cdb361000009c14760c5b";

    // Deskripsi pembayaran, silahkan disesuaikan
    $purchaseDesc = "";

    // Tanggal transaksi anda
    $createdAt = "2020-09-26T21:14:07";

   // Nomor Transaksi anda, Silahkan generate sesuai kebutuhan anda
    $referenceNo = "";

    $response = $jenius->paymentRequest(
            $token,
            $amount,
            $cashTag,
            $promoCode,
            $urlCallback,
            $purchaseDesc,
            $createdAt,
            $referenceNo);

    // Cek hasil response berhasil atau tidak
    echo json_encode($response);
```

### PAYMENT STATUS

[](#payment-status)

Pastikan anda mendapatkan nilai `TOKEN` dan `TOKEN` tersebut masih berlaku (Tidak Expired).

```
    // Ini adalah nilai token yang dihasilkan saat login
    $token = "MvXPqa5bQs5U09Bbn8uejBE79BjI3NNCwXrtMnjdu52heeZmw9oXgB";

    // Nomor Transaksi anda, Silahkan generate sesuai kebutuhan anda
    $referenceNo = "";

    // Tanggal transaksi anda
    $createdAt = "2020-09-26T21:14:07";

    $response = $jenius->paymentStatus(
            $token,
            $referenceNo,
            $createdAt);

    // Cek hasil response berhasil atau tidak
    echo json_encode($response);
```

### PAYMENT REFUND

[](#payment-refund)

Pastikan anda mendapatkan nilai `TOKEN` dan `TOKEN` tersebut masih berlaku (Tidak Expired).

```
    // Ini adalah nilai token yang dihasilkan saat login
    $token = "MvXPqa5bQs5U09Bbn8uejBE79BjI3NNCwXrtMnjdu52heeZmw9oXgB";

    // Ini adalah nilai approval code yang dihasilkan saat payment status
    $approvalCode = "";

    // Nomor Transaksi anda, Silahkan generate sesuai kebutuhan anda
    $referenceNo = "";

    $amount = "50000";

    // Tanggal transaksi anda
    $createdAt = "2020-09-26T21:14:07";

    $response = $jenius->paymentRefund(
            $token,
            $approvalCode,
            $referenceNo,
            $amount,
            $createdAt);

    // Cek hasil response berhasil atau tidak
    echo json_encode($response);
```

TESTING
=======

[](#testing)

Untuk melakukan testing lakukan `command` berikut ini

```
composer run-script test
```

Atau menggunakan PHPUnit

```
vendor/bin/phpunit --verbose --coverage-text
```

How to contribute
=================

[](#how-to-contribute)

- Lakukan **FORK** code.
- Tambahkan **FORK** pada git remote anda

Untuk contoh commandline nya :

```
git remote add fork git@github.com:$USER/php-jenius.git  # Tambahkan fork pada remote, $USER adalah username GitHub anda
```

Misalkan :

```
git remote add fork git@github.com:johndoe/php-jenius.git
```

- Setelah FORK, buat feature `branch` baru dengan cara

```
git checkout -b feature/my-new-feature origin/develop
```

- Lakukan pekerjaan pada repository anda tersebut.
- Sebelum melakukan commit lakukan `Reformat kode` anda menggunakan sesuai [PSR-2 Coding Style Guide](https://github.com/gobliggg/php-jenius#guidelines)
- Setelah selesai lakukan commit

```
git commit -am 'Menambahkan fitur A..B..C..D'
```

- Lakukan `Push` ke branch yang telah dibuat

```
git push fork feature/my-new-feature
```

- Lakukan PullRequest pada GitHub, setelah pekerjaan anda akan kami review. Selesai.

Guidelines
----------

[](#guidelines)

- Koding berstandart [PSR-2 Coding Style Guide](http://www.php-fig.org/psr/psr-2/)
- Pastikan seluruh test yang dilakukan telah pass, jika anda menambahkan fitur baru, anda diharus kan untuk membuat unit test terkait dengan fitur tersebut.
- Pergunakan [rebase](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) untuk menghindari conflict dan merge kode
- Jika anda menambahkan fitur, mungkin anda juga harus mengupdate halaman dokumentasi pada repository ini.

LICENSE
=======

[](#license)

MIT License

Copyright (c) 2019 gobliggg

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ecf024dd6c7f091521f98c5069e8f108fc734a4c1db6f547413514411c4fc23b?d=identicon)[gobliggg](/maintainers/gobliggg)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/gobliggg-php-jenius/health.svg)

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

PHPackages © 2026

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