PHPackages                             elgibor-solution/laravel-payment-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. [Payment Processing](/categories/payments)
4. /
5. elgibor-solution/laravel-payment-bca

ActiveLibrary[Payment Processing](/categories/payments)

elgibor-solution/laravel-payment-bca
====================================

Laravel package for BCA OpenAPI Virtual Account (Inquiry, Payment Flag, Status) with caching and signatures.

1.0.0(6mo ago)002Apache-2.0PHPPHP ^8.3

Since Dec 21Pushed 6mo agoCompare

[ Source](https://github.com/elgiborsolution/laravel-payment-bca)[ Packagist](https://packagist.org/packages/elgibor-solution/laravel-payment-bca)[ RSS](/packages/elgibor-solution-laravel-payment-bca/feed)WikiDiscussions main Synced today

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

Laravel BCA OpenAPI VA Client
=============================

[](#laravel-bca-openapi-va-client)

Production-ready Laravel 11 / PHP 8.3 package for **BCA OpenAPI Virtual Account** (bill presentment + payment flag + optional payment status). Namespace: `ESolution\BCAPayment`.

Installation
------------

[](#installation)

```
composer require elgibor-solution/laravel-payment-bca
php artisan vendor:publish --provider="ESolution\\BCAPayment\\BcaServiceProvider" --tag=bca-config
```

Configuration
-------------

[](#configuration)

Config lives at `config/bca.php` (aliased to `config/bca-openapi.php`). Keys:

- `base_url` (prod) / `base_url_staging` (sandbox) — defaults: `https://api.klikbca.com` / `https://devapi.klikbca.com`
- `client_id`, `client_secret`, `private_key` (PEM)
- `channel_id`, `partner_id`, optional `origin`
- `timeout`, `connect_timeout`, `retry_times`, `retry_sleep_ms`
- `token_cache_ttl_seconds` (default 900), `retry_on_codes` (default `5002600` for payment status retry)
- `debug` toggles staging base URL

Environment example:

```
BCA_BASE_URL=https://api.klikbca.com
BCA_BASE_URL_STAGING=https://devapi.klikbca.com
BCA_CLIENT_ID=your_client_id
BCA_CLIENT_SECRET=your_symmetric_secret
BCA_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----..."
BCA_CHANNEL_ID=95231
BCA_PARTNER_ID=12345
BCA_ORIGIN=https://merchant.example
BCA_DEBUG=false
```

### Runtime config

[](#runtime-config)

- Override defaults globally: `Bca::config([...])` or `Bca::setDefaultConfig([...])`.
- Per-call overrides: `Bca::withConfig([...])` or `Bca::withBaseUrl($url)` returning a client instance.
- Debug staging per call: `Bca::withConfig(['debug' => true])`.

Usage
-----

[](#usage)

```
use ESolution\BCAPayment\Facades\Bca;

// Access token (cached per client_id + base URL)
$token = Bca::token();

// Inquiry (Bill Presentment)
$inquiry = Bca::withConfig(['debug' => true])->inquiry([
    'partnerServiceId' => '123',
    'customerNo' => '987654',
    'virtualAccountNo' => '123987654',
    'trxDateInit' => now()->toIso8601String(),
    'channelCode' => '6011',
    'amount' => ['value' => '10000', 'currency' => 'IDR'],
    'inquiryRequestId' => 'REQ-1',
]);

// Payment Flag
$payment = Bca::payment([
    'partnerServiceId' => '123',
    'customerNo' => '987654',
    'virtualAccountNo' => '123987654',
    'virtualAccountName' => 'John Doe',
    'paymentRequestId' => 'PAY-1', // should match inquiryRequestId when retrying
    'channelCode' => '6011',
    'paidAmount' => ['value' => '10000', 'currency' => 'IDR'],
    'totalAmount' => ['value' => '10000', 'currency' => 'IDR'],
    'trxDateTime' => now()->toIso8601String(),
    'flagAdvise' => 'N', // N=new, Y=retry
]);

// Payment Status (optional)
$status = Bca::paymentStatus([
    'partnerServiceId' => '123',
    'customerNo' => '987654',
    'virtualAccountNo' => '123987654',
    'inquiryRequestId' => 'REQ-1',
    'paymentRequestId' => 'PAY-1',
]);
```

All transaction calls accept an optional second argument to override headers (e.g. provide your own `X-EXTERNAL-ID`). The package auto-generates a numeric `X-EXTERNAL-ID` (&lt;=36 chars), and always sends `CHANNEL-ID`, `X-PARTNER-ID`, and optional `ORIGIN`.

Endpoints (fixed)
-----------------

[](#endpoints-fixed)

- Token: `POST /openapi/v1.0/access-token/b2b`
- Inquiry: `POST /openapi/v1.0/transfer-va/inquiry`
- Payment: `POST /openapi/v1.0/transfer-va/payment`
- Payment Status: `POST /openapi/v1.0/transfer-va/status`

Signatures (overview)
---------------------

[](#signatures-overview)

- **Token (asymmetric RSA SHA256):** String to sign = `client_id|X-TIMESTAMP`. Headers: `X-TIMESTAMP`, `X-CLIENT-KEY`, `X-SIGNATURE`.
- **Transactions (HMAC SHA-512):**
    - String to sign = `HTTPMethod:RelativeUrl:AccessToken:lowercase(sha256(minified_body)):Timestamp`
    - `RelativeUrl` starts with `/` and includes sorted query params.
    - Body is JSON-minified; empty body =&gt; empty string hashed.
    - Header set includes `Authorization: Bearer {token}`, `X-TIMESTAMP`, `X-SIGNATURE`, `X-EXTERNAL-ID`, `CHANNEL-ID`, `X-PARTNER-ID`, optional `ORIGIN`.

Notes
-----

[](#notes)

- Bill Presentment (Inquiry) and Payment Flag must be used together; Payment Status is optional and marks code `5002600` as retryable by default.
- Tokens are cached using `client_id` + base URL hash with a safety buffer to avoid near-expiry calls.
- HTTP client uses Laravel `Http` with configurable timeouts and retries; secrets are never logged.

Testing
-------

[](#testing)

Run the feature tests with Orchestra Testbench:

```
composer test
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance67

Regular maintenance activity

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

196d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5470172?v=4)[esolution](/maintainers/esolution)[@esolution](https://github.com/esolution)

---

Top Contributors

[![elgibor-solution](https://avatars.githubusercontent.com/u/783039?v=4)](https://github.com/elgibor-solution "elgibor-solution (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/elgibor-solution-laravel-payment-bca/health.svg)

```
[![Health](https://phpackages.com/badges/elgibor-solution-laravel-payment-bca/health.svg)](https://phpackages.com/packages/elgibor-solution-laravel-payment-bca)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.9k1](/packages/mike-bronner-laravel-model-caching)

PHPackages © 2026

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