Commit Graph

5 Commits

Author SHA1 Message Date
Kazem Alghasi
b25bfda597 feat(core): enhance order processing and bridge integration
Refactor the order and shipment lifecycle across WordPress and Laravel,
improving multi-package handling, payment automation, and frontend
reliability.

- Laravel:
  - Rename `package_number` to `package_no` and `description` to
    `content_description` in `ShipmentPackage` model and controller.
  - Update `PaymentController` to automatically transition approved
    shipments to `Processed` status upon successful payment.
  - Adjust `OrderPaymentService` to validate against `Approved` status
    instead of `PendingPayment`.
  - Expose `/countries` endpoint as a public route (unauthenticated).
  - Remove obsolete `read_excel.php` utility.

- WordPress (Bridge Plugin & Theme):
  - Implement AJAX handler for wallet-based order payments.
  - Update `ifnex-order-form.js` to support multi-package input names
    and auto-select Iran based on shipment direction.
  - Improve error handling and feedback in the order form and country
    loading logic.
  - Add automatic tracking submission when an `awb` parameter is
    present in the URL.
  - Update CSS with `!important` flags to ensure correct visibility
    of form steps and dashboard elements.
  - Implement cache-busting for plugin assets and prevent OPcache
    stale files via header controls.
  - Optimize theme logo loading with eager loading and explicit
    dimensions.
2026-09-09 12:03:58 +03:30
Kazem Alghasi
aa8fb17230 feat: Complete customer ordering and payment system (Phases 1-4) 2026-08-10 13:08:52 +03:30
Kazem Alghasi
2e7f975094 feat(wallet): complete online payment with Zarinpal + mock gateway
- Add ZarinpalService for production payment gateway
- Add MockZarinpalService for testing without real merchant ID
- Add MockGatewayController for simulating payment page
- Add beautiful mock gateway UI with RTL support
- Update PaymentController to switch between mock/real based on config
- Fix double-click bug: prevent re-processing completed transactions
- Add payment-result page with success/failure UI
- All API endpoints tested successfully:
  * balance, transactions, activity-log
  * admin-adjust (deposit/withdrawal)
  * freeze/unfreeze
  * online payment redirect + callback + verify
- Wallet balance verified: 67,700,000 IRR after all transactions
- 5 transactions recorded with correct gateways (manual/zarinpal)

Closes: Payment gateway integration for Phase 2
2026-08-08 00:46:54 +03:30
Kazem Alghasi
78f5919b69 feat(wallet): complete wallet system with admin adjust, freeze/unfreeze, activity logs
- Add Enums: TransactionType, TransactionStatus, PaymentGateway
- Migrations: wallets, wallet_transactions, wallet_activity_logs
- Models: Wallet, WalletTransaction, WalletActivityLog
- Services: WalletService with complete business logic
- Controllers: WalletController, PaymentController
- Filament Resources: WalletResource, WalletTransactionResource
- Artisan Command: ifnex:token for API token generation
- Sanctum integration with statefulApi and exception handling
- Full API endpoints: balance, transactions, admin-adjust, freeze/unfreeze
2026-08-07 22:51:42 +03:30
Kazem Alghasi
50ae20b14a feat(api): implement payment gateway integration
Add Zarinpal configuration options and implement the core payment
infrastructure, including the Payment model, migration, service
layer, and API controller.
2026-08-05 23:49:33 +03:30