Little powershell script that i use to make it easier to test the backend (without booting up the frontends).
Go to file
2026-04-06 14:01:26 +03:00
arifpay_requests.ps1 initial commit 2026-04-06 13:57:08 +03:00
calls.ps1 initial commit 2026-04-06 13:57:08 +03:00
chapa_requests.ps1 initial commit 2026-04-06 13:57:08 +03:00
demo.mp4 initial commit 2026-04-06 13:57:08 +03:00
fortune_tests.ps1 initial commit 2026-04-06 13:57:08 +03:00
fortune.ps1 initial commit 2026-04-06 13:57:08 +03:00
FortuneBetAPI.ps1 initial commit 2026-04-06 13:57:08 +03:00
README.md fix: README demo video 2026-04-06 14:01:26 +03:00
report_request_calls.ps1 initial commit 2026-04-06 13:57:08 +03:00

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

Youll need:

  • PowerShell (obviously)

  • fzf (for interactive selection)

    • Install via scoop install fzf or choco install fzf
  • 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.ps1 is automatically registered
  • The Main function scans and feeds them into fzf
  • You select a function → provide params → it runs

🔐 Authentication Helpers

These functions log you in and store tokens globally for reuse:

  • LoginClient
  • LoginAdmin
  • LoginSuper

They automatically populate:

  • $Global:FortuneBetToken
  • $Global:FortuneBetRefreshToken

So you dont 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
}

Thats 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 youre pointing to a different environment.


💡 Why This Exists

Because postman takes alot of RAM