Pre-Authorization

  • Pre-Authorization - 3D Model / NS
  • Pre-Authorization Cosure
  • Pre-Authorization Cancel
Method Name: TP_Islem_Odeme_OnProv_WMD

This is the method that initiates a Nonsecure/3D payment transaction. For 3D transactions, the HTML code content returned by the method is displayed on the screen, and the redirection is performed. The credit card verification process begins.

Control Scenarios
You can find the test scenarios we expect to be conducted during the integration process here.

Order Amount Calculation Including Commission
Commission Rate: The installment's commission rate selected from the TP_Ozel_Oran_SK_Liste method
Islem_Tutar: The amount of your order
Total_Amount = Islem_Tutar + ((Islem_Tutar x Commission Rate) / 100)
is calculated as shown.

If the Sonuc parameter is greater than "0", print the UCD_HTML content on the screen to initiate the 3D Secure Payment process. Follow the steps below to complete the payment transaction from the credit card.

For NonSecure Transactions (Important)
If Sonuc > 0, UCD_HTML is checked for equality to 'NONSECURE'. If they match, the transaction ends. Islem_ID value represents the Receipt Number.
For a successful NonSecure transaction, Sonuc > 0, Islem_ID > 0, and UCD_HTML='NONSECURE' must all be true. Otherwise, the transaction fails.
If the NONSECURE transaction fails, Sonuc_Str returns the error message from the bank.
If Sonuc > 0 and UCD_HTML <> 'NONSECURE', it is handled like a 3D transaction.


TP_Islem_Odeme_OnProv_WMD Hash Formula

                        
                Dim Transaction_Security_Str$ = CLIENT_CODE & GUID & Islem_Tutar & Toplam_Tutar & Siparis_ID & Hata_URL & Basarili_URL 
                Dim Transaction_Hash$ = SHA2B64(Transaction_Security_Str)
            
        
Parameter Required Type Length Description
G Yes Object - ST_WS_Guvenlik Object
GUID Yes String 36 Merchant Key
KK_Sahibi Yes String 100 Credit Card Holder
KK_No Yes String 16 Credit Card Number
KK_SK_Ay Yes String 2 2-digit Expiry Month
KK_SK_Yil Yes String 4 4-digit Expiry Year
KK_CVC Yes String 3 CVC Code
KK_Sahibi_GSM Yes String 10 Credit Card Holder GSM No, without leading 0 (5xxxxxxxxx)
Hata_URL Yes String 256 URL of the page to redirect if payment fails
Basarili_URL Yes String 256 URL of the page to redirect if payment is successful
Siparis_ID Yes String 50 Unique ID specific to the order. If you have sent this value before, the system assigns a new Siparis_ID. The system returns this Siparis_ID upon completion of the transaction.
Siparis_Aciklama No String 250 Description of the order
Taksit Yes Integer 2 Number of Installments selected. Send 1 for single installment.
Islem_Tutar Yes String - Order Amount, (only in comma-separated cents format 1000.50)
Toplam_Tutar Yes String - Total Order Amount Including Commission, (only in comma-separated cents format 1000.50)
Islem_Hash Yes String - Transaction Hash Value
Islem_Guvenlik_Tip Yes String - NS (NonSecure) or 3D
Islem_ID No String - Unique ID apart from Order ID optional.
IPAdr Yes String 50 IP Address
Ref_URL No String 256 URL of the page where the payment is made
Data1 No String 250 Extra Field 1
Data2 No String 250 Extra Field 2
Data3 No String 250 Extra Field 3
Data4 No String 250 Extra Field 4
Data5 No String 250 Extra Field 5
Parameter Type Length Description
Islem_ID Long - SID Value
Islem_GUID String 36 Transaction GUID value
UCD_HTML String - 3D HTML code
UCD_MD String - 3D MD value
Sonuc Integer - Transaction result
Sonuc_Str String - Transaction result description
Bank_Trans_ID String - Bank Transaction ID value
Bank_AuthCode String - Bank Auth Code value
Bank_HostMsg String - Bank HostMsg value
Banka_Sonuc_Kod Integer - Bank's returned code
Bank_Extra String - Bank Extra value
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Body> 
        <TP_Islem_Odeme_OnProv_WMD xmlns="https://turkpos.com.tr/"> 
                <G> 
                        <CLIENT_CODE>10738</CLIENT_CODE>
                        <CLIENT_USERNAME>Test</CLIENT_USERNAME>
                        <CLIENT_PASSWORD>Test</CLIENT_PASSWORD>
                </G>
                <GUID>0c13d406-873b-403b-9c09-a5766840d98c</GUID>
                <KK_Sahibi>test</KK_Sahibi>
                <KK_No>4022774022774026</KK_No>
                <KK_SK_Ay>12</KK_SK_Ay>
                <KK_SK_Yil>2026</KK_SK_Yil>
                <KK_CVC>000</KK_CVC>
                <KK_Sahibi_GSM>5551231212</KK_Sahibi_GSM>
                <Hata_URL>https://dev.param.com.tr/tr</Hata_URL>
                <Basarili_URL>https://dev.param.com.tr/tr</Basarili_URL>
                <Siparis_ID>1</Siparis_ID>
                <Siparis_Aciklama>a</Siparis_Aciklama>
                <Taksit>1</Taksit>
                <Islem_Tutar>100,00</Islem_Tutar>
                <Toplam_Tutar>100,00</Toplam_Tutar>
                <Islem_Hash>0Vc96sxIwbQQUb9HT9dnch1mmVw=</Islem_Hash>
                <Islem_Guvenlik_Tip>NS</Islem_Guvenlik_Tip>
                <Islem_ID>123</Islem_ID>
                <IPAdr>127.0.0.1</IPAdr>
                <Ref_URL>https://dev.param.com.tr/tr</Ref_URL>
                <Data1>a</Data1>
                <Data2>a</Data2>
                <Data3>a</Data3>
                <Data4>a</Data4>
                <Data5>a</Data5>
        </TP_Islem_Odeme_OnProv_WMD> 
    </soap:Body>
