Nonsecure/3D payment is the method to initiate the transaction. For 3D transactions, the method prints the returned 3D Bank HTML content to the screen and performs redirection. Credit card verification process begins.
Control Scenarios
You can find the test scenarios we expect to be performed during the integration process here.
Order Amount Calculation Including Commission
Commission Rate: TP_Ozel_Oran_SK_Liste commission rate of the installment
selected from the method
Islem_Tutar: Amount of your order
Total_Amount = Islem_Tutar + ((Islem_Tutar x Commission Rate) / 100)
.
If the result parameter is greater than "0", print the content of UCD_HTML to the screen to initiate the 3D Secure Payment process. To complete the credit card transaction, you need to follow the steps below.
For NonSecure transactions (Important)
If Sonuc > 0, check if UCD_HTML equals 'NONSECURE'. If it does, the transaction ends. The Islem_ID value is the Receipt No value.
For a successful NonSecure transaction, Sonuc > 0, Islem_ID > 0, and UCD_HTML must be 'NONSECURE'. Otherwise, the transaction is unsuccessful.
In case of an error in the NONSECURE transaction, the Sonuc_Str value returns the error message from the bank.
If Sonuc > 0 and UCD_HTML is not 'NONSECURE', treat it as a 3D transaction.
If the company MCC (Merchant Category Code) is one of the following values: “5960 DIRECT MARKETING – INSURANCE”, “6300 INSURANCE SALES AGENTS”, or “6363 PENSION AND LIFE INSURANCE”, the NS transaction can be processed in a masked manner.
The information should be transmitted as follows:
KK_No: first 6 digits ****** last 4 digits
KK_SK_Ay: **
KK_SK_Yil: ****
Data1: TCKN/VKN/YKN
Dim Transaction_Security_Str$ = CLIENT_CODE & GUID & Taksit & Islem_Tutar & Toplam_Tutar & Siparis_ID
Dim Transaction_Hash$ = SHA2B64(Transaction_Security_Str)
Parameter | Required | Type | Lenght | Description |
---|---|---|---|---|
G | Yes | Object | - | ST_WS_Security Object |
GUID | Yes | String | 36 | Key belonging to the Member Workplace |
KK_Sahibi | Yes | String | 100 | Credit Card Holder |
KK_No | Yes | String | 16 | Credit Card number |
KK_SK_Ay | Yes | String | 2 | 2-digit Expiration Month |
KK_SK_Yil | Yes | String | 4 | 4-digit Expiration Year |
KK_CVC | Yes | String | 3 | CVC Code |
KK_Sahibi_GSM | No | String | 10 | Credit Card Holder GSM No, without leading 0 (5xxxxxxxxx) |
Hata_URL | Yes | String | 256 | Page address to redirect if the payment process fails |
Basarili_URL | Yes | String | 256 | Page address to redirect if the payment process 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 Order_ID. Returns this Order_ID as a result of the transaction. |
Siparis_Aciklama | No | String | 250 | Description of the order |
Taksit | Yes | Integer | 2 | Selected Installment Number. Send 1 for single payment. |
Islem_Tutar | Yes | String | - | Order Amount, (only in comma-separated cent format 1000.50) |
Toplam_Tutar | Yes | String | - | Total Order Amount Including Commission, (only in comma-separated cent 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 other than the Order ID for the transaction 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 | Lenght | Description |
---|---|---|---|
Islem_ID | Long | - | SID Value |
Islem_GUID | String | - | 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 | - | Code returned by the bank |
Bank_Extra | String | - | Bank Extra value |
Result Parameters Example: For operations with NS
Sonuç Parametreleri Örnek: 3D li işlemler için
When you display the content of UCD_HTML on the screen, the Bank 3D screen will appear. After the 3D verification is completed, the following parameters will be posted to your Basarili_URL or Hata_URL pages.
Parameter | Type | Lenght | Description |
---|---|---|---|
md | String | - | MD value to be sent to UCD_MD parameter of 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_WMD_UCD method |
transactionAmount | String | - | Transaction Amount sent to TP_WMD_UCD method |
islemGUID | String | - | Transaction GUID value returned from TP_WMD_UCD method |
islemHash | String | - | Transaction Hash value returned from TP_WMD_UCD method |
Hash Control
To perform parameter verification, the following procedure must be followed.
Parameters that make up the hash value
islemGUID + md + md + mdStatus + orderId + GUID(key Lower as small
must go)
Hash value 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 (Member's workplace key) )
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 Process (Full 3D)
2, 3, 4 = card not registered (Half 3D)
5, 6, 7, 8 = No valid validation or system error
0 = Verification Failed
mdStatus : If 1, 2, 3, 4, you can send a request to the TP_WMD_Pay method to complete the payment.
mdStatus : If 0,5,6,7,8, 3D verification failed. Do not send a request to the TP_WMD_Pay method.
This method is used to debit the amount from the verified cards.
Parameter | Required | Type | Lenght | Description |
---|---|---|---|---|
G | Required | Object | - | ST_WS_Guvenlik Object |
GUID | Required | String | 36 | Merchant Key |
UCD_MD | Required | String | - | Bank 3D MD value |
Islem_GUID | Required | String | 36 | Transaction GUID value |
Siparis_ID | Required | String | - | Order ID value |
Parameter | Type | Lenght | 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 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 is a failure.
This method is the method to start the Nonsecure / 3D payment process. (VirtualPOS_ID parameter is removed.) The 3D URL returned as a result of the transaction is redirected and the credit card payment process starts.
Control Scenarios
During integration, you can access the test scenarios we expect to be performed here.
Order Amount Calculation Including Commission
Commission Rate: rate of the installment selected from 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 above.
If the Result parameter obtained from the ST_TP_Islem_Odeme object is greater than "0", redirect to the UCD_URL parameter to initiate the 3D Secure Payment process. Whether the credit card payment is successful or unsuccessful, POST is provided to the Hata_URL or Basarili_URL values.
If the Company MCC (Merchant Category Code) is one of the values "5960 DIRECT SALES-INSURANCE", "6300 INSURANCE AGENTS", "6363 PENSION AND LIFE", it can process the transaction in a masked manner for NS operations.
It should provide the following information:
- KK_No: first 6 digits ****** last 4 digits
- KK_SK_Ay: **
- KK_SK_Yil: ****
- Data1: ID Number
Dim Transaction_Security_Str$ = CLIENT_CODE & GUID & Taksit & 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 | Member 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 | No | String | 10 | Credit Card Holder GSM No, without leading 0 (5xxxxxxxxx) |
Hata_URL | Yes | String | 256 | URL to redirect to if the payment fails |
Basarili_URL | Yes | String | 256 | URL to redirect to if the payment is successful |
Siparis_ID | Yes | String | 50 | Unique ID for the order. If you have sent this value before, the system assigns a new Siparis_ID. This Siparis_ID is returned in the result. |
Siparis_Aciklama | No | String | 250 | Order description |
Taksit | Yes | Integer | 2 | Selected Installment Number. Send 1 for single payment. |
Islem_Tutar | Yes | String | - | Order Amount, (only in decimal format, e.g., 1000.50) |
Toplam_Tutar | Yes | String | - | Total Amount Including Commission, (only in decimal format, e.g., 1000.50) |
Islem_Hash | Yes | String | - | Transaction Hash Value |
Islem_Guvenlik_Tip | Yes | String | 2 | Send as NS (NonSecure) or 3D. |
Islem_ID | No | String | - | Unique ID other than the Order ID for the transaction optional. |
IPAdr | Yes | String | 50 | IP Address |
Ref_URL | No | String | 256 | URL of the payment page |
Data1 | No | String | 256 | Extra Field 1 |
Data2 | No | String | 256 | Extra Field 2 |
Data3 | No | String | 256 | Extra Field 3 |
Data4 | No | String | 256 | Extra Field 4 |
Data5 | No | String | 256 | Extra Field 5 |
Data6 | No | String | 256 | Extra Field 6 |
Data7 | No | String | 256 | Extra Field 7 |
Data8 | No | String | 256 | Extra Field 8 |
Data9 | No | String | 256 | Extra Field 9 |
Data10 | No | String | 256 | Extra Field 10 |
G Object:
Parameter | Required | Type | Lenght | Description |
---|---|---|---|---|
CLIENT_CODE | * | Integer | 5 | Terminal ID, will be provided by us. |
CLIENT_USERNAME | * | String | max 16 | Username, will be provided by us. |
CLIENT_PASSWORD | * | String | max 11 | Password, will be provided by us. |
Parameter | Type | Lenght | Description |
---|---|---|---|
Sonuc | Integer | - | Transaction result |
Sonuc_Str | String | - | Transaction result description |
Islem_ID | Long | - | SID Value |
UCD_URL | String | - | 3D URL |
Banka_Sonuc_Kod | Integer | - | Code sent from the bank |
Result Parameters Example: For operations with NS
Sonuç Parametreleri Örnek: 3D li işlemler için
POST Parameters:
Parameter | Description |
---|---|
TURKPOS_RETVAL_Sonuc | Result value |
TURKPOS_RETVAL_Sonuc_Str | Result description |
TURKPOS_RETVAL_GUID | Merchant key |
TURKPOS_RETVAL_Islem_Tarih | Transaction date |
TURKPOS_RETVAL_Dekont_ID | Receipt number |
TURKPOS_RETVAL_Tahsilat_Tutari | Collected amount from customer |
TURKPOS_RETVAL_Odeme_Tutari | Net amount. Amount collected minus commission. |
TURKPOS_RETVAL_Siparis_ID | Unique Siparis_ID for the transaction sent to the service |
TURKPOS_RETVAL_Islem_ID | Islem_ID sent to the service |
TURKPOS_RETVAL_Ext_Data | Concatenated values of Data1, Data2, Data3, Data4, Data5 parameters separated by "|". Ext_Data = Data1 & "|" & Data2 & "|" & Data3 & "|" & Data4 & "|" & Data5 |
TURKPOS_RETVAL_Banka_Sonuc_Kod | Code returned by the bank indicating an error |
TURKPOS_RETVAL_Hash | Hash value for the returned response |
Hash Control
To perform parameter verification, the following procedure must be followed.
Parameters that make up the hash value
CLIENT_CODE + Key of the Merchant + TURKPOS_RETVAL_Dekont_ID + Tutar + Siparis_ID + Islem_ID
value sent to Service
Hash value encoded as based64 (SHA1)
Example Code
Dim _sha As SHA1 = New SHA1CryptoServiceProvider()
Dim _bytes() As Byte = System.Text.Encoding.UTF8.GetBytes(CLIENT_CODE + Key of the Merchant
+
TURKPOS_RETVAL_Dekont_ID + Tutar + Siparis_ID + Islem_ID value sent to Service)
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.
If TURKPOS_RETVAL_Sonuc < 0, TURKPOS_RETVAL_Dekont_ID returns "0" . If
TURKPOS_RETVAL_Dekont_ID value is greater than "0" , it signifies that the debit
transaction from the credit card has been completed.
If Sonuc > 0, UCD_URL is checked for equality to 'NONSECURE'. If they are equal,
the transaction concludes. Islem_ID represents the Dekont No value.
For a successful NonSecure transaction, Sonuc > 0, Islem_ID > 0, and
UCD_URL='NONSECURE' must all hold true. Otherwise, the transaction fails.
If the NONSECURE transaction encounters an error, Sonuc_Str returns the error
message from the bank.
If UCD_URL <> 'NONSECURE', it is treated like a 3D transaction.