Troubleshooting Magento 2 Integration
This diagnostic guide covers common issues when installing, configuring, or upgrading the official Amwal Payments module on Adobe Commerce (Magento 2).
1. Module Compilation or DI Errors
Symptom
Running bin/magento setup:di:compile fails with Class Amwal\Payment\Model\... does not exist or Interception cache generation failed.
Resolution
Execute the full clean compilation sequence from your Magento root directory:
# 1. Ensure module is registered
php bin/magento module:enable Amwal_Payments
# 2. Update database schemas
php bin/magento setup:upgrade
# 3. Clean generated code and caches
rm -rf generated/code/* generated/metadata/* var/cache/* var/page_cache/* var/view_preprocessed/*
# 4. Re-compile Dependency Injection
php bin/magento setup:di:compile
# 5. Deploy static view files
php bin/magento setup:static-content:deploy -f
# 6. Flush cache
php bin/magento cache:flush2. Credit Memo & Online Refund Failures
Symptom
Clicking Refund inside a Magento Credit Memo displays an error or fails to credit the customer.
Root Causes & Fixes
-
Missing or Invalid Secret Key:
- Online refunds require your private Secret Key (not the public Merchant ID).
- Go to Stores → Configuration → Sales → Payment Methods → Amwal and confirm the Secret Key field is populated.
-
Online vs. Offline Refund Selection:
- Clicking Refund Offline only records a credit memo in Magento's database and does not notify the Amwal gateway or reverse customer funds.
- Always click the orange Refund button to trigger automatic gateway reversals. See Magento Online Refunds.
-
SAMA Scheme Timeframe Expiration:
- Mada Cards: SAMA limits debit card scheme reversals to 30 days from original authorization.
- Visa / Mastercard: Reversals permitted up to 60 days.
- If an order is older than the scheme limit, you must issue an offline manual bank transfer to the customer.
3. Orders Stuck in "Pending Payment"
Symptom
Customer completes bank installment authorization, but the order remains in Pending Payment in Magento Admin.
Resolution
- Verify Magento Cron Job Execution:
- Amwal runs an automated hourly background task to synchronize pending orders. Verify your server's cron is running:
php bin/magento cron:run - Inspect Amwal Logs:
- Check
var/log/amwal.logandvar/log/system.logfor gateway synchronization errors or 3DS timeout responses.
- Check
- Verify Webhook Status:
- Navigate to Stores → Configuration → Sales → Payment Methods → Amwal → Webhooks Setting.
- Ensure Enable Webhooks is set to
Yesand Private Key Status displays✓ Private key is securely stored.
4. Installments or Apple Pay Hidden on Checkout
Symptoms
- 0% Bank Installments does not appear in checkout.
- Apple Pay button does not render on Safari / iOS devices.
Checklist
| Setting | Requirement | Fix |
|---|---|---|
| Module Type | Pro (Recommended) | If set to Lite, installment buttons are restricted strictly to checkout. Switch to Pro for product page widgets. |
| Minimum Amount | Order total ≥ 1,000 SAR | Bank installment plans require a minimum checkout basket threshold (typically 1,000 SAR). |
| Store Currency | SAR (Saudi Riyal) | Verify that Saudi Riyal (SAR) is allowed under Stores → Configuration → General → Currency Setup. |
| Credit Card BINs | Valid BIN List | If Credit Card BIN Codes is populated under Promotions, ensure it includes the customer's card prefix (e.g. 545454, 424242). |
| Apple Pay Domain | HTTPS & Safari | Apple Pay requires an active SSL certificate (HTTPS) and an Apple Pay-compatible browser (Safari on macOS/iOS). |
5. Multi-Store Scoping & Merchant ID Mismatches
Symptom
Transactions in Store View B are credited to Store View A's Merchant Account.
Root Cause
Configuration was applied at the "Default Config" global level instead of individual Website or Store View scopes.
Resolution
- In Magento Admin, go to Stores → Configuration → Sales → Payment Methods → Amwal.
- In the top-left Scope selector, choose your specific Saudi Store View.
- Uncheck Use Default and enter the distinct Merchant ID and Secret Key provisioned for that store entity.
- Save and flush cache (
bin/magento cache:flush).
Related Guides
Troubleshooting WooCommerce Integration
Diagnostic guide for resolving WooCommerce order status synchronization, cURL SSL errors on shared hosting, refund API secret requirements, and WordPress caching conflicts.
Troubleshooting Settlement & Payout Delays
Understanding the T+2/T+3 settlement cycle, SARIE interbank transfer schedules, SAMA compliance verifications, and ZATCA VAT tax invoice downloads.