</soap:Envelope> 

Result Parameters Example: For operations with NS

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <TP_Islem_Odeme_OnProv_WMDResponse xmlns="https://turkpos.com.tr/">
            <TP_Islem_Odeme_OnProv_WMDResult>
                <Islem_ID>6005034747</Islem_ID>
                <Islem_GUID>72c9b68c-fedc-488e-9166-ae9fc7d4e523</Islem_GUID>
                <UCD_HTML>NONSECURE</UCD_HTML>
                <Sonuc>1</Sonuc>
                <Sonuc_Str>Ön Provizyon İşlemi Başarılı</Sonuc_Str>
                <Bank_Trans_ID>21292RsEI18157</Bank_Trans_ID>
                <Bank_AuthCode>P66791</Bank_AuthCode>
                <Bank_HostMsg />
                <Banka_Sonuc_Kod>0</Banka_Sonuc_Kod>
                <Bank_Extra>&lt;Extra&gt;
    &lt;SETTLEID&gt;2070&lt;/SETTLEID&gt;
    &lt;TRXDATE&gt;20211019 17:44:04&lt;/TRXDATE&gt;
    &lt;ERRORCODE&gt;&lt;/ERRORCODE&gt;
    &lt;TERMINALID&gt;00556600&lt;/TERMINALID&gt;
    &lt;MERCHANTID&gt;655000100&lt;/MERCHANTID&gt;
    &lt;CARDBRAND&gt;VISA&lt;/CARDBRAND&gt;
    &lt;CARDISSUER&gt;FINANSBANK A.S.&lt;/CARDISSUER&gt;
    &lt;AVSAPPROVE&gt;Y&lt;/AVSAPPROVE&gt;
    &lt;HOSTDATE&gt;1019-174405&lt;/HOSTDATE&gt;
    &lt;AVSERRORCODEDETAIL&gt;avshatali-avshatali-avshatali-avshatali-&lt;/AVSERRORCODEDETAIL&gt;
    &lt;NUMCODE&gt;00&lt;/NUMCODE&gt;
  &lt;/Extra&gt;</Bank_Extra>
                <Siparis_ID>1</Siparis_ID>
                <Ext_Data>a|a|a|a|a</Ext_Data>
            </TP_Islem_Odeme_OnProv_WMDResult>
        </TP_Islem_Odeme_OnProv_WMDResponse>
    </soap:Body>
