Get in touch
  • OpenCart
  • Payments
  • v1.0.0

PayTR for OpenCart — card payments and installments (taksit) via the PayTR iFrame API

Card payments in Turkey through the PayTR iFrame API for OpenCart 4, 3 and 2.3: the PayTR form on a store page, an order becomes paid only on a signed PayTR notification or a Status Inquiry answer, amount and currency checks, TRY / EUR / USD / GBP / RUB. Pro — an installment (taksit) table on the product page, "single payment only" for categories and products, installment interest as an order line, a payment journal with re-check and refunds. Lifetime licence.

Download Free
Pro · lifetime licence The more sites, the less each one costs
Compatibility
OpenCart 4.0.2 – 4.1.x, 3.0.x and 2.3.0.2 (tested on 4.1.0.3, 4.0.2.3 with the pdo driver, 3.0.5.0 on PHP 8.2 and 2.3.0.2 on PHP 7.0) · default checkout · module languages English and Türkçe · currencies TRY, EUR, USD, GBP, RUB
Version
v1.0.0 (OpenCart 4)
v1.0.0 (OpenCart 3.x)
v1.0.0 (OpenCart 2.3)
Licence
one site, lifetime
Trial
7 days, no card, one per site
Or all 173 Pro modules with All Access — 4 990 ₴ / year

What Free has,
and what Pro adds

The free version works with no time limit. Pro adds the rest of the features in the table.

Feature Free Pro
Card payment in the PayTR form (iFrame API) on a separate store page, with 3D Secure and installments ✔ ✔
An order becomes paid only on a signed PayTR notification (Notification URL, HMAC-SHA256) or a Status Inquiry answer — never on a browser redirect ✔ ✔
A repeated notification does not duplicate the order history; a forged notification is rejected ✔ ✔
Status Inquiry: the buyer came back before the notification — the module asks PayTR about the payment itself ✔ ✔
Checks on payment: amount, currency, collected amount and the current order total; a mismatch gives a "review" status with an explanation in the history ✔ ✔
Every "Pay" click is a separate attempt with its own merchant_oid; a second payment of the same order is not lost but recorded in the history ✔ ✔
Declined card — "Failed" status with the reason from PayTR, the buyer goes back to the checkout with the cart and can try again right away ✔ ✔
PayTR currencies: TRY (TL), EUR, USD, GBP, RUB — the method is hidden in other currencies ✔ ✔
Installments: all options / up to N payments / single payment only; test mode; form language tr / en / storefront language; payment time limit ✔ ✔
Merchant key and salt are stored encrypted and never shown after saving; "Check credentials" button ✔ ✔
Geo zone, sort order, order statuses for every result ✔ ✔
Module languages: English, Türkçe ✔ ✔
Installment (taksit) table on the product page: World, Bonus, Axess, Maximum, CardFinans, Paraf, Advantage, Combo — ✔
Table as a tab next to "Description" or under the "Add to cart" button; rates from PayTR, refreshed once a day — ✔
Single payment only for selected categories (with subcategories) and products — ✔
The installment interest the buyer paid as an "Installment interest" line in the order totals — ✔
Payment journal: received, interest, installments, test / live, merchant_oid, refunds — ✔
Refunds from the admin (Refund API): full or partial, cumulative; "Re-check" via Status Inquiry — ✔

What it looks like

PayTR installment (taksit) table in an OpenCart product page tab
Product page on OpenCart 4.1: the “Installments” tab next to the description — monthly payment × number of payments and the total for World, Bonus, Axess (rates from test data).
Installment table on a phone
On a phone the table scrolls sideways inside its own block, the page does not stretch.
"Credit / debit card (PayTR)" payment method at the OpenCart checkout
Checkout: the PayTR payment method and the “Pay by card” button, after which the buyer sees the PayTR form on a store page.

The trial starts when you ask

A fresh install is the free version, nothing switches on by itself. The “Try Pro for 7 days” button → e-mail → the key right in the window and by e-mail.

One key — one site

Moving the store? Unbind the licence on the old domain and activate it on the new one yourself. For studios — keys for 5 or 25 sites, or unlimited.

Technical requirements

  • OpenCart 4.0.2 – 4.1.x, 3.0.x or 2.3.0.2; PHP 7.0+ (for OpenCart 4 — the PHP version your OpenCart requires), curl and openssl extensions.
  • A PayTR merchant account (Mağaza No, Mağaza Parola, Mağaza Gizli Anahtar) with the iFrame API enabled.
  • A storefront reachable from the internet — so PayTR can send notifications to the Notification URL; SSL recommended.

Frequently bought with PayTR for OpenCart

4 modules in one order — 40% cheaper than separately

“Store starter” bundle PayTR Nova Poshta Premium LiqPay Telegram notifications and Viber/SMS for customers Need more — all 173 modules in All Access for 4 990 ₴.
3 790 ₴ lifetime instead of 6 260 UAH bought separately
Buy the bundle →

