krishna035 / icici-bank-corporate-api
PHP implementation for integrating with ICICI Bank Corporate API.
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2025-06-23 11:00:28 UTC
README
This repository provides a PHP implementation for integrating with the ICICI Bank Corporate API. It includes a core API class ICICIBankCorporateAPI
for handling various ICICI Bank services such as CIB Registration, Dealer Balance Check, Dealer Collection, and Payment Status Inquiry. Additionally, a sample script is provided to demonstrate how to use the API class.
Table of Contents
Installation
-
Clone this repository to your local environment:
git clone https://github.com/krishna035/icici-bank-corporate-api-php.git
-
Ensure you have the necessary SSL certificates and public keys for ICICI Bank's Sandbox and Live environments.
-
Set up your server or local environment to run PHP scripts.
Usage
Configuration
Before using the API, you must configure your credentials and paths in the ICICIBankCorporateAPI
class.
-
Client ID and Client Secret: Replace the placeholders with your actual Client ID and Client Secret for both Sandbox and Live environments.
$this->clientId = 'YOUR_SANDBOX_CLIENT_ID'; $this->clientSecret = 'YOUR_SANDBOX_CLIENT_SECRET';
-
Certificate Paths: Replace the placeholder paths with the actual file paths where your certificates and public keys are stored.
$this->caCertPath = '/path/to/your/certificates/YOUR_SANDBOX_CERTIFICATE.pem'; $this->publicKey = file_get_contents('/path/to/your/certificates/YOUR_SANDBOX_PUBLIC_KEY.cer');
Example Test Cases
The ICICICorporateAPITestCases.php
script provides example usage of the ICICIBankCorporateAPI
class. It includes several test cases for common API requests.
- Running the Example Script:
- Open
ICICICorporateAPITestCases.php
. - Modify the
$testCase
variable to select the desired test case (e.g.,'CIBRegistration'
,'DealerBalanceCheck'
, etc.). - Run the script on your server or local environment:
php ICICICorporateAPITestCases.php
- The script will output the request payload and the API response.
- Open
API Methods
CIB Registration
Registers a customer for Corporate Internet Banking (CIB).
- Method:
CIBRegistration($payload)
- Payload Parameters:
AGGRNAME
: Aggregator NameAGGRID
: Aggregator ID (random for testing)CORPID
: Corporate IDUSERID
: User IDURN
: Unique Reference Number
Dealer Balance Check
Checks the balance for a dealer.
- Method:
DealerBalanceCheck($payload)
- Payload Parameters:
CORPID
: Corporate IDUSERID
: User IDAGGRID
: Aggregator IDAGGRNAME
: Aggregator Name
Dealer Collection
Processes a dealer collection transaction.
- Method:
DealerCollection($payload)
- Payload Parameters:
CORPID
: Corporate IDUSERID
: User IDDEBITACCT
: Debit Account NumberCREDITACCT
: Credit Account NumberTXN_AMOUNT
: Transaction AmountTXN_CURRENCY
: Transaction Currency (e.g.,INR
)URN
: Unique Reference NumberAGGR_ID
: Aggregator IDUNIQUE_ID
: Unique Transaction ID (use thegenerateRandomKey
method to create this)
Payment Status Inquiry
Inquires about the status of a payment transaction.
- Method:
PaymentStatusInquiry($payload)
- Payload Parameters:
AGGRID
: Aggregator IDCORPID
: Corporate IDUSERID
: User IDUNIQUEID
: Unique Transaction ID (same as used inDealerCollection
)URN
: Unique Reference Number
Contributing
We welcome contributions to improve this library! Please fork this repository and submit a pull request with your changes.