1.3 KiB
1.3 KiB
Alfa Bank SDK Examples
This directory contains executable PHP scripts demonstrating various features of the SDK.
How to Run
1. Standalone (CLI)
You can run any script directly from the terminal if you have PHP installed.
Ensure you have run composer install in the SDK root first.
cd alfa-bank-sdk
php examples/01_baas_flow.php
2. Laravel Tinker
Most examples are designed to be copy-paste friendly for php artisan tinker.
General Steps:
- Open your Laravel project terminal.
- Run
php artisan tinker. - Instead of the manual
AlfaBank::baas(...)initialization, use the Laravel helper:$baas = app(\Apoloz\AlfaBank\Core\AlfaBankConnector::class); $baas->login(); // Or refresh token - Copy the rest of the logic (DTO creation, signing, sending) from the example file.
Dedicated Tinker Workflow:
See 17_laravel_tinker_scoring_creation.php for a complete, copy-paste ready workflow for creating beneficiaries.
Key Examples
- 01_baas_flow.php: Basic setup and connection check.
- 13_h2h_auth_service.php: How to get your first OAuth token.
- 14_generate_client_secret.php: If you lost your Client Secret.
- 15_nominal_accounts_list.php: Fetching lists (Beneficiaries).
- 17_laravel_tinker_scoring_creation.php: START HERE for Nominal Accounts integration.