Skip to content

Create Sandbox Mode API Behavior#141

Open
innovativedesign-lab wants to merge 2 commits into
Pidoko257:mainfrom
innovativedesign-lab:sandbox-mode
Open

Create Sandbox Mode API Behavior#141
innovativedesign-lab wants to merge 2 commits into
Pidoko257:mainfrom
innovativedesign-lab:sandbox-mode

Conversation

@innovativedesign-lab

Copy link
Copy Markdown

Close: #104

Description

  1. **Added a database migration file 20260630_add_sandbox_mode.sql to add is_sandbox columns to both the api_keys and transactions tables.
  2. Updated src/auth/apikeys.ts to add an isSandbox property to the ApiKey interface and CreateApiKeyOptions .
  3. Updated src/middleware/auth.ts to fetch the is_sandbox flag from api_keys table and attach it to the request object.
  4. Created a new sandbox service in src/services/sandbox/sandboxService.ts that:
    • Maps phone numbers to specific outcomes (success, insufficient funds, timeout).
    • Provides functions to simulate both mobile money and Stellar payments.
  5. Updated src/models/transaction.ts 's TRANSACTION_SELECT_COLUMNS , mapTransactionRow , and create to support isSandbox .
  6. Updated src/controllers/transactionController.ts 's processTransactionRequest function to pass isSandbox to TransactionModel.create and to use it.
  7. Updated src/queue/worker.ts to use the sandbox service when the transaction is marked as a sandbox transaction.
    All tasks are done! The sandbox mode is now implemented!

Related Issue

Fixes #104

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Code refactoring
  • Performance improvement

Changes Made

Testing

How did you test these changes?

Checklist

  • Code follows project style
  • Self-reviewed my code
  • Commented complex code
  • Updated documentation
  • No new warnings
  • Added tests (if applicable)

Screenshots (if applicable)

Additional Notes

@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@innovativedesign-lab Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Sandbox Mode API Behavior

1 participant