| arifpay_requests.ps1 | ||
| calls.ps1 | ||
| chapa_requests.ps1 | ||
| demo.mp4 | ||
| fortune_tests.ps1 | ||
| fortune.ps1 | ||
| FortuneBetAPI.ps1 | ||
| README.md | ||
| report_request_calls.ps1 | ||
Fortune Tester
This is a tiny powershell script that i use to test the backend quickly. It probably would be better have unit and integration tests on the backend directly but alas, there is never any time to do something like this.
You will need for fzf (use scoop / choco) and PSFzf
⚙️ Requirements
You’ll need:
-
PowerShell (obviously)
-
fzf (for interactive selection)
- Install via
scoop install fzforchoco install fzf
- Install via
-
PSFzf (PowerShell integration for fzf)
🚀 Getting Started
Load the CLI helpers:
. ./fortune.ps1
Then launch the interactive test menu:
. ./fortune_tests.ps1
This will open an fzf selector listing all available test functions.
🧠 How It Works
- Every function inside
fortune_tests.ps1is automatically registered - The
Mainfunction scans and feeds them intofzf - You select a function → provide params → it runs
🔐 Authentication Helpers
These functions log you in and store tokens globally for reuse:
LoginClientLoginAdminLoginSuper
They automatically populate:
$Global:FortuneBetToken$Global:FortuneBetRefreshToken
So you don’t have to manually copy tokens
📡 Core Command
Everything ultimately goes through:
fortune call <METHOD> <PATH> [-Tenant] [-Body @{...}]
Example
fortune call GET "leagues" -Tenant
🧪 Adding New Tests
Add a new function inside fortune_tests.ps1:
function MyNewTest {
fortune call GET "some-endpoint" -Tenant
}
That’s it. It will automatically appear in the selector.
🧩 Available Test Categories
Payments
- CryptoPay (deposit, withdrawal)
- Chapa (deposit, banks, withdrawal)
- ArifPay (checkout)
Direct Deposits
- Create / Approve / Reject
- Bank cycling
- Account management
Betting
- Event → Odds → Selection pipeline (
EventOddPipe) - Bet placement (
CreateBet)
Virtual Games
- Providers
- Game listing
- Demo launch
Admin / Super Admin
- Bank management
- Direct deposit bank setup
🔄 Token Refresh
fortune refresh
Uses the stored refresh token to get a new access token.
🧱 Environment Variables
Defined in fortune.ps1:
$Global:ApiBase = "http://127.0.0.1:8080/api/v1"
$Global:TenantSlug = "fortunebets"
Change these if you’re pointing to a different environment.
💡 Why This Exists
Because postman takes alot of RAM