Full module description

PayTR for OpenCart connects the Turkish payment service PayTR through its iFrame API: the buyer pays by card in the PayTR form right on a store page, with 3D Secure and installments (taksit), and the order becomes paid only when PayTR has confirmed it with a signed notification. One module for OpenCart 4, 3 and 2.3, languages English and Türkçe.

Honestly about testing. We do not have a PayTR merchant account, so we have not made real payments through PayTR. The module is written from the official dev.paytr.com documentation (signature formulas, request and response fields) and tested in clean stores on OpenCart 4.1.0.3, 4.0.2.3 (pdo driver), 3.0.5.0 and 2.3.0.2 on PHP 7.0 against a test server that checks signatures the way the PayTR documentation describes. We ran real storefront checkouts with a coupon, shipping, product options, in a second currency (EUR) and in Turkish, a declined card, repeated and forged notifications, a return before the notification, a double payment, a cart change during payment and refunds from the admin — checking the order and its total lines in the database. Before going live, make a few payments in PayTR test mode on your own account — the 7-day Pro trial is there for that.

Running WooCommerce? There is a separate PayTR for WooCommerce plugin: the same PayTR form (iFrame API) at the classic and block checkout, signed notifications and Status Inquiry, and in Pro an installment table on the product page and refunds from the order screen.

⚠ One Notification URL per PayTR account

PayTR sends the result of every payment to the address set in the panel: Mağaza Paneli → Ayarlar → Bildirim URL. It is a single field in the store settings. If another site or another PayTR module already uses the same PayTR account, notifications will arrive at only one of the addresses, and some orders will not be confirmed automatically.

  • The most reliable way is a separate PayTR account for each store; if in doubt, ask PayTR support.
  • Our module answers “OK” to notifications with foreign merchant_oid values and changes nothing, so it does not get in the way of another site if the address points to ours.
  • The module checks its own orders once more through Status Inquiry when the buyer returns to the store after paying, and the journal (Pro) has a “Re-check” button.

What the buyer sees

  • The “Kredi / banka kartı (PayTR)” payment method at the checkout — in Turkish lira and in the currencies PayTR has enabled for the store (EUR, USD, GBP, RUB). In other currencies the method is not shown.
  • The PayTR form on a store page: after “Pay by card” the “Kartla ödeme” page opens with the PayTR form inside (iFrame), its height follows the form. In test mode a warning above the form says no money is charged.
  • Return to the store: after payment — the “Thank you” page, after a decline — the checkout with the same cart, and “Pay” can be pressed again right away.
  • The installment table (Pro) on the product page: as a tab next to the description or under the “Add to cart” button, the monthly payment and total for every card programme.

What the admin gets

  • Settings: Mağaza No, Mağaza Parola (key) and Mağaza Gizli Anahtar (salt) — the key and salt are stored encrypted and not shown after saving; the “Check credentials” button makes a signed request to PayTR with the details on screen.
  • A ready Notification URL for the PayTR panel — with https if the storefront is on SSL.
  • Installments: all options, up to N payments (2–12) or single payment only; test mode; form language; payment time limit; geo zone; statuses for paid, review, declined and refunded.
  • History in every order: amount, number of payments, merchant_oid and where the confirmation came from (notification or Status Inquiry); on a decline — the reason from PayTR.
  • Debug log cc_paytr.log without keys, salt or signatures.

Protection against payment errors

  • Paid — only by PayTR. Browser redirects mark nothing: the status changes only on a notification with a valid HMAC-SHA256 signature or a Status Inquiry answer.
  • Amount check. The attempt amount, currency, collected amount and current order total must match; otherwise a “review” status with an explanation of what exactly is wrong.
  • Retries without duplicates. PayTR repeats a notification until it gets “OK”: the module counts only the first one and answers exactly “OK”, without a single extra character.
  • A double payment is not lost. If the buyer paid the same order twice (two tabs), the status does not change, and the history gets an entry about the second payment — so you can refund it in the PayTR panel.
  • The “Back” button after payment will not send the same order to PayTR again.

Pro: installment table, interest in the order, journal and refunds

  • Installment table (taksit tablosu) on the product page: World, Bonus, Axess, Maximum, CardFinans, Paraf, Advantage, Combo — rates from the PayTR Installment Rates service, refreshed once a day. Show amounts with interest (the buyer pays) or without it (peşin fiyatına).
  • Single payment only for selected categories (with their subcategories) and products: PayTR receives no_installment=1, the table is not shown.
  • Installment interest in the order: the difference between the collected amount and the goods total is added once as an “Installment interest (N installments)” line — the order total equals what the buyer paid.
  • Payment journal: received, interest, installments, test / live, merchant_oid, refunded.
  • Refunds from the admin: full or partial, several times in a row; negative, non-numeric and above-remaining amounts are rejected, the “Refunded” status is set only after a full refund.

