Laravel PHP Library to integrate your application with the BCA (Bank Central Asia) system. For clearer and complete documentation, please visit the official website at the BCA Developer
This Library Supports PHP:
This Library Support Laravel:
If you feel helped by this library, don't forget to give STAR to this respository. Happy Koding!
All features, methods, property on Laravel PHP Library are all the same as Odenktools PHP BCA.
composer require odenktools/laravel-bca After the installation, add BcaServiceProvider to the Laravel providers . Configuration is in config/app.php
' providers ' => [
// blahh.. blahhh..
Odenktools Bca BcaServiceProvider::class,
] After that add Facade Bca to the Laravel aliases Array. Configuration is in config/app.php
' aliases ' => [
// blahh.. blahhh..
' Bca ' => Odenktools Bca Facades Bca::class,
]Publish the configuration used by the library
php artisan vendor:publish --provider= " OdenktoolsBcaBcaServiceProvider "
composer dumpautoload Papda configuration config/Bca.php , please input environment that suits your needs. Make sure CORP_ID, CLIENT_KEY, CLIENT_SECRET, APIKEY, SECRETKEY are known.
' main ' => [
' corp_id ' => ' your-corp_id ' ,
' client_id ' => ' your-client_id ' ,
' client_secret ' => ' your-client_secret ' ,
' api_key ' => ' your-api_key ' ,
' secret_key ' => ' your-secret_key ' ,
' timezone ' => ' Asia/Jakarta ' ,
' host ' => ' sandbox.bca.co.id ' ,
' scheme ' => ' https ' ,
' development ' => true ,
' options ' => [],
' port ' => 443 ,
' timeout ' => 30 ,
], // Request Login dan dapatkan nilai OAUTH
$ response = Bca:: httpAuth ();
// LIHAT HASIL OUTPUT
echo json_encode ( $ response ); After the login successfully make sure you store TOKEN value in a safe place, because TOKEN value is to be used for the next assignment.
Make sure you get the value of TOKEN and TOKEN is still valid (not expired).
// 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 );
// LIHAT HASIL OUTPUT
echo json_encode ( $ response ); Make sure you get the value of TOKEN and TOKEN is still valid (not expired).
// 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 ' ;
$ response = Bca:: fundTransfers ( $ token ,
$ amount ,
$ nomorakun ,
$ nomordestinasi ,
$ nomorPO ,
' Testing Saja Ko ' ,
' Online Saja Ko ' ,
$ nomorTransaksiID );
echo json_encode ( $ response ); Make sure you get the value of TOKEN and TOKEN is still valid (not expired).
// 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 );
echo json_encode ( $ response ); //Tipe rate : bn, e-rate, tt, tc
$ rateType = ' e-rate ' ;
$ mataUang = ' usd ' ;
$ response = Bca:: getForexRate ( $ token , $ rateType , $ mataUang );
echo json_encode ( $ response ); $ latitude = ' -6.1900718 ' ;
$ longitude = ' 106.797190 ' ;
$ totalAtmShow = ' 10 ' ;
$ radius = ' 20 ' ;
$ response = Bca:: getAtmLocation ( $ token , $ latitude , $ longitude , $ totalAtmShow , $ radius );
echo json_encode ( $ response ); Make sure you get the value of TOKEN and TOKEN is still valid (not expired).
// Nilai token yang dihasilkan saat login
$ token = " MvXPqa5bQs5U09Bbn8uejBE79BjI3NNCwXrtMnjdu52heeZmw9oXgB " ;
$ response = Bca:: getDepositRate ( $ token );
echo json_encode ( $ response );When useful for testing purposes.
$ secret = " NILAI-SECRET-ANDA " ;
// 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:: generateSign ( $ uriSign , $ token , $ secret , $ isoTime , $ bodyData );
echo $ authSignature ;Using composer
composer run-script test:ciUsing phunit
vendor/bin/phpunit --verbose --coverage-textMake a fork on this repository.
Create feature branch by way of
git checkout -b my-new-featureModify your repository. When finished, do the commit
git commit -am ' Menambahkan fitur xxx ' Do Push to the branch that has been created
git push origin my-new-featurePull request to this repository, complete.
MIT License
Copyright (C) 2017 Odenktools
Permission is Heraby 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, copy, modify 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 substantive 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 shalling the author or copyright holders are being liable for any claims, 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.