Stripe Expense Cards Demo
Testing and demo tools for Stripe Issuing integration
The Expense cards: Demo module is a tool for testing and demonstrating Stripe Issuing integration with Odoo's Expense system without real money.
With the ability to simulate card transactions, physical card shipping, and top-ups, this module helps developers, QA testers, and sales demo expense card features safely and effectively.
Purpose of Use
Key points
• Simulate card transactions without real money
• Test expense creation process from card transactions
• Demo expense card features for customers
• Test physical card lifecycle (shipping, activation, usage)
• Test multi-currency conversion
Who Should Use This Module
Target Users
| Role | Usage Purpose |
|---|---|
| Developers | Test Stripe integration, check code |
| QA Testers | Test expense card features, test cases |
| Sales/Demo | Demo features for potential customers |
| Expense Managers | Familiarize with system before real use |
Demo Terminology
| Fields | Trường dữ liệu | Description |
|---|---|---|
| Simulate Purchase | Mô phỏng mua hàng | Create test transaction |
| Simulate Shipping | Mô phỏng vận chuyển | Manage card shipping status |
| Test Purchase | Giao dịch thử nghiệm | Transaction in test mode |
| Force Capture | Chốt giao dịch trực tiếp | Capture without prior authorization |
| Split Capture | Chốt giao dịch chia đôi | Capture in 2 times |
| Authorization Method | Phương thức ủy quyền | Payment method (Online, Chip, Contactless, Swipe) |
Activating Demo Features
To use demo features, need to enable Technical Features for user account.
Key points
• After enabling, demo buttons will appear on expense card form
• Only users with Technical Features can see these buttons
Steps
1. Go to Settings → Users & Companies → Users
2. Open your user profile
3. Access Rights tab
4. Check Technical Features
5. Click Save
Simulating Purchase Transactions
Create test transactions to check automatic expense creation process.
Steps
1. Go to Expenses → Expense cards → Cards
2. Open card to test (Active status)
3. Click "Simulate Purchase" button
4. Fill information: Amount, Currency, Merchant Name, Authorization Method
5. Check "Capture if approved" to automatically capture transaction
6. Click "Test Purchase"
7. Check expense created at Expenses → My Expenses
Advanced Transaction Options
Key points
• Add ATM fee: Fill ATM Fee to simulate withdrawal with fee
• Add cashback: Fill Cashback Amount to simulate transaction with refund
• Force Capture: Check "Simulate a Force Capture" to capture directly without authorization (bypass balance check)
• Split Capture: Check "Capture in two transactions" to capture in 2 times (50% each, creates 2 separate expenses)
• Capture surcharge: Fill Capture Surcharge to add surcharge when capturing (e.g., tip)
Testing Multi-Currency
Simulate transactions with currency different from card currency to test conversion.
Steps
1. Open "Simulate Purchase" wizard
2. Select Currency different from card currency (e.g., USD card, buy with EUR)
3. Fill Amount in currency (e.g., 100.0 EUR)
4. Click "Test Purchase"
5. System converts EUR to USD at current exchange rate
6. Expense displays both original amount (EUR) and card amount (USD)
Payment Methods
Authorization Methods
| Method | When to Use |
|---|---|
| Online | Online transaction (default) |
| Chip | Chip payment at store |
| Contactless | Contactless payment (NFC) |
| Swipe | Magnetic stripe swipe |
| Keyed in Manually | Manually enter card number |
Simulating Physical Card Shipping
Test physical card shipping lifecycle from order to delivery.
Steps
1. Go to Expenses → Expense cards → Cards
2. Open physical card
3. Click "Simulate Shipping" button
4. Select new status: Submit for shipping, Mark as shipped, Mark as delivered, Mark as returned, Mark as delivery failed
5. Click "Update Shipping Status"
6. System automatically transitions through intermediate states if needed
Automatic Shipping Workflow
When selecting target status, system automatically handles intermediate steps.
Key points
• Example: Select "Mark as delivered" from "Pending" status
• System automatically: Pending → Submitted → Shipped → Delivered
• You only select final status, system handles intermediate steps
Shipping States
| Fields | Trường dữ liệu | Description |
|---|---|---|
| Pending | Đang chờ | Card not yet sent |
| Submitted | Đã gửi | Shipping request submitted |
| Shipped | Đã vận chuyển | Card in transit |
| Delivered | Đã giao | Card delivered to recipient |
| Returned | Đã trả lại | Card returned |
| Failed | Giao hàng thất bại | Delivery failed |
| Canceled | Đã hủy | Shipping canceled |
Simulating Top-up
In test mode, can simulate adding funds to Stripe account without real money.
Key points
• Go to Expenses → Expense Cards → Top-up
• Enter amount to add
• Select test payment method
• Confirm and complete
• Balance updates immediately in test mode
Test Scenarios
Test Cases
| Scenario | How to Test |
|---|---|
| Basic successful transaction | Simulate Purchase with default info, check expense auto-created |
| Transaction exceeds limit | Simulate Purchase with Amount > Spending Limit, check declined |
| Multi-currency transaction | Simulate Purchase with different Currency, check conversion |
| Transaction with ATM fee | Simulate Purchase with ATM Fee, check total includes fee |
| Split transaction | Simulate Purchase with Split Capture, check 2 expenses created |
| Complete card shipping | Simulate Shipping from Pending → Delivered, check states |
| Failed delivery | Simulate Shipping → Mark as delivery failed, check error handling |
Practical Usage Tips
Key points
• Always use test mode: Ensure Stripe is in test mode to avoid real transactions
• Check expenses after each transaction: Confirm expense created correctly with transaction info
• Test edge cases: Exceed limits, multi-currency, ATM fees, split capture
• Demo for customers: Prepare clear demo script, test beforehand
• Clean test data: Delete test expenses after completion to avoid confusion
• Document results: Save test results to compare with production
Important Notes
Key points
• Only use in test mode: This module only works with Stripe test mode
• No impact on real data: All transactions are test, no real money spent
• Requires Technical Features: Must enable Technical Features to see demo buttons
• Separate test data: Test data not mixed with production data
• Test mode limitations: Some Stripe features may differ between test and production
Test Mode vs Production Differences
Test vs Production Comparison
| Aspect | Test Mode | Production Mode |
|---|---|---|
| Real money | No | Yes |
| Transactions | Simulated | Real |
| Card shipping | Simulated | Real (5-10 days) |
| Balance | Unlimited | Requires real top-up |
| Limit checks | Can bypass (Force Capture) | Always checked |
| Data | Separate | Separate |
Complete Testing Workflow
Steps
1. Configure Stripe test mode and create test card
2. Enable Technical Features for test account
3. Simulate card shipping: Pending → Delivered
4. Simulate basic transaction: check expense auto-created
5. Test advanced options: ATM fee, cashback, split capture
6. Test multi-currency: transaction with different currency
7. Test limits: transaction exceeding spending limit
8. Confirm all expenses created correctly
9. Clean up test data