Configuration
Connection page
Section titled “Connection page”Orders > ifthenpay payments > Connection
| Field | What it is |
|---|---|
| Mode | Test (sandbox) uses the documented ifthenpay sandbox endpoints for Multibanco, Payshop and cards. MB WAY has no sandbox at ifthenpay: in test mode it still sends real requests to the phone number you enter. Live uses the production endpoints. |
| MB KEY | Key of your Multibanco dynamic references account (for example ABC-123456). |
| MBWAY KEY | Key of your MB WAY account. It also verifies the signature of the MB WAY notifications. |
| PAYSHOP KEY | Key of your Payshop account. |
| CCARD KEY | Key of your card account (in test mode the sandbox key ifthenpay gives you). |
| BACKOFFICE KEY (optional) | Needed for refunds of MB WAY and card payments, for the payment list (confirms Payshop and card payments when a callback was lost) and for Activate callbacks at ifthenpay. |
| Anti-phishing key | Created by the add-on. ifthenpay sends it with every callback; a callback without it is refused. Tick “Create a new anti-phishing key” to replace it, then activate the callbacks again. |
Only the methods with a key are offered at checkout. Keys are stored encrypted (AES-256-GCM with your store’s key) and are never shown again; leave a field empty to keep the saved key, or tick Remove to delete it.
Callbacks
Section titled “Callbacks”ifthenpay confirms a payment by calling your store (HTTP GET) with the anti-phishing key, the order id, the amount and, depending on the method, the request id, the entity and the reference. The Connection page shows the callback URL of each method with the ifthenpay placeholders ([ANTI_PHISHING_KEY], [ORDER_ID], [AMOUNT], [REQUEST_ID], [ENTITY], [REFERENCE], [PAYMENT_DATETIME], [PAYMENT_METHOD]).
- With the BACKOFFICE KEY: Activate callbacks at ifthenpay registers them for every method you have a key for.
- Without it: send the URLs and the anti-phishing key to ifthenpay support.
ifthenpay accepts callback URLs up to 300 characters; the page warns you if your store address makes one longer.
Payment methods
Section titled “Payment methods”Administration > Payment methods > Add payment method, processor:
| Processor | Settings |
|---|---|
| ifthenpay: Multibanco | Payment description, Days to pay (No expiry, Same day until 23:59, 1-31, 45, 60, 90, 120, 180, 365, 730; default 3) |
| ifthenpay: MB WAY | Payment description. The customer enters the MB WAY mobile number at checkout. |
| ifthenpay: Payshop | Payment description, Days to pay (No expiry or 1-90 days; default 7) |
| ifthenpay: Credit card | Payment description |
You can use the payment method’s own fields (name, icon, surcharge, instructions) as usual.
Add-on settings
Section titled “Add-on settings”| Setting | Default | Meaning |
|---|---|---|
| Enable | On | Off: no new payments start; callbacks, read-backs, expiry and refunds of payments under way still run. |
| Marketplace owner mode (Multi-Vendor) | On | On: one ifthenpay contract for the marketplace. Off: each vendor enters their keys in the vendor panel. |
| Order status when the payment arrives | Processed | Set when ifthenpay confirms the payment. |
| Order status while a Multibanco or Payshop reference waits for the payment | Open | Choose a status that reserves the stock. |
| Order status when the payment failed | Failed | MB WAY declined or not approved within 4 minutes, card error. |
| Order status when the customer cancelled | Canceled | MB WAY rejected in the app, card page left with “cancel”. |
| Order status when a Multibanco or Payshop reference expired unpaid | Canceled | “-” leaves the order alone. |
| Grace days after a reference expires | 1 | Days to wait after the expiry date before the reference is read back once more and treated as expired. |
| Refund in full when the order status becomes | - | MB WAY and card payments only (needs the BACKOFFICE KEY). |
| Debug log | Off | Stores each call to ifthenpay with its masked request and answer (no keys, e-mail addresses, names or phone numbers). |
| Log retention (days) | 90 | |
| Permanently delete all payment records on uninstall | Off | See Installation. |
The queue reads pending payments back on a schedule (lost callback, customer who left the MB WAY page), expires references and sends status refunds. Run it every 5 minutes:
- Command line:
php /path/to/store/admin.php --dispatch=kv_ifthenpay_payments.cron - or the secret URL shown in the add-on settings (Cron).
The read-back is spaced out on purpose (ifthenpay warns that abusing the production API can lock the account): MB WAY 2, 5, 10 and 20 minutes after the request; cards 15 minutes, 1, 3 and 12 hours (needs the BACKOFFICE KEY); references 30 minutes, 2 and 6 hours, then once a day while the reference can be paid.