iyzico 3D Secure Return Error

The customer entered the code on the bank's verification screen and, back on the site, hit a generic message such as 'system error' or 'an unexpected error occurred', sometimes with an emptied cart. The real reason behind the generic message is in the values iyzico sends back on return and in the response to the payment completion request.

Urgency: Critical · checkout halted · Category: Orders & Payments

Field Observations

The error appears the moment the customer returns from the bank screen to the site. They do not know whether the payment went through and try again; support gets the question 'was I charged?'. The on-screen message is the same in every case, so it says nothing about the cause.

What you see on screen

errorCode 1 / 2: system error

iyzico error codes 1 and 2 — official error code list

CALLBACK_3DS / INIT_3DS: error during 3D Secure verification

iyzico error codes CALLBACK_3DS and INIT_3DS

errorCode 5014: conversation data could not be decrypted during 3D Secure

iyzico error code 5014

Observed System Error Signatures

  • Return request (callbackUrl): status=failure, mdStatus is not 1 → A · Bank verification failed
  • Return arrived but the 3DS completion request was never sent → B · Payment not completed
  • 3DS completion response: errorCode and errorMessage are filled → B · Payment not completed
  • No session on return: cart is empty, the user appears logged out → C · Session lost on return

On return, iyzico posts status, paymentId, conversationId, conversationData and mdStatus. Logging these five values at the return URL shows at a glance which step sits behind the generic error message.

Three Potential Root Causes & Differential Tests

A · Bank verification failed

If mdStatus is not 1 on return, the cardholder or the bank did not complete verification. iyzico's documentation lists what each value means: for example 0 is an invalid verification, 5 means verification could not be performed, 7 is a system error. This is not a bug in the site's code; the customer needs to see the right message.

Differential test: Is mdStatus anything other than 1?

Evidence: mdStatus is not 1 → A

Resolution: Show a clear message

Common anti-pattern fix: The payment code gets changed when the error shows up; but the problem is with the card or the bank, the change breaks a working flow, and the customer still sees a generic message.

B · Payment not completed

Verification came back successful, but the site did not send the 3DS completion request, or sent it incomplete. According to iyzico's documentation the payment is finalised by this request, and if conversationData came back on return it must be included. The errorCode and errorMessage in the completion response tell you which step failed.

Differential test: mdStatus is 1 but completion call missing or failed?

Evidence: Return present, completion missing or failed → B

Resolution: Send completion with conversationData

Common anti-pattern fix: The order is confirmed as soon as verification succeeds on return; with the completion request skipped, the payment is never finalised and the order is fulfilled without being paid.

C · Session lost on return

The return from the bank screen to the site is a form submission (POST) coming from another site. Browsers do not send cookies marked SameSite=Lax with such requests. If the session cookie uses this setting, the site does not recognise the user or the cart on return, and the order cannot be matched.

Differential test: Cart empty and session gone on return?

Evidence: No session and empty cart on return → C

Resolution: Match the order by ID, not by session

Common anti-pattern fix: When no session is found, the customer is redirected to the login page; the payment data posted on return is lost in that redirect and the order is never matched.

Check it yourself in the first 10 minutes

  1. Find the status and mdStatus values posted to the return URL in your logs. If mdStatus is not 1, the problem is with the card or the bank, not the code.
  2. If mdStatus is 1, check whether the 3DS completion request was sent, and read the errorCode and errorMessage in its response.
  3. Look the errorCode up in iyzico's official error code list; rely on that code, not on the generic on-screen message.
  4. If the cart empties on return, check the SameSite setting of the session cookie in the browser's developer tools.
  5. Check the iyzico panel for a payment record belonging to the same order. If there is one, do not ask the customer to pay again before the order is matched to it.

When to hand it over

Hand it over if the 3DS completion request or the return URL code has to change, if a cookie setting will affect live sessions, or if there are customers with a payment record but no order.

Who resolves it

A backend engineer who knows payment integrations. The return URL has to log the incoming values, show a meaningful message based on mdStatus, send the 3DS completion request in full, and match the order by ID rather than by session.

Impact If Left Unresolved

Customers retry or give up without knowing whether they were charged. Because the generic message hides where the problem is, the same loss repeats every day and is noticed only when complaints arrive.

Official documentation

Related Concepts & Services

→ Emergency Incident Triage & Crash Test

Trend Master Akademi Studio & Labs

B2B White-Label Engineering Desk | Tel: +90 534 371 35 73 | Email: info@trendmasterakademi.com

Address: Akdeniz Mah. Sehit Fethibey Cad. Heris Tower No: 55 Ic Kapi No: 091 Konak / Izmir