|
| 1 | +--- |
| 2 | +title: "Pay Later / Pay Against Invoice" |
| 3 | +sidebar_label: "Pay Later" |
| 4 | +sidebar_position: 10 |
| 5 | +description: "Allow customers to complete payment for an unpaid order after checkout by showing a Pay Now button on their order history page." |
| 6 | +--- |
| 7 | + |
| 8 | +# Pay Later / Pay Against Invoice |
| 9 | + |
| 10 | +The **Pay Later** app adds a **Pay Now** button to the customer's order history page. When a customer places an order but does not immediately complete payment — for example, when using a bank transfer or invoice gateway — this button lets them return and pay at any time within a window you define. |
| 11 | + |
| 12 | +This is especially useful for stores that offer invoice-based purchasing, bank transfer, or any payment method that is not processed in real time at checkout. |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | + |
| 16 | +- J2Commerce is installed and enabled |
| 17 | +- At least one payment method plugin is installed and enabled |
| 18 | + |
| 19 | +## Purchase and Download |
| 20 | + |
| 21 | +**Step 1:** Go to our [J2Commerce website](https://www.j2commerce.com/) -> **Apps** |
| 22 | + |
| 23 | +**Step 2:** Locate the `app_profileorder` app -> click **View Details** -> **Add to cart** -> **Checkout**. |
| 24 | + |
| 25 | +**Step 3:** Go to your **My Downloads** under your profile button at the top right corner and search for the app. Click **Available Versions** -> **View Files** -> **Download**. |
| 26 | + |
| 27 | +## Install the App |
| 28 | + |
| 29 | +Go to **System** -> **Install** -> **Extensions** |
| 30 | + |
| 31 | +Upload the plugin ZIP file or use the Install from URL option. |
| 32 | + |
| 33 | +<!-- SCREENSHOT: Joomla extension installer screen --> |
| 34 | + |
| 35 | +## Enable the App |
| 36 | + |
| 37 | +Once installed, you need to enable it. There are two ways to access the App. |
| 38 | + |
| 39 | +**Option A:** Go to the **J2Commerce** icon at the top right corner -> **Apps** |
| 40 | + |
| 41 | +**Option B:** Go to **Components** on the left sidebar -> **J2Commerce** -> **Apps** |
| 42 | + |
| 43 | +Search for **Pay Later** in the list, click the **X** to enable it (it turns into a green checkmark). |
| 44 | + |
| 45 | +<!-- SCREENSHOT: Apps list showing Pay Later plugin with enable toggle --> |
| 46 | + |
| 47 | +## Configure the App |
| 48 | + |
| 49 | +Click on the **Pay Later / Pay Against Invoice** title to open the plugin settings. |
| 50 | + |
| 51 | +<!-- SCREENSHOT: Plugin settings screen --> |
| 52 | + |
| 53 | +### Basic Settings |
| 54 | + |
| 55 | +| Setting | Description | Default | |
| 56 | +|---------|-------------|---------| |
| 57 | +| **Show Pay Button After (Seconds)** | How many seconds after the order is placed before the Pay Now button appears. This prevents double-payment when using gateways with delayed callbacks. | `20` | |
| 58 | +| **Pay Button Expires After (Days)** | The number of days after the order is placed when the Pay Now button disappears. Set to `0` for no expiry. | `10` | |
| 59 | +| **Pay Button Text** | The label shown on the Pay Now button. Leave blank to use the default "Pay" text. | *(blank)* | |
| 60 | +| **Order Statuses** | The button only appears for orders with these statuses. Leave empty to show the button for all statuses. | *(all)* | |
| 61 | +| **Debug Mode** | Enable detailed logging to `administrator/logs/app_profileorder.php`. Disable in production. | `No` | |
| 62 | + |
| 63 | +### Configuring Order Statuses |
| 64 | + |
| 65 | +The **Order Statuses** field controls which orders show the Pay Now button. For example, you might only want to show the button when the order status is **Pending** or **Pending Payment**, and not when it is **Completed** or **Cancelled**. |
| 66 | + |
| 67 | +1. Click inside the **Order Statuses** field. |
| 68 | +2. Select one or more statuses from the dropdown. |
| 69 | +3. Leave the field empty to show the button for orders in any status. |
| 70 | + |
| 71 | +<!-- SCREENSHOT: Order Statuses multi-select field with a few statuses selected --> |
| 72 | + |
| 73 | +## How It Works |
| 74 | + |
| 75 | +### Customer Experience |
| 76 | + |
| 77 | +1. A customer places an order and leaves without paying (or uses a payment method that does not immediately confirm payment). |
| 78 | +2. The customer visits **My Account** -> **My Orders** to view their order history. |
| 79 | +3. For eligible orders, a **Pay** button appears in the order row. |
| 80 | + |
| 81 | +<!-- SCREENSHOT: Order history page showing a Pay button next to an unpaid order --> |
| 82 | + |
| 83 | +4. The customer clicks the **Pay** button. A payment selection page opens (in a new window). |
| 84 | + |
| 85 | +<!-- SCREENSHOT: Payment selection page showing available payment methods --> |
| 86 | + |
| 87 | +5. The customer selects a payment method and clicks **Continue**. |
| 88 | +6. An order summary is shown along with the payment plugin form (e.g., credit card form for Stripe). |
| 89 | + |
| 90 | +<!-- SCREENSHOT: Order confirmation page with order summary table and payment form --> |
| 91 | + |
| 92 | +7. The customer completes payment. The order is updated in J2Commerce exactly as if payment had been completed at checkout. |
| 93 | + |
| 94 | +### When the Button Appears |
| 95 | + |
| 96 | +The Pay Now button is shown only when all three of the following conditions are met: |
| 97 | + |
| 98 | +1. The order's status matches one of the configured **Order Statuses** (or all statuses are allowed). |
| 99 | +2. The configured **interval time** has passed since the order was placed — this prevents the button from appearing immediately after checkout while a gateway callback may still be processing. |
| 100 | +3. The order was placed within the configured **expiry days** — the button will not appear for orders older than this limit. |
| 101 | + |
| 102 | +:::info |
| 103 | + |
| 104 | +**Example:** With the default settings (20 seconds delay, 10 days expiry), the button appears on orders that are at least 20 seconds old and no more than 10 days old. |
| 105 | + |
| 106 | +::: |
| 107 | + |
| 108 | +## Tips |
| 109 | + |
| 110 | +- Set a reasonable **interval time** if you use asynchronous payment gateways (PayPal, Stripe webhooks, bank transfer). A value of 60–300 seconds prevents a customer from double-paying before the gateway callback arrives. |
| 111 | +- Set **Pay Button Expires After** to match your invoice payment terms — for example, `30` days if invoices are payable within 30 days. |
| 112 | +- Use the **Order Statuses** filter to restrict the button to only statuses that represent genuinely unpaid orders (e.g., "Pending Payment") and exclude statuses like "Processing" or "Completed". |
| 113 | +- Combine this plugin with an **Invoice** payment method to create a full pay-by-invoice workflow: customers receive an invoice email, then return to pay when ready. |
| 114 | + |
| 115 | +## Troubleshooting |
| 116 | + |
| 117 | +### The Pay Now button does not appear on any orders |
| 118 | + |
| 119 | +**Cause:** The plugin may not be enabled, or no orders match the configured conditions. |
| 120 | + |
| 121 | +**Solution:** |
| 122 | + |
| 123 | +1. Go to **J2Commerce** -> **Apps** and confirm **Pay Later / Pay Against Invoice** is enabled. |
| 124 | +2. Check the **Order Statuses** setting — if specific statuses are selected, ensure the test order has one of those statuses. |
| 125 | +3. Check the **Show Pay Button After (Seconds)** setting — the button will not appear until that many seconds have elapsed since the order was placed. |
| 126 | +4. Check the **Pay Button Expires After (Days)** setting — the order may be older than the configured expiry window. |
| 127 | +5. Clear the Joomla cache: **Home Dashboard** -> **Cache** -> **Delete All**. |
| 128 | + |
| 129 | +### The payment page opens blank or shows an error |
| 130 | + |
| 131 | +**Cause:** The CSRF token may have expired, or the order ID is invalid. |
| 132 | + |
| 133 | +**Solution:** |
| 134 | + |
| 135 | +1. Ask the customer to refresh the order history page to get a fresh token link, then click Pay again. |
| 136 | +2. Ensure the customer is logged in — guest users cannot use this feature. |
| 137 | +3. Enable **Debug Mode** in the plugin settings and check the log at `administrator/logs/app_profileorder.php` for detailed error messages. |
| 138 | + |
| 139 | +### Clicking Pay shows "Invalid order or access denied" |
| 140 | + |
| 141 | +**Cause:** The order does not belong to the currently logged-in user, or the order ID is missing. |
| 142 | + |
| 143 | +**Solution:** |
| 144 | + |
| 145 | +1. Confirm the customer is logged in with the correct account. |
| 146 | +2. Check that the order was originally placed by that user's account. |
| 147 | +3. Review the debug log for more details. |
| 148 | + |
| 149 | +### No payment methods appear on the payment page |
| 150 | + |
| 151 | +**Cause:** No payment plugins are enabled, or the available plugins have filtered out this order. |
| 152 | + |
| 153 | +**Solution:** |
| 154 | + |
| 155 | +1. Go to **J2Commerce** -> **Payments** -> **Payment Methods** and confirm at least one payment plugin is enabled. |
| 156 | +2. Check each payment plugin's own settings — some plugins allow restricting payments by order total, geozone, or customer group. |
| 157 | + |
| 158 | +## Related Topics |
| 159 | + |
| 160 | +- [Payment Methods](../../payment-methods/index.md) |
| 161 | +- [Easy Reorder](./app_reorder.md) |
0 commit comments