How it works step by step

  1. The buyer picks “Kredi / banka kartı (PayTR)” and presses “Pay by card”.
  2. The module creates a payment attempt with its own merchant_oid and gets a form token from PayTR (iFrame API, step 1) with the order amount, cart, currency and installment settings.
  3. The buyer pays in the PayTR form on a store page; 3D Secure and the number of payments are chosen in the PayTR form.
  4. PayTR sends the result to the Notification URL (step 2). The module checks the signature, compares the amount and currency, changes the order status and answers “OK”.
  5. The buyer returns to the “Thank you” page. If the notification has not arrived yet, the module asks PayTR once through Status Inquiry.

Under the hood

  • PayTR iFrame API: get-token with an HMAC-SHA256 signature per the dev.paytr.com documentation, notifications with a hash check, Status Inquiry (durum-sorgu), Refund (iade), Installment Rates (taksit-oranlari).
  • The module’s own tables for payment attempts, payments and rates; settings are written key by key, without overwriting the whole group.
  • No core edits and no OCMOD: a standard OpenCart payment extension and an event on the product page for the installment table.
  • After the module is uninstalled the payment tables stay — the journal and refunds are available after reinstalling.

Installation

  1. OpenCart 4 and 3: “Extensions → Installer” → upload the zip for your version. OpenCart 2.3: copy the contents of the upload/ folder from the archive to the store root.
  2. “Extensions → Payments” → PayTR (CatCode) → install → edit.
  3. Enter Mağaza No, Mağaza Parola and Mağaza Gizli Anahtar from the PayTR panel (Destek & Kurulum → Entegrasyon Bilgileri), press “Check credentials”.
  4. Copy the Notification URL from the module settings to the PayTR panel: Ayarlar → Bildirim URL → Değiştir.
  5. Turn on test mode, make a test payment, then turn it off.

Versions

  • 1.0.0 — first release: iFrame API, Notification URL, Status Inquiry, amount and currency checks, installment table, “single payment only”, installment interest in the order, journal and refunds; OpenCart 4, 3 and 2.3; English and Türkçe.

Questions
about the module

Didn't find the answer? Message us on Telegram and we'll reply within a business day.

@catcode_support Setup, compatibility, activation
I have one PayTR account for several sites. Will the module fit?

Carefully. The PayTR panel has a single "Bildirim URL" (Notification URL) field in the store settings, so payment notifications go to one address only. If another site or another PayTR module already works on the same account, some notifications will go elsewhere. Our module answers "OK" to foreign notifications and changes nothing, and checks its own orders once more through Status Inquiry when the buyer returns to the store. The reliable way is a separate PayTR account for each store; if in doubt, ask PayTR support.

What happens if the buyer closes the tab right after paying?

The order still becomes paid as soon as PayTR sends the notification to the Notification URL: the module checks its signature and amount. If the buyer came back to the store before the notification, the module asks PayTR itself through Status Inquiry. Until PayTR answers, the order has status 0 (in the "Missing Orders" list), as with PayPal for OpenCart.

Can someone mark an order as paid just by opening the "Thank you" page?

No. The return page does not mark a payment: only a signed PayTR notification or a Status Inquiry answer makes an order paid, and both are checked against the amount and currency of the attempt. We tested a forged notification and a forged return link — the order did not change.

The buyer changed the cart in another tab while the payment form was open. What then?

The module compares the paid amount with the current order total. If they differ, the order gets a "review" status with an explanation in the history instead of "paid" — so you do not ship more than you received.

How is the installment table calculated?

From the rates of the PayTR Installment Rates service (cached for a day), based on the product price with tax, for prices in Turkish lira only. You can show amounts with interest (the buyer pays) or without it (peşin fiyatına, the store pays). The table is indicative: PayTR shows the exact amount in its form before confirmation, and this is written under the table.

Can I accept payments in euros or dollars?

Yes, if PayTR has enabled these currencies for your store: the module sends the order currency (EUR, USD, GBP, RUB) and the amount in it. In currencies PayTR does not accept, the payment method is not shown.

How do I test before going live?

Turn on "Test mode" — the module sends test_mode=1 and PayTR runs a test payment without charging. You need your details from the PayTR panel for this (Mağaza No, Mağaza Parola, Mağaza Gizli Anahtar).

What happens when the Pro trial ends?

Card payments, notifications, Status Inquiry and the checks keep working — that is Free. The installment table disappears from the product page, and the journal and refunds from the admin become unavailable until you buy a licence. An OpenCart licence is bought once and is valid forever.

Not quite what you are looking for?

We build custom modules for WordPress, WooCommerce, OpenCart and Shopify. Tell us about the task and we'll prepare an estimate.

Order a custom module