Contents
- Short Description
- Key Points
- Main Points with Description (1–9)
- Notes for Reviewers
Short Description
PayNow Odoo Logistics connects an Odoo eCommerce store to Taiwan's PayNow logistics network. It lets customers choose a convenience-store or courier pickup point (7-Eleven, FamilyMart, Hi-Life/Laerfu, OK Mart, Black Cat courier) at checkout, and automatically submits the shipping order to the PayNow API encrypted and hashed as PayNow requires as soon as the delivery is confirmed. Every request and response is logged for troubleshooting, and the returned tracking number is written straight back onto the delivery.
Key Points
- Adds a PayNow delivery method type alongside a PayNow COD (Cash on Delivery / "onsite") payment provider option.
- Lets shoppers pick a specific store/locker (store ID, name, address) on the storefront and carries that choice through checkout.
- Automatically calls the PayNow Add Order API when a delivery is confirmed, using either Triple DES (3DES) encryption or SHA-1 hashing depending on the endpoint.
- Supports both Sandbox/Test and Production PayNow environments per delivery carrier.
- Keeps a full audit log of every request sent, its encrypted payload, and PayNow's response.
- Ships pre-configured delivery carriers for the major Taiwanese pickup networks.
- Includes storefront JavaScript that enforces "you must select a pickup store before paying."
Main Points with Description
1. Delivery Carrier Extensions
Extends Odoo's delivery.carrier model with PayNow-specific fields: an API key, a user/merchant account, a PayNow service code, a delivery mode (pick up and pay, or pick up without payment), and an environment switch (Sandbox/Test vs Production). A new paynow delivery type is registered so these carriers appear as a distinct shipping option in Odoo.
2. Payment Provider Extension
Adds a PayNow COD option to Odoo's payment.provider model, so "pay on pickup / cash on delivery" can be offered as a payment method tied to the PayNow delivery flow.
3. Pre-Loaded Delivery Networks
Ships ready-made carrier and product records (via data files) for the common Taiwanese logistics networks, each split into a "pick up and pay" and "pick up without payment" variant:
- Black Cat (黑貓) Home Delivery
- 7-Eleven Easy Delivery
- FamilyMart Store
- Laerfu (Hi-Life) Store
- OK Store-to-Store
4. Storefront Store/Locker Selection
Website checkout is extended so a customer's selected pickup store (ID, name, address) and chosen PayNow logistics service are captured on the sale order (store_id, store_name, store_address, paynow_service). A controller endpoint (/paynow/logistic/selected_carrier) receives the carrier selection from the page, and frontend JavaScript reveals/hides related fields and toggles the "Pay on site" payment option based on that selection.
5. Checkout Payment Guard
A payment-form JavaScript override blocks checkout submission with a warning ("Please select a delivery store") if the customer picked a PayNow/onsite delivery type but hasn't actually chosen a pickup store yet preventing incomplete orders from reaching payment.
6. Automated Shipping Order Submission
When a stock transfer (stock.picking) tied to a PayNow-enabled carrier is confirmed, the module automatically:
- Builds the order payload (sender/receiver details, store info, amount, service code, delivery mode, etc.).
- Computes a SHA-1 PassCode from the account, order number, amount, and password for request integrity.
- Encrypts the full JSON payload with Triple DES (ECB mode).
- Posts the encrypted payload to PayNow's Add Order API using the Production or Sandbox URL depending on the carrier's configured environment.
- Parses the response and writes the returned LogisticNumber onto the delivery as the tracking reference.
7. API Key Encryption Utility
A separate helper on the delivery carrier can encrypt the stored PayNow API key on demand using 3DES, for cases where an encrypted (rather than raw) credential needs to be shared with PayNow or displayed.
8. Logistics Request Log
Every API call is recorded in a new Logistics Request model, storing the outgoing request body, the encrypted payload sent, PayNow's raw response, the linked delivery (picking), and a timestamp giving support staff a way to audit or debug failed shipping submissions without digging through server logs.
9. Localization
Includes a Traditional Chinese (zh_TW) translation file, reflecting the module's primary market (Taiwan).
Notes for Reviewers
A few implementation details are worth a second look before production use
- Hard-coded encryption password/key fragments appear directly in the code (delivery_carrier.py, stock_picking.py) rather than being pulled from configuration this should be moved to a secure settings field per deployment.
- Several debug print() statements and a raw credential printed to console remain in delivery_carrier.py and stock_picking.py; these should be removed or converted to _logger.debug() calls before going live.
- The receiver-address concatenation logic in stock_picking.py has an operator-precedence bug (the conditional if/else chain doesn't group as likely intended), which may produce a malformed address string.