</soap:Envelope>

Sonuç Parametreleri Örnek: 3D li işlemler için

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <TP_Islem_Odeme_OnProv_WMDResponse xmlns="https://turkpos.com.tr/">
            <TP_Islem_Odeme_OnProv_WMDResult>
                <Islem_ID>6005034750</Islem_ID>
                <Islem_GUID>4554a625-adbc-4e5e-98d7-412b16a1c7c9</Islem_GUID>
                <UCD_HTML>HTML İçerik</UCD_HTML>
                <UCD_MD>402277:56E65101CC290830C0C9396B282026E7A253A701B0424F50BED24CD4D9448E6C:3634:##700655000100</UCD_MD>
                <Sonuc>1</Sonuc>
                <Sonuc_Str>İşlem Başarılı</Sonuc_Str>
                <Banka_Sonuc_Kod>0</Banka_Sonuc_Kod>
                <Siparis_ID>1</Siparis_ID>
            </TP_Islem_Odeme_OnProv_WMDResult>
        </TP_Islem_Odeme_OnProv_WMDResponse>
    </soap:Body>
</soap:Envelope>

When you print UCD_HTML content on the screen, the Bank's 3D screen will be displayed. After 3D verification, the following parameters will be posted to your Basarili_URL or Hata_URL pages.

Parameter Type Length Description
md String - Value of MD to be sent to UCD_MD parameter in TP_WMD_Pay method
mdStatus Integer 1 3D Verification Result. 1: Successful - Other cases indicate 3D verification failure.
orderId String - Order_ID value sent to TP_Islem_Odeme_OnProv_WMD method
transactionAmount String - Transaction amount sent to TP_Islem_Odeme_OnProv_WMD method
islemGUID String 36 Transaction GUID value returned from TP_Islem_Odeme_OnProv_WMD method
islemHash String - Transaction Hash value returned from TP_Islem_Odeme_OnProv_WMD method

Hash Control
To perform parameter verification, the following procedure must be followed.

Parameters that make up the hash value
islemGUID + md + mdStatus + orderId + GUID (key should go as Lower)

The hash value is encoded as based64. (SHA1)

Example Code
Dim _sha As SHA1 = New SHA1CryptoServiceProvider()
Dim _bytes() As Byte = System.Text.Encoding.UTF8.GetBytes(islemGUID + md + mdStatus + orderId + GUID (Key of the Merchant))
Dim _hashingbytes() As Byte = _sha.ComputeHash(_bytes)
Dim _hash As String = Convert.ToBase64String(_hashingbytes)

The hash value you created and the posted islemHash value must be the same.

mdStatus Values

1 = Verified Transaction (Full 3D)
2, 3, 4 = Card not enrolled (Half 3D)
5, 6, 7, 8 = No valid authentication or system error
0 = Verification Failed

If mdStatus is 1, 2, 3, or 4, you can send a request to the TP_WMD_Pay method to complete the payment.
If mdStatus is 0, 5, 6, 7, or 8, 3D verification has failed. Do not send a request to the TP_WMD_Pay method.

 

Completing the Pre-Authorization Process (for 3D Transactions)
Method Name: TP_WMD_Pay

This method is used to complete the pre-authorization from the verified cards.

Parameters to send:

Parameter Required Type Length Description
G Yes Object - ST_WS_Guvenlik Object
GUID Yes String 36 Merchant's Key
UCD_MD Yes String - Bank's 3D MD value
Islem_GUID Yes String 36 Transaction GUID value
Siparis_ID Yes String - Order ID value

Result Parameters:

Parameter Type Length Description
Sonuc Integer - Transaction result
Sonuc_Ack String 36 Transaction result description
Dekont_ID String 36 Transaction receipt ID
Siparis_ID String - Order ID value
UCD_MD String - Bank's 3D MD Value
Bank_Trans_ID String - Bank Transaction ID value
Bank_AuthCode String - Bank Auth Code value
Bank_HostMsg String - Bank HostMsg value
Bank_Extra String - Bank Extra value
Bank_Sonuc_Kod Integer - Bank result code value
Bank_HostRefNum String - Bank RRN value

