Magento Plugin
Accept payments on your Magento 2 store with Omise. Complete support for credit cards, bank transfers, e-wallets, and installments with easy Composer installation.
Overviewโ
Features:
- Magento 2.3.x and 2.4.x support
- Composer installation
- All Omise payment methods
- Multi-store configuration
- Admin order management
- Automatic refunds
- 3D Secure support
- Mobile-optimized checkout
Prerequisitesโ
Requirements:
- Magento 2.3.x or 2.4.x (Note: Magento 2.3 reached EOL in September 2022, 2.4.x recommended)
- PHP 7.2 or higher (PHP 8.2+ compatibility added in v3.8.0)
- Composer installed
- Active Omise account
- SSH or terminal access
- Admin access to Magento
Installationโ
Via Composer (Recommended)โ
# Navigate to Magento root directory
cd /path/to/magento
# Require Omise module
composer require omise/omise-magento
# Enable module
php bin/magento module:enable Omise_Payment
# Run setup upgrade
php bin/magento setup:upgrade
# Compile code
php bin/magento setup:di:compile
# Deploy static content
php bin/magento setup:static-content:deploy
# Clear cache
php bin/magento cache:flush
Manual Installationโ
- Download latest release from GitHub
- Extract to
app/code/Omise/Payment - Run setup commands as above
Configurationโ
Step 1: Access Payment Settingsโ
- Log in to Magento Admin
- Navigate to Stores โ Configuration
- Under Sales, click Payment Methods
- Find Omise Payment Gateway section
Step 2: Configure API Keysโ
Basic Settings:
- Enabled: Yes
- Title: Omise Payment Gateway
- Environment: Sandbox (for testing)
API Configuration:
- Public Key (Test): pkey_test_xxxxx
- Secret Key (Test): skey_test_xxxxx
- Public Key (Live): pkey_live_xxxxx (add later)
- Secret Key (Live): skey_live_xxxxx (add later)
Get API Keys:
- Visit Omise Dashboard
- Go to Settings โ Keys
- Copy test keys for initial setup
- Copy live keys when ready to launch

Step 3: Enable Payment Methodsโ
Credit/Debit Cards:
Enable: Yes
Title: Credit/Debit Card
3D Secure: Enabled
Payment Action: Authorize and Capture
Accepted Cards: Visa, Mastercard, Amex, JCB
Internet Banking:
Enable: Yes
Title: Internet Banking
Supported Banks: All Thai Banks
Instructions: "You will be redirected to your bank"
E-Wallets:
Enable TrueMoney Wallet: Yes
Enable Rabbit LINE Pay: Yes
Enable ShopeePay: Yes
Installments:
Enable: Yes
Minimum Order: 3000 THB
Available Terms: 3, 6, 10 months
Step 4: Configure Webhooksโ
Webhook URL Format:
https://yourstore.com/omise/webhook/callback
Setup in Omise Dashboard:
- Go to Settings โ Webhooks
- Click Add Webhook
- Enter webhook URL
- Select events:
- charge.complete
- charge.failed
- refund.create
- Save webhook
Test Webhook:
# Test webhook endpoint
curl -X POST https://yourstore.com/omise/webhook/callback \
-H "Content-Type: application/json" \
-d '{"key":"charge.complete","data":{"id":"chrg_test_xxx"}}'
Step 5: Order Status Mappingโ
Configure how Omise payment statuses map to Magento order statuses:
Payment Status Mapping:
- Pending โ Pending Payment
- Authorized โ Processing
- Captured โ Processing
- Successful โ Complete
- Failed โ Canceled
- Refunded โ Closed
Custom Status Mapping:
// app/code/Omise/Payment/etc/config.xml
<default>
<payment>
<omise>
<order_status>
<pending>pending_payment</pending>
<successful>processing</successful>
<failed>canceled</failed>
</order_status>
</omise>
</payment>
</default>
Testingโ
Test Mode Setupโ
Configuration:
โ Set Environment to "Sandbox"
โ Use test API keys
โ Enable debug logging
โ Test all payment methods
Test Cardsโ
Successful Payment:
Card: 4242 4242 4242 4242
Expiry: 12/28
CVV: 123
Failed Payment:
Card: 4000 0000 0000 0002
3D Secure Enrollment Failure:
Card: 4111 1111 1115 0002 (Visa)
3D Secure Authentication Failure:
Card: 4111 1111 1114 0003 (Visa)
Test Order Flowโ
-
Create Test Order
- Add product to cart
- Proceed to checkout
- Fill shipping information
- Select Omise payment method
-
Complete Payment
- Enter test card details
- Complete 3D Secure if prompted
- Verify payment success
-
Verify in Admin
- Check order created
- Verify order status
- Check payment details
- Review transaction info
Multi-Store Configurationโ
Separate Configuration Per Storeโ
Store 1 (Thailand):
- Currency: THB
- Payment Methods: All
- API Keys: Thailand account
- Language: English/Thai
Store 2 (Singapore):
- Currency: SGD
- Payment Methods: Cards, Wallets
- API Keys: Singapore account
- Language: English
Configure Per Store View:
- Select store view in scope selector
- Uncheck "Use Website" for settings you want to override
- Enter store-specific values
- Save configuration
Order Managementโ
Viewing Payment Informationโ
Order Details:
- Omise Charge ID
- Payment method used
- Transaction amount
- Transaction date
- Payment status
- Customer billing details
Access Payment Info:
Orders โ Select Order โ Payment Information section
Processing Refundsโ
Full Refund:
- Open order
- Click Credit Memo
- Select items to refund
- Click Refund Offline or Refund
- Omise processes refund automatically
Partial Refund:
- Open order
- Click Credit Memo
- Enter custom amounts
- Add refund reason
- Submit refund
Refund Limitations:
Cards: Refundable within 120 days
Internet Banking: Not refundable
E-Wallets: Varies by provider
Installments: Special process required
Advanced Featuresโ
Payment Captureโ
Automatic Capture (Default):
Payment Action: Authorize and Capture
- Charges immediately
- Funds held for settlement
- Standard flow
Manual Capture:
Payment Action: Authorize Only
- Authorizes payment
- Manual capture later
- For pre-orders
- 7-day authorization period
Manual Capture Process:
1. Order placed (authorized only)
2. Review order in admin
3. Click "Invoice"
4. Select "Capture Online"
5. Payment captured
Saved Cardsโ
Enable Saved Cards:
Configuration:
Payment Methods โ Omise โ Credit Card
โ Enable Saved Cards
โ Customer Can Delete Cards
Customer Experience:
- Save card during checkout
- View saved cards in account
- Use saved card for future orders
- Delete cards anytime
Security:
- Cards tokenized by Omise
- No card data stored locally
- PCI compliant
- Secure token storage
Custom Checkout Fieldsโ
Add custom fields to payment section:
// app/code/Omise/Payment/view/frontend/layout/checkout_index_index.xml
<item name="custom-field" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
<item name="config" xsi:type="array">
<item name="customScope" xsi:type="string">omisePayment</item>
<item name="template" xsi:type="string">ui/form/field</item>
<item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
</item>
<item name="provider" xsi:type="string">checkoutProvider</item>
<item name="dataScope" xsi:type="string">omisePayment.custom_field</item>
<item name="label" xsi:type="string" translate="true">Custom Field</item>
<item name="sortOrder" xsi:type="string">1</item>
</item>
Customizationโ
Payment Method Displayโ
Reorder Payment Methods:
Configuration โ Payment Methods
Sort Order:
1. Credit Card (Sort Order: 1)
2. Internet Banking (Sort Order: 2)
3. TrueMoney Wallet (Sort Order: 3)
4. Rabbit LINE Pay (Sort Order: 4)
Custom Payment Titles:
Credit Card: "Pay with Credit/Debit Card"
Internet Banking: "เธเธณเธฃเธฐเธเนเธฒเธเธเธเธฒเธเธฒเธฃ (Bank Transfer)"
TrueMoney Wallet: "TrueMoney Wallet"
Payment Form Customizationโ
Customize the appearance of payment forms to match your store's branding.
Access Form Customization:

