Skip to content
HisarPay
  • Integrations
  • Published:
  • Reading time: 5 min read
  • Türkçe oku

Accept crypto on OpenCart 3 and 4: from package to first order

With the right package, adding crypto to an OpenCart store is a short job and needs no code. The time goes elsewhere: the wrong zip, the wrong signing secret, or a US dollar currency nobody enabled. Here are the steps for both versions, with the traps marked in advance.

On this page
  1. Which package for which version?
  2. Install it
  3. Enter the key and the checkout settings
  4. Connect the webhook
  5. What the customer sees
  6. Map the order statuses
  7. Place a test order
  8. The usual mistakes
  9. Frequently asked questions

Which package for which version?

OpenCart 3 and 4 load extensions differently, so there are two packages and neither works on the other version. Their settings and behaviour are the same. Your version number is at the bottom of the admin panel, and both files are on the OpenCart integration page.

ItemOpenCart 3OpenCart 4
Packagehisarpay-oc3.ocmod.ziphisarpay.ocmod.zip
Version3.0.x (tested on 3.0.3.3 to 3.0.5.1)4.0.x and 4.1.x
PHP7.1 or later8.0 or later
Regular re-checkA cron URL the extension gives youOpenCart’s own scheduled task

If your OpenCart release asks for a newer PHP, that requirement wins. The server needs the curl and json extensions, and the shop needs a valid HTTPS certificate.

Install it

  1. Download the zip and keep its name. OpenCart 4 names the extension folder after the file you upload.
  2. Upload it under Extensions → Installer. On OpenCart 4, also press Install on the row of the uploaded package.
  3. Under Extensions → Extensions, choose Payments as the type, then press Install and Edit on the HisarPay row.

Enter the key and the checkout settings

In the dashboard, create a key for this shop alone under Developers → API keys. The invoices scope is required. Add read as well and the connection test can also confirm that your webhook is registered. Start with a key that begins with hp_test_.

  • Coins offered: USDT, TRX or both.
  • Invoice lifetime: 5 to 1440 minutes. A payment that arrives later is still credited to you.
  • HisarPay commission: account default, you or the customer. We compare the options in who should pay the fee. The 1 USDT network fee on USDT invoices is always part of what the customer sends.
  • Minimum order: the smallest invoice is $10, so do not set this below 10.
  • Order reference prefix: random for each installation. Two shops on one HisarPay account must not share a prefix.

If your prices are not in dollars

Invoices are priced in US dollars. For a USD order the exact total is charged; for other currencies the extension uses OpenCart’s own rate. Under System → Localisation → Currencies, USD has to exist, be enabled and carry a current rate. If it is off, the payment method is hidden and the settings page says why. No rate is ever guessed.

Connect the webhook

Copy the Callback URL from the settings page, add it as an endpoint under Developers → Webhooks in the dashboard, and paste the whsec_ secret you get into the extension. The address depends on the version:

Callback URL
# OpenCart 4
https://yourstore.com/index.php?route=extension/hisarpay/payment/hisarpay.callback

# OpenCart 3
https://yourstore.com/index.php?route=extension/payment/hisarpay/callback

On OpenCart 4.0.0 and 4.0.1 it ends in hisarpay|callback, so copy it from the screen rather than from this page. Then press Test connection. It checks that the key works, whether it is test or live, that the secret has the right shape and that the endpoint is registered. It never creates an invoice.

The extension does not trust what a callback says. It checks the signature, reads the invoice from the API again and acts on that answer; how signatures work has its own article. If a callback goes missing, open invoices from the last three days are re-checked every 10 minutes. On OpenCart 4, point your server’s cron at cron.php. On OpenCart 3, schedule the cron URL shown under Advanced. With no cron at all, storefront visits trigger the check.

What the customer sees

The customer picks HisarPay and sees the dollar total. On Confirm the order becomes Pending and the HisarPay page opens. Choosing a coin there locks the rate and shows the exact amount with a QR code. After 20 block confirmations, about a minute, the invoice counts as paid and the customer returns to your store. If the old invoice expired or the total changed, the next attempt gets a fresh one with -2 at the end of its reference.

Map the order statuses

InvoiceDefault statusWhat happens
PendingPendingThe order e-mail carries the payment link
Partly paidPendingReceived and missing amounts go into the history
PaidProcessingReady to prepare
OverpaidProcessingThe extra is noted in the history
ExpiredCanceledA late payment re-opens the order with a note
CancelledCanceledThe invoice was cancelled in the dashboard or API

Every row can point at any status in your store; a shop that sells downloads may send paid orders straight to Complete. Once you have moved an order on yourself, to Shipped for example, the extension only adds notes. The same goes for an order whose total you edited after the invoice was created: the status stays put and a note explains the difference.

Place a test order

  1. Order something with the test key saved and choose HisarPay.
  2. On the payment page, press Paid among the simulation buttons. The order should become Processing.
  3. On a second order try Partial and then Paid, on a third Expire.
  4. Open the order in the admin panel and try Check payment status.
  5. When all of that works, swap in the live key. Our go-live list covers the rest.
Do not stay on the test keyAnyone who opens the payment page of a test invoice can mark it paid. Such orders carry a “TEST payment” note: do not ship them, and do not leave a test key on a public shop.

The usual mistakes

  • A renamed file: download the same zip twice and the browser adds “(1)” to the name. Restore the original name before uploading.
  • Someone else’s secret: each endpoint has its own signing secret. With the wrong one, every callback is rejected.
  • A firewall: if the delivery log in the dashboard shows 403 or timeouts, allow requests to the callback URL.

Frequently asked questions

Can I install the OpenCart 4 package on OpenCart 3?
No. Use hisarpay-oc3.ocmod.zip on OpenCart 3. Both packages have the same settings and behaviour.
Does an order get stuck if a callback never arrives?
No. Open invoices from the last three days are checked against the API every 10 minutes, and you can ask for the status by hand from the order page.
Why is the payment method not showing?
Check that the status is Enabled, both keys are saved, USD is enabled and the cart is above the minimum. If you chose a geo zone, the customer’s address must be inside it.
Can I refund from the extension?
No. A payment on the blockchain cannot be pulled back. You send the refund as a withdrawal to an address the customer gives you and update the order yourself.
  • #OpenCart
  • #E-commerce
  • #Extension
  • #Webhooks

Try crypto payments in test mode

No setup or monthly fees. Experiment as much as you like in test mode and go live when you are ready.

More guides that go well with this one.