sandbox mode

Setup Guide

Configure your toyyibPay integration

⚠️

Currently in SANDBOX mode. Use sandbox credentials from dev.toyyibpay.com for testing.

⚙️ Current Configuration

Mode
sandbox
Base URL
https://dev.toyyibpay.com
API URL
https://dev.toyyibpay.com/index.php/api
Secret Key
••••••••••••••••
Category Code
••••••••••••••••

🚀 Quick Start

  1. 1

    Register at toyyibPay

    Create account at dev.toyyibpay.com (sandbox) or toyyibpay.com (production)

  2. 2

    Get Secret Key

    Find your User Secret Key at the bottom of your dashboard

  3. 3

    Create Category

    Create a category via dashboard or API to get Category Code

  4. 4

    Update app.py

    Replace YOUR_SANDBOX_SECRET_KEY and YOUR_SANDBOX_CATEGORY_CODE

📝 Configuration Code

Update these values in app.py:

CONFIG = {
    "sandbox": {
        "base_url": "https://dev.toyyibpay.com",
        "api_url": "https://dev.toyyibpay.com/index.php/api",
        "secret_key": "YOUR_SANDBOX_SECRET_KEY",      # ← Replace this
        "category_code": "YOUR_SANDBOX_CATEGORY_CODE", # ← Replace this
    },
    "production": {
        "base_url": "https://toyyibpay.com",
        "api_url": "https://toyyibpay.com/index.php/api",
        "secret_key": "YOUR_PRODUCTION_SECRET_KEY",
        "category_code": "YOUR_PRODUCTION_CATEGORY_CODE",
    }
}

🔌 API Reference

Endpoints used in this demo:

Endpoint Purpose Key Parameters
/api/createCategory Create bill category catname, catdescription, userSecretKey
/api/createBill Generate payment bill categoryCode, billName, billAmount, billReturnUrl, billCallbackUrl
/api/getBillTransactions Check payment status billCode, billpaymentStatus (optional)
/api/getCategoryDetails Get category info userSecretKey, categoryCode
/api/inactiveBill Deactivate a bill secretKey, billCode

📖 View Full API Documentation →