If Sonuc > 0 and Dekont_ID > 0, the transaction is successful. Otherwise the transaction fails.

You can switch to the Pre-authorization - Closing method.

You can find the test scenarios we expect during the integration here.

Method Name: TP_Islem_Odeme_OnProv_Kapa

Converts the pre-authorization transaction into a sale.

Parameter Required Type Length Description
G Yes Object - ST_WS_Security Object
GUID Yes String 36 Member Merchant Key
Prov_ID No String - Provision ID (Optional, can be left blank)
Prov_Tutar Yes String - Amount to Close (only in comma-separated cents format 1000.50)
Siparis_ID Yes String - Order ID Value
Parameter Type Length Description
Sonuc Integer - Transaction result
Sonuc_Str String - Transaction result description
Prov_ID String - Provision ID
Dekont_ID Long - Transaction receipt ID
Banka_Sonuc_Kod Integer - Bank's returned code
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body>
<TP_Islem_Odeme_OnProv_Kapa xmlns="https://turkpos.com.tr/">
<G>
<CLIENT_CODE>10738</CLIENT_CODE>
<CLIENT_USERNAME>Test</CLIENT_USERNAME>
<CLIENT_PASSWORD>Test</CLIENT_PASSWORD>
</G>
<GUID>0c13d406-873b-403b-9c09-a5766840d98c</GUID>
<Prov_ID>f7184b1f-c4c2-4d2e-8428-fc6014a00900</Prov_ID>
<Prov_Tutar>10,00</Prov_Tutar>
<Siparis_ID></Siparis_ID>
</TP_Islem_Odeme_OnProv_Kapa>
</soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<TP_Islem_Odeme_OnProv_KapaResponse xmlns="https://turkpos.com.tr/">
<TP_Islem_Odeme_OnProv_KapaResult>
<Sonuc>1</Sonuc>
<Sonuc_Str>Provizyon Kapama İşlem Başarılı</Sonuc_Str>
<Prov_ID>f7184b1f-c4c2-4d2e-8428-fc6014a00900</Prov_ID>
<Dekont_ID>6004466311</Dekont_ID>
<Banka_Sonuc_Kod>0</Banka_Sonuc_Kod>
</TP_Islem_Odeme_OnProv_KapaResult>
</TP_Islem_Odeme_OnProv_KapaResponse>
</soap:Body>
</soap:Envelope>
Method Name: TP_Islem_Iptal_OnProv

This method is used to cancel a provision for which no sales transaction has been made.

Parameter Required Type Length Description
G Yes Object - ST_WS_Guvenlik Object
GUID Yes String 36 Member Merchant Key
Prov_ID No String - Provision ID (Optional, can be empty)
Siparis_ID Yes String - Order ID Value
Parameter Type Length Description
Sonuc Integer - Transaction result
Sonuc_Str String - Transaction result description
Banka_Sonuc_Kod Integer - Code returned from the bank
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body>
<TP_Islem_Iptal_OnProv xmlns="https://turkpos.com.tr/">
<G>
<CLIENT_CODE>10738</CLIENT_CODE>
<CLIENT_USERNAME>Test</CLIENT_USERNAME>
<CLIENT_PASSWORD>Test</CLIENT_PASSWORD>
</G>
<GUID>0c13d406-873b-403b-9c09-a5766840d98c</GUID>
<Prov_ID>dfbf4673-83d8-436a-a922-ae8ae7e66bb8</Prov_ID>
<Siparis_ID></Siparis_ID>
</TP_Islem_Iptal_OnProv>
</soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<TP_Islem_Iptal_OnProvResponse xmlns="https://turkpos.com.tr/">
<TP_Islem_Iptal_OnProvResult>
<Sonuc>1</Sonuc>
<Sonuc_Str>Approved</Sonuc_Str>
<Banka_Sonuc_Kod>00</Banka_Sonuc_Kod>
</TP_Islem_Iptal_OnProvResult>
</TP_Islem_Iptal_OnProvResponse>
</soap:Body>
</soap:Envelope>