A powerful command-line interface for interacting with the Payment Gateway API. Perfect for testing, automation, and quick merchant operations without building a full integration.
Current Status: 80% CompleteCore authentication, merchant management, and API key features are fully functional. Payment operations coming soon.
Sets up environment profiles (dev, staging, production)
2
Select Environment
Copy
? Select environment: ▸ development (http://localhost:8080) staging (https://staging.paymentgateway.com) production (https://paymentgateway.redahaloubi.com)
For testing, select production (live API server).
3
Confirm Configuration
Copy
payment-cli config show
Output:
Copy
📋 Current Configuration━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Environment: productionAPI URL: https://paymentgateway.redahaloubi.comOutput Format: tableColor Enabled: true
? Enter your name: John Merchant? Enter email: [email protected]? Enter password: ********? Confirm password: ********
Output:
Copy
✅ Registration successful!User Details:━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ID: 550e8400-e29b-41d4-a716-446655440000Name: John MerchantEmail: [email protected]Status: pending_verificationℹ️ Please verify your email to access all features.
? Business name: Your Store Inc? Business email: [email protected]? Business type: ▸ corporation llc sole_proprietorship partnership? Website (optional): https://yourstore.com
Output:
Copy
✅ Merchant created successfully!┌──────────────────────────────────────┬─────────────────────┐│ Field │ Value │├──────────────────────────────────────┼─────────────────────┤│ ID │ merchant_abc123 ││ Code │ mch_xyz789def456 ││ Business Name │ Your Store Inc ││ Email │ [email protected]││ Status │ pending_review ││ Created │ 2026-01-24 10:00:00 │└──────────────────────────────────────┴─────────────────────┘ℹ️ Save the merchant ID for API key creation
📋 Your Merchants (2)┌─────────────────┬────────────────┬────────────────────┬───────────────┬──────────┐│ ID │ Code │ Business Name │ Email │ Status │├─────────────────┼────────────────┼────────────────────┼───────────────┼──────────┤│ merchant_abc123 │ mch_xyz789def │ Your Store Inc │ billing@... │ active ││ merchant_def456 │ mch_uvw012rst │ Another Business │ info@... │ active │└─────────────────┴────────────────┴────────────────────┴───────────────┴──────────┘
View detailed merchant information:
Copy
payment-cli merchant get merchant_abc123
Output:
Copy
🏪 Merchant Details━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Basic Information: ID: merchant_abc123 Code: mch_xyz789def456 Business Name: Your Store Inc Email: [email protected] Status: active Type: corporation Website: https://yourstore.comDates: Created: 2026-01-20 10:00:00 Updated: 2026-01-24 15:30:00Owner: Name: John Merchant Email: [email protected]
✅ API Key created successfully!⚠️ SAVE THIS KEY - IT WON'T BE SHOWN AGAIN!┌─────────────────────────────────────────────────────────────────┐│ ││ pk_live_abc123def456ghi789jkl012mno345pqr678stu901vwx234yz ││ │└─────────────────────────────────────────────────────────────────┘Key Details: ID: apikey_xyz789 Name: Production Server Key Prefix: pk_live_ Created: 2026-01-24 10:00:00💡 Add to your environment:export PAYMENT_GATEWAY_API_KEY="pk_live_abc123def456..."
payment-cli apikey list --merchant-id merchant_abc123
Output:
Copy
🔑 API Keys for Your Store Inc (3)┌──────────────────┬─────────────────────┬───────────┬──────────┬─────────────────────┐│ ID │ Name │ Prefix │ Status │ Last Used │├──────────────────┼─────────────────────┼───────────┼──────────┼─────────────────────┤│ apikey_abc123 │ Production Server │ pk_live_ │ active │ 2026-01-24 15:30:00 ││ apikey_def456 │ Staging Server │ pk_test_ │ active │ 2026-01-23 12:15:00 ││ apikey_xyz789 │ Old Key │ pk_live_ │ inactive │ 2026-01-20 09:00:00 │└──────────────────┴─────────────────────┴───────────┴──────────┴─────────────────────┘💡 Use --show-details flag to see creation dates and more info
Disable an API key without deleting:
Copy
payment-cli apikey deactivate apikey_abc123
Output:
Copy
⚠️ Are you sure you want to deactivate this API key?Key Details: Name: Production Server Key Status: activeThis will immediately stop all requests using this key.? Confirm deactivation: (y/N) y✅ API key deactivated successfully🔒 Key can no longer be used for API requests
🔄 Switching environment...From: productionTo: staging✅ Environment switched to stagingNew API URL: https://staging.paymentgateway.com⚠️ You'll need to login again for this environment
# Set output formatpayment-cli config set output json# Enable debug modepayment-cli config set debug true# Disable colorspayment-cli config set color false
┌─────────────────┬────────────────┬────────────────┐│ ID │ Name │ Status │├─────────────────┼────────────────┼────────────────┤│ merchant_abc123 │ Your Store Inc │ active │└─────────────────┴────────────────┴────────────────┘
# 1. Admin logs inpayment-cli login# 2. Invite team member (via Merchant API)# Currently requires API call directly# 3. New user registerspayment-cli register# 4. New user can access merchantpayment-cli merchant list
Register new user accountUsage:payment-cli register [--email EMAIL] [--name NAME] [--password PASSWORD]Interactive: If flags omitted, prompts for input
payment-cli login
Authenticate userUsage:payment-cli login [--email EMAIL] [--password PASSWORD]Interactive: If flags omitted, prompts for input
payment-cli logout
Revoke current sessionUsage:payment-cli logout
payment-cli whoami
Show current user infoUsage:payment-cli whoami
payment-cli merchant create
Create new merchantUsage:payment-cli merchant create [FLAGS]Flags:
--name: Business name
--email: Business email
--type: Business type (corporation, llc, etc.)
--website: Website URL
payment-cli merchant list
List all merchantsUsage:payment-cli merchant list [--format FORMAT]
payment-cli merchant get
Get merchant detailsUsage:payment-cli merchant get {merchant_id}
payment-cli apikey create
Create new API keyUsage:payment-cli apikey create --merchant-id {id} [--name NAME]
payment-cli apikey list
List merchant API keysUsage:payment-cli apikey list --merchant-id {id}
payment-cli config show
Show current configurationUsage:payment-cli config show
payment-cli config use
Switch environmentUsage:payment-cli config use {environment}Environments: development, staging, production