PHPackages                             odenktools/php-bca - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. odenktools/php-bca

ActiveLibrary[HTTP &amp; Networking](/categories/http)

odenktools/php-bca
==================

Library REST API Untuk Develop BCA Payment

v2.3.2(5y ago)8631.4k↓50%56[3 issues](https://github.com/odenktools/php-bca/issues)[1 PRs](https://github.com/odenktools/php-bca/pulls)2MITPHPPHP &gt;=5.4

Since Sep 29Pushed 3y ago7 watchersCompare

[ Source](https://github.com/odenktools/php-bca)[ Packagist](https://packagist.org/packages/odenktools/php-bca)[ Docs](https://github.com/odenktools/php-bca)[ RSS](/packages/odenktools-php-bca/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (15)Used By (2)

[![SensioLabsInsight](https://camo.githubusercontent.com/bea7d94e33e7a29ce1aaac5ba53126a16464cf4ce6fac81b12dbafc29e06bb81/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f30613638353135372d656139392d343535342d623330322d3965383837396430353634382f736d616c6c2e706e67)](https://insight.sensiolabs.com/projects/0a685157-ea99-4554-b302-9e8879d05648)[![Build Status](https://camo.githubusercontent.com/1bd4d2e2fa09cbc3de4de049eafcd3f91285e6c26ef533e24243c8a6a889c5bf/68747470733a2f2f7472617669732d63692e6f72672f6f64656e6b746f6f6c732f7068702d6263612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/odenktools/php-bca)[![codecov](https://camo.githubusercontent.com/550c47aedc5b71c7ca584e457db52bdfde036ab6d30e292ded949fe24fc998d7/68747470733a2f2f636f6465636f762e696f2f67682f6f64656e6b746f6f6c732f7068702d6263612f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/odenktools/php-bca)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/49a1276c466083ac41645f8179446299d36048fd0e99e639c1d671980a52a866/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6f64656e6b746f6f6c732f7068702d6263612f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/odenktools/php-bca/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/9347f4f4d7302f6453a8524e022a7427a3496eaa40c3fa1a3555f8307775c8d3/68747470733a2f2f706f7365722e707567782e6f72672f6f64656e6b746f6f6c732f7068702d6263612f762f737461626c65)](https://packagist.org/packages/odenktools/php-bca)[![Latest Unstable Version](https://camo.githubusercontent.com/9f18a897f838e6dce55339d9b40bbe5f5272a0ef045e9c2c5b4847ba659ce474/68747470733a2f2f706f7365722e707567782e6f72672f6f64656e6b746f6f6c732f7068702d6263612f762f756e737461626c65)](https://packagist.org/packages/odenktools/php-bca)[![Total Downloads](https://camo.githubusercontent.com/ab657edee7a4f67fabfae9a7e2ab222f1139ef9b1d0b14c0784421a203daa57a/68747470733a2f2f706f7365722e707567782e6f72672f6f64656e6b746f6f6c732f7068702d6263612f646f776e6c6f616473)](https://packagist.org/packages/odenktools/php-bca)

BCA (Bank Central Asia)
=======================

[](#bca-bank-central-asia)

Native PHP library untuk mengintegrasikan Aplikasi Anda dengan sistem BCA (Bank Central Asia). Untuk dokumentasi lebih jelas dan lengkap, silahkan kunjungi website resminya di [Developer BCA](https://developer.bca.co.id/documentation).

Untuk Framework `Laravel` bisa menggunakan library [Odenktools Laravel BCA](https://github.com/odenktools/laravel-bca).

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 BCA TravisCI](https://travis-ci.org/odenktools/php-bca)

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

[](#fitur-library)

- [Installasi](https://github.com/odenktools/php-bca#instalasi)
- [Setting](https://github.com/odenktools/php-bca#koneksi-dan-setting)
- [Login](https://github.com/odenktools/php-bca#login)
- [Informasi Saldo](https://github.com/odenktools/php-bca#balance-information)
- [Transfer](https://github.com/odenktools/php-bca#fund-transfer)
- [Mutasi Rekening](https://github.com/odenktools/php-bca#account-statement)
- [Info Kurs](https://github.com/odenktools/php-bca#foreign-exchange-rate)
- [Pencarian ATM Terdekat](https://github.com/odenktools/php-bca#nearest-atm-locator)
- [Deposit Rate](https://github.com/odenktools/php-bca#deposit-rate)
- [Generate Signature](https://github.com/odenktools/php-bca#generate-signature)
- [How to contribute](https://github.com/odenktools/php-bca#how-to-contribute)

### (NEW BCA API on December 2017)

[](#new-bca-api-on-december-2017)

Get balance information

```
/fire/accounts/balance

```

Get beneficiary account’s information

```
/fire/accounts

```

Get status of a transaction

```
/fire/transactions

```

Transfer funds directly to beneficiary account

```
/fire/transactions/to-account

```

Transfer funds to beneficiary to be taken personally

```
/fire/transactions/cash-transfer

```

Amend cash transfer transaction’s detail

```
/fire/transactions/cash-transfer/amend

```

Cancel cash transfer transaction

```
/fire/transactions/cash-transfer/cancel

```

Get status of payment by CompanyCode and CustomerNumber or RequestID

```
/va/payments?CompanyCode=&RequestID=

```

### INSTALASI

[](#instalasi)

```
composer require "odenktools/php-bca"
```

### KONEKSI DAN SETTING

[](#koneksi-dan-setting)

Sebelum masuk ke tahap `LOGIN` pastikan seluruh kebutuhan seperti `CORP_ID, CLIENT_KEY, CLIENT_SECRET, APIKEY, SECRETKEY` telah diketahui.

```
    $options = array(
        'scheme'        => 'https',
        'port'          => 443,
        'host'          => 'sandbox.bca.co.id',
        'timezone'      => 'Asia/Jakarta',
        'timeout'       => 30,
        'debug'         => true,
        'development'   => true
    );

    // Setting default timezone Anda
    \Bca\BcaHttp::setTimeZone('Asia/Jakarta');

    // ATAU

    // \Bca\BcaHttp::setTimeZone('Asia/Singapore');

    $corp_id = "BCAAPI2016";
    $client_key = "NILAI-CLIENT-KEY-ANDA";
    $client_secret = "NILAI-CLIENT-SECRET-ANDA";
    $apikey = "NILAI-APIKEY-ANDA";
    $secret = "SECRETKEY-ANDA";

    $bca = new \Bca\BcaHttp($corp_id, $client_key, $client_secret, $apikey, $secret);

    // ATAU

    $bca = new \Bca\BcaHttp($corp_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'          => 'sandbox.bca.co.id',
        'timezone'      => 'Asia/Jakarta',
        'timeout'       => 30,
        'debug'         => true,
        'development'   => true
    );

    // Setting default timezone Anda
    \Bca\BcaHttp::setTimeZone('Asia/Jakarta');

    // ATAU

    // \Bca\BcaHttp::setTimeZone('Asia/Singapore');

    $corp_id = "BCAAPI2016";
    $client_key = "NILAI-CLIENT-KEY-ANDA";
    $client_secret = "NILAI-CLIENT-SECRET-ANDA";
    $apikey = "NILAI-APIKEY-ANDA";
    $secret = "SECRETKEY-ANDA";

    $bca = new \Bca\BcaHttp($corp_id, $client_key, $client_secret, $apikey, $secret, $options);
```

### LOGIN

[](#login)

```
    $corp_id = "CORP_ID-ANDA";
    $client_key = "NILAI-CLIENT-KEY-ANDA";
    $client_secret = "NILAI-CLIENT-SECRET-ANDA";
    $apikey = "NILAI-APIKEY-ANDA";
    $secret = "SECRETKEY-ANDA";

    $bca = new \Bca\BcaHttp($corp_id, $client_key, $client_secret, $apikey, $secret);

    // Request Login dan dapatkan nilai OAUTH
    $response = $bca->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.

### BALANCE INFORMATION

[](#balance-information)

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

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

    //Nomor akun yang akan di ambil informasi saldonya, menggunakan ARRAY
    $arrayAccNumber = array('0201245680', '0063001004', '1111111111');

    $response = $bca->getBalanceInfo($token, $arrayAccNumber);

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

### FUND TRANSFER (UPDATED)

[](#fund-transfer-updated)

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

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

    $amount = '50000.00';

    // Nilai akun bank anda
    $nomorakun = '0201245680';

    // Nilai akun bank yang akan ditransfer
    $nomordestinasi = '0201245681';

    // Nomor PO, silahkan sesuaikan
    $nomorPO = '12345/PO/2017';

    // Nomor Transaksi anda, Silahkan generate sesuai kebutuhan anda
    $nomorTransaksiID = '00000001';

    $remark1 = 'Transfer Test Using Odenktools BCA';

    $remark2 = 'Online Transfer Using Odenktools BCA';

    // value hanya support idr dan usd
    $mataUang = 'idr';

    $response = $bca->fundTransfers($token,
                        $amount,
                        $nomorakun,
                        $nomordestinasi,
                        $nomorPO,
                        $remark1,
                        $remark2,
                        $nomorTransaksiID,
                        $mataUang);

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

Untuk data `remark1`, `remark2`, `nomorPO` akan di replace menjadi `lowercase` dan dihapus `whitespace`

### ACCOUNT STATEMENT

[](#account-statement)

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

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

    // Nilai akun bank anda
    $nomorakun = '0201245680';

    // Tanggal start transaksi anda
    $startdate = '2016-08-29';

    // Tanggal akhir transaksi anda
    $enddate = '2016-09-01';

    $response = $bca->getAccountStatement($token, $nomorakun, $startdate, $enddate);

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

### FOREIGN EXCHANGE RATE

[](#foreign-exchange-rate)

```
    //Tipe rate :  bn, e-rate, tt, tc
    $rateType = 'e-rate';

    $mataUang = 'usd';

    $response = $bca->getForexRate($token, $rateType, $mataUang);

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

### NEAREST ATM LOCATOR

[](#nearest-atm-locator)

```
    $latitude = '-6.1900718';

    $longitude = '106.797190';

    $totalAtmShow = '10';

    $radius = '20';

    $response = $bca->getAtmLocation($token, $latitude, $longitude, $totalAtmShow, $radius);

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

### DEPOSIT RATE

[](#deposit-rate)

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

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

    $response       = $bca->getDepositRate($token);

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

### GENERATE SIGNATURE

[](#generate-signature)

Saat berguna untuk keperluan testing.

```
    $secret = "NILAI-SECRET-ANDA";

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

    $uriSign = "GET:/general/info-bca/atm";

    // Format timestamp harus dalam ISO8601 format (yyyy-MM-ddTHH:mm:ss.SSSTZD)
    $isoTime = "2016-02-03T10:00:00.000+07:00";

    $bodyData = array();

    //nilai body anda disini
    $bodyData['a'] = "BLAAA-BLLLAA";
    $bodyData['b'] = "BLEHH-BLLLAA";

    //ketentuan BCA array harus disort terlebih dahulu
    ksort($bodyData);

    $authSignature = \Bca\BcaHttp::generateSign($uriSign, $token, $secret, $isoTime, $bodyData);

    echo $authSignature;
```

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-bca.git  # Tambahkan fork pada remote, $USER adalah username GitHub anda
```

Misalkan :

```
git remote add fork git@github.com:johndoe/php-bca.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/odenktools/php-bca#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) 2017 odenktools

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

41

—

FairBetter than 89% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

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

Every ~101 days

Recently: every ~175 days

Total

12

Last Release

2044d ago

Major Versions

1.1.0 → 2.0.02017-09-30

PHP version history (2 changes)1.0.0PHP &gt;=5.2

v2.1.0PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f7f2a27279f20428dae0a8385089cf61665b9c56e3cae0b5860c35043ffaf00?d=identicon)[moeloet](/maintainers/moeloet)

---

Top Contributors

[![odenktools](https://avatars.githubusercontent.com/u/1627146?v=4)](https://github.com/odenktools "odenktools (79 commits)")[![MYassin16](https://avatars.githubusercontent.com/u/48644477?v=4)](https://github.com/MYassin16 "MYassin16 (1 commits)")[![tarikhagustia](https://avatars.githubusercontent.com/u/17002233?v=4)](https://github.com/tarikhagustia "tarikhagustia (1 commits)")

---

Tags

bank-central-asiaphpphp-bcaphp-libraryhttpphpresthttp clientBankingbcaBCA PHP

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/odenktools-php-bca/health.svg)

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

###  Alternatives

[odenktools/laravel-bca

Library REST API Untuk Develop BCA Payment

443.4k](/packages/odenktools-laravel-bca)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.0k](/packages/ismaeltoe-osms)[slimpay/hapiclient

An HTTP Client using HAL as the format for resources.

14317.3k](/packages/slimpay-hapiclient)

PHPackages © 2026

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