Customize Form Elements:

Preview Your Changes:

Custom CSS:
/* app/design/frontend/[Vendor]/[Theme]/web/css/source/_module.less */
.payment-method-omise {
.payment-method-title {
font-weight: bold;
color: #FF5722;
}
.payment-method-content {
padding: 15px;
border: 2px solid #e0e0e0;
}
}
Email Templatesโ
Customize Payment Emails:
Marketing โ Communications โ Email Templates
Create New Template:
- Template: New Order
- Customize payment info section
- Add Omise branding
- Save template
Email Variables:
{{var payment_html}}
{{var order.getPayment().getMethodInstance().getTitle()}}
{{var order.getPayment().getAdditionalInformation('omise_charge_id')}}
Troubleshootingโ
Common Issuesโ
Issue: Module not showing in payment methods
Solution:
1. Clear cache: php bin/magento cache:flush
2. Recompile: php bin/magento setup:di:compile
3. Check module enabled: php bin/magento module:status
4. Verify API keys entered
5. Check Magento logs: var/log/system.log
Issue: Webhook not updating order status
Solution:
1. Verify webhook URL accessible
2. Check webhook configured in Omise Dashboard
3. Review webhook logs in Magento
4. Test webhook manually
5. Check server firewall settings
Issue: Payment failing at checkout
Solution:
1. Check API keys correct
2. Verify payment method enabled in Omise account
3. Check currency supported
4. Review Magento error logs
5. Test in sandbox mode
Issue: Refund not processing
Solution:
1. Verify payment method supports refunds
2. Check refund within allowed timeframe
3. Ensure sufficient settlement balance
4. Review Omise Dashboard for errors
5. Try smaller refund amount
Debug Modeโ
Enable Debugging:
Stores โ Configuration โ Advanced โ Developer
Developer Client Restrictions: No
Logging: Enabled
Omise Payment โ Advanced Settings
โ Debug Mode Enabled
โ Log API Requests
โ Log Webhook Events
View Logs:
# Magento logs
tail -f var/log/system.log
tail -f var/log/exception.log
# Omise specific logs
tail -f var/log/omise.log
Performance Optimizationโ
Checkout Speedโ
Optimize Payment Loading:
โ Enable Magento full page cache
โ Use CDN for payment icons
โ Minimize checkout steps
โ Optimize JavaScript bundling
โ Enable HTTP/2
Reduce Redirects:
โ Use inline card forms
โ Minimize external redirects
โ Optimize webhook response time
โ Cache payment method configurations
Database Optimizationโ
Index Payment Tables:
-- Add index to improve payment queries
ALTER TABLE sales_order_payment ADD INDEX idx_omise_charge_id (last_trans_id);
Clean Old Logs:
# Remove old logs
php bin/magento log:clean --days=30
Security Best Practicesโ
API Key Securityโ
โ Store keys in env.php (not database)
โ Use different keys for test/live
โ Rotate keys regularly
โ Limit admin user access
โ Monitor API key usage
Store Keys in env.php:
// app/etc/env.php
return [
'payment' => [
'omise' => [
'live_public_key' => getenv('OMISE_LIVE_PUBLIC_KEY'),
'live_secret_key' => getenv('OMISE_LIVE_SECRET_KEY'),
]
]
];
Checkout Securityโ
โ Force HTTPS on checkout
โ Enable 3D Secure
โ Implement CAPTCHA
โ Use Magento security scan