Skip to main content

3D Secure Payment

3D Secure provides an additional layer of security by redirecting the user to their bank's authentication page. This flow involves enrollment, customer authentication, and final completion.

1. Initiate 3D Secure Enrollment

Start the 3D Secure process by providing the payment details and callback URLs.

POST/api/3ds

Request Parameters

ParameterRequiredTypeDescription
orderIdYesstringClient's tracking number for the order (e.g., ORD-12345).
amountYesnumberTransaction amount (e.g., 100.50).
currencyYesstringISO currency code (e.g., TRY).
installmentCountNonumberNumber of installments (default: 1). Check available options via the Installment Options API before setting this.
interestPaidByCustomerNobooleanWhether interest is paid by the customer.
cardHolderNameYesstringName of the card holder.
panYesstringFull card number (16 digits).
expiryMonthYesstringExpiry month (MM format, e.g., 04).
expiryYearYesstringExpiry year (YY format, e.g., 28).
cvvYesstringCVV/CVC code (3 or 4 digits).
successUrlYesstringDestination URL after successful bank authentication.
failureUrlYesstringDestination URL after failed bank authentication.
requestIpYesstringIP address of the customer.
requestPortYesnumberPort number of the customer request.
customerIdNostringOptional unique identifier for the customer.

Response

FieldTypeDescription
paymentIdstringUnique identifier for the payment (UUID).
successbooleanIndicates if the enrollment was successful.
resultCodestringResult code from the enrollment (e.g., SUCCESS).
resultMessagestringDescriptive result message.
htmlContentstringHTML content to be presented to the end user for 3D Secure authentication.

2. Present 3D Secure Authentication

Present the returned htmlContent to the end user. This typically involves rendering it in an iframe or redirecting the user to complete the 3D Secure authentication on the bank's page.

3. Handle 3D Secure Callback

After the authentication process, the payment provider will call the provided callback URLs (successUrl or failureUrl) with relevant parameters posted as form data.

Callback Form Data Parameters

FieldDescriptionExample
paymentIdUnique identifier for the payment.123e4567-e89b-12d3-a456-426614174000
securityKeySecurity key received from the 3D Secure authentication process.3DS_AUTH_KEY_123456

4. Complete 3D Secure Payment

Finalize the transaction using the security key received in the callback.

POST/api/3ds/{paymentId}/complete

Path Parameters

ParameterTypeDescription
paymentIdstringThe UUID received in the callback.

Request Parameters

{
"securityKey": "3DS_AUTH_KEY_123456"
}

Response

Returns an ApiPaymentResponse object with completed payment details (identical to the Direct Payment response).


3D Secure Payment Flow

  1. Initiate Enrollment: Call the /api/3ds endpoint with payment details and callback URLs.
  2. Display Challenge: Present the returned htmlContent to the user.
  3. Authentication: The user completes the bank's 3D Secure process.
  4. Receive Callback: The provider sends a POST request to your callback URL with the paymentId and securityKey.
  5. Finalize: Extract the parameters and call the /api/3ds/{paymentId}/complete endpoint.
  6. Verify Status: Consider the payment successful only if the response status is SUCCESS.

Installment Options

Retrieve available installment plans for a specific card before processing a payment.

POST/api/installment-options

Request Body

ParameterRequiredTypeDescription
amountYesnumberTotal transaction amount (e.g., 1000.00).
currencyYesstringISO currency code (e.g., TRY).
panYesstringFirst 6 digits (BIN) or full card number.
maxInstallmentCountNonumberMaximum number of installments to retrieve (default: 12).
interestPaidByCustomerNobooleanWhether interest is paid by the customer.

Response

FieldTypeDescription
installmentCountnumberNumber of installments.
installmentAmountnumberAmount per installment month.
currencystringISO currency code.
interestAmountnumberTotal interest generated (added to principal).
totalAmountnumberTotal amount to be paid (Principal + Interest).