/cpybca

Python module for accessing BCA API

Primary LanguagePythonMIT LicenseMIT

cpybca

Author: Christoforus Surjoputro <cs_sanmar@yahoo.com>
Date: 2017-06-24
Version: 0.1.0
License:MIT License
https://travis-ci.org/3mp3ri0r/cpybca.svg?branch=develop

cpybca is python module to access BCA API. In this version, you can check balance, account statement (history), and transfer fund.

This module work on python 3.3+. Fully tested on python 3.5.2.

  1. Clone or download this repo https://gitlab.com/3mp3ri0r/cpybca.git.
  2. Move this entire project to your project's directory.
  1. Import cpybca to your project by doing this :python3:`from cpybca.bca import Bca`.
  2. Initiate connection to BCA API server by doing this :python3:`bca = BCA('YOUR_API_KEY', 'YOUR_API_SECRET')`.
  3. Sign in to BCA API server by doing this :python3:`bca.sign_in('YOUR_CLIENT_ID', 'YOUR_CLIENT_SECRET')`.
  4. Do action you want by calling :python3:`Bca` function.

You can get account balance by doing this:

bca.get_balance('CORPORATE_ID', 'ACCOUNT_NUMBER')

You can get multiple account balance by doing this:

bca.get_balance('CORPORATE_ID', ['ACCOUNT_NUMBER1', 'ACCOUNT_NUMBER2'])

You can get account statement or history transaction by doing this:

bca.get_statement('CORPORATE_ID', 'ACCOUNT_NUMBER', 'START_DATE', 'END_DATE')

Note:

  1. START_DATE and END_DATE use yyyy-MM-dd format.
  2. Maximum date to get from start to end is 31 day.

You can get account statement or history transaction by doing this:

bca.get_statement('CORPORATE_ID', 'SOURCE_ACCOUNT_NUMBER', 'BENEFICIARY_ACCOUNT_NUMBER', 'TRANSACTION_ID', 'TRANSACTION_DATE', 'REFERENCE_ID', 'AMOUNT', 'CURRENCY_CODE', 'REMARK1', 'REMARK2')

Note:

  1. BENEFICIARY_ACCOUNT_NUMBER is account number you want to receive money.
  2. TRANSACTION_ID is number of transfer you do on the following day.
  3. TRANSACTION_DATE is date you do transfer in yyyy-MM-dd format.
  4. REFERENCE_ID is your reference code. It can contain combination of string and numeric. Example: 1234/DP/2017
  5. AMOUNT is number of amount you want to send in string format. Example: '1000000.00'
  6. REMARK1 and REMARK2 is notes you want to send to receiver. It is not mandatory so you can remove this.

Just create an issue when you encounter any problem.

  1. Change host to real BCA API server, not the sandbox. (Version 1.0.0)
  2. Connect to BCA sakuku, so you can create payment and check payment status.
  3. Connect to general information like foreign exchange rate, deposit rate, and Nearest ATM.