A delightfully simple PHP wrapper for Investec's Private Banking and ICIB APIs. This wrapper simplifies API integration, handles authentication seamlessly, and empowers developers to build festive solutions! 🎅
Dear Santa, I want an API wrapper that:
- 🎁 Works with both Private Banking and ICIB
- 🎅 Handles OAuth automatically
- 🦌 Simple, fluent interface
- 🔒 Built-in error handling
- 🔄 Automatic token refresh
- ⚡ Rate limiting with backoff
- 🎨 Has clear examples
Make sure you have:
- PHP 7.4 or higher - Download and install PHP
- Composer - Download and install Composer
- Docker - Download and install Docker
- Clone the sandbox repository:
git clone https://github.com/devinpearson/programmable-banking-sim.git
cd programmable-banking-sim
npm install
- Run the server in a Docker container:
docker build -t investec-sim .
docker run -p 3000:3000 investec-sim
- Start the simulator:
npm run dev
Your sandbox will run at http://localhost:3000
- Install the wrapper via Composer:
composer require melodymbewe/investec-api-wrapper
Create a .env
file in your project's root:
CLIENT_ID=your-client-id
CLIENT_SECRET=your-client-secret
API_KEY=your-api-key
BASE_URL_PRIVATE_BANKING=https://api.investec.com/za/pb/v1
BASE_URL_ICIB=https://api.investec.com/za/icib/v1
use MelodyMbewe\InvestecApiWrapper\Client;
// Initialize the client
$client = new Client(
'your-client-id',
'your-client-secret',
'your-api-key',
'https://api.investec.com/za/pb/v1', // Private Banking endpoint
'https://api.investec.com/za/icib/v1' // ICIB endpoint
);
// Private Banking Magic 🎁
$accounts = $client->getPrivateBankingAccounts();
$balance = $client->getPrivateBankingBalance($accountId);
// ICIB Magic 🎅
$corporateAccounts = $client->getICIBAccounts();
$corporateBalance = $client->getICIBBalance($accountId);
For a full test of all features, use the provided test script:
php run-test.php
If you encounter errors:
-
Check your credentials in
.env
-
Ensure you have the required PHP extensions:
php -m | grep -E "curl|json|openssl"
-
Verify your PHP version:
php -v
For detailed examples, see:
startLine: 1
endLine: 47
##📝 License This project is licensed under the MIT License. See the LICENSE file for details.
🎄 A Festive Note This project is a mock environment, perfect for testing and developing your next big idea. Let’s make this season brighter with amazing tech! ✨