Merchants can send 3D payment requests to more than one bank Virtual PoS for sales, sales in installments and pre-authorization and pre-authorization in installments transactions by sending a request to Switch 3D Gateway via HTML POST method with stored card data or open card data.
Merchants are expected to enter the PoS credential information for the banks they are currently using under the Bank Identification menu on the Switch Management Screens before sending the 3D request form created in the production environment to the Switch 3D Gateway. After this step, the Switch system stores the values defined by the merchant for each bank in encrypted form.
The smart Switch system decides which bank to send the payment request to in the transactions initiated by the merchant by triggering a 3D request, prepares the 3D Payment form with the bank credential information stored encrypted in the system and sends the request to the relevant Acquirer bank.
The 3D request received by the Acquirer bank is converted into a 3D transaction form and transmitted to the card bank via other modules and the cardholder is shown the screen where he/she will perform the verification process.
After the cardholder completes the 3D verification process, Switch 3D Gateway returns the 3D transaction result to the merchant via the success or fail URL specified by the merchant in the HTML POST.
With the Smart Switch system;
➢ Based on the bank ID sent by the merchant in the API, a payment request can be sent directly to the relevant bank.
➢ If the merchant does not send a bank ID in the API, a payment request can be sent to the bank of the card that the transaction was made.
➢ If the merchant does not send a bank ID in the API and the bank of the card being processed is not an integrated bank in the Switch system, a payment request can be sent via the bank defined by the merchant as default.
➢ If the default bank is not defined, a request can be sent to any of the defined banks.
Üye işyeri tarafından hazırlanacak HTML formunda POST isteğinin gönderileceği adresler ve forma alanları aşağıdaki gibidir. Alanların her biri String olarak gönderilebilir.
Field | Requirement | Length | Description |
---|---|---|---|
swtId | Yes | Max 36 Character | This is the field where the Switch ID value defined on behalf of the workplace or company that performs the transaction is sent. |
requestId | Yes | Max 36 Character | The unique ID value generated for each transaction. |
level | Yes | - | It is the model information that determines whether the transaction will continue to be provisioned after 3D secure. This field will be set as 3D_PAY. |
cardNumber | Yes if the cardToken field is empty | Min:15 CharacterMax:30 Character | Card number |
cardExpireYear | Yes if the cardToken field is empty | 2 Character | This is the field where the year of the expiration date of the card used in the transaction is sent. |
cardExpireMonth | Yes if the cardToken field is empty | 2 Character | This is the field where the month information of the expiration date of the card used in the transaction is sent. |
cardCvv | No | 3 Character | This is the field where the CVV information of the card used in the transaction is sent. |
cardToken | Yes for authorization transactions with stored card | Max 32 Character | This is the field where Token ID information is sent. |
orderId | No | Max 36 Character | This is the field where the order number is sent. |
generateOrderId | No | 1 Character | The value of the field should be "N" if the merchant wants to use the orderId it sends in the transaction, and "Y" if the Switch wants to generate a new orderId that matches the orderId structure of the virtual pos to which the transaction will be routed. If the field is not sent at all or the value is blank, the Switch will generate a new orderId. |
userId | Yes | Max 36 Character | This is the field where the ID value of the user performing the transaction is sent. |
txnType | Yes | - | This is the field where the transaction information is sent. It should be sent as "sales" for sales transactions and "preauth" for pre-authorization transactions. |
txnAmount | Yes | - | This is the field where the transaction amount will be sent. Penny separation will be provided with ".". Example : 1.45 |
txnCurrencyCode | Yes | 3 Character | This is the field where exchange rate information is sent. In ISO standards, 3 digit code will be sent. Example : 949 |
txnInstallmentCount | No | Max 3 Character | This is the field where the number of transaction installments will be sent. |
companyName | No | Max 64 Character | There will be workplace name information to be used in page displays. |
successUrl | Yes | - | The address of the workplace where the successful transaction response will be returned will be included in this field. |
failureUrl | Yes | - | The address of the workplace where the erroneous transaction response will be returned will be included in this field. |
txnMotoInd | No | 1 Character | This is the field where information is sent whether the transaction is a mail order transaction or not. If 'Y', it will be perceived as a mail order transaction. |
txnTimestamp | Yes | - | Transaction time is sent in this field. |
lang | Yes | - | This is the field where the language information is sent. "en" value is expected to be sent. |
refreshTime | Yes | - | This field is used when there is a page display on the bank side. 5 value must be sent. |
customerName | No | Max 50 Character | The name of the cardholder will be included. |
customerLastName | No | Max 50 Character | The cardholder's surname information will be included. |
customerGsm | No | Max 16 Character | The GSM information of the cardholder will be included. |
customerIp | Yes | Max 20 Character | The cardholder's IP information will be included. It must be in ipv4 format. |
customerEmail | Yes | Max 128 Character | The cardholder's email information will be included. |
customerNationalNumber | No | Max 20 Character | The cardholder's TR ID number will be included. |
acqId | Yes | - | This field is used if the transaction is to be sent through the virtualpos of a specific bank. Ids corresponding to the following numbers should be used for the desired Virtualpos.Bank Code and Name:64: İŞ BANK A.Ş.62: T.GARANTİ BANKASI A.Ş46: AKBANK T.A.Ş.111: QNB FINANSBANK A.Ş.10: T.C. ZİRAAT BANKASI A.Ş.12: T. HALK BANKASI A.Ş.67: YAPI KREDİ BANK |
hashedData | Yes | - | Payment Request Hash Calculation with 3D It will be created by the workplace in accordance with the criteria described under the heading and sent in the request. |
shippingAddress.name | No | Max 50 Character | The name information of the person belonging to the cargo address will be included. |
shippingAddress.lastName | No | Max 50 Character | The surname information of the person belonging to the shipping address will be included. |
shippingAddress.companyName | No | Max 64 Character | The company name of the shipping address will be included. |
shippingAddress.city | No | Max 50 Character | The city name of the shipping address will be included. |
shippingAddress.country | No | Max 50 Character | The country name of the shipping address will be included. |
shippingAddress.zipCode | No | Max 16 Character | The postal code information of the shipping address will be included. |
shippingAddress.addressDetail | No | Max 256 Character | The detailed address field information of the shipping address will be included. |
shippingAddress.phone | No | Max 36 Character | Phone information of the shipping address will be included. |
shippingAddress.gsm | No | Max 16 Character | GSM information of the shipping address will be included. |
shippingAddress.email | No | Max 128 Character | Mail information of the shipping address will be included. |
billingAddress.name | No | Max 50 Character | The name of the person belonging to the invoice address will be included. |
billingAddress.lastName | No | Max 50 Character | The surname information of the person belonging to the invoice address will be included. |
billingAddress.companyName | No | Max 64 Character | The company name of the invoice address will be included. |
billingAddress.city | No | Max 50 Character | The city name of the shipping address will be included. |
billingAddress.country | No | Max 50 Character | The country name of the shipping address will be included. |
billingAddress.zipCode | No | Max 16 Character | The postal code information of the shipping address will be included. |
billingAddress.addressDetail | No | Max 256 Character | The detailed address field information of the shipping address will be included. |
billingAddress.phone | No | Max 36 Character | Phone information of the shipping address will be included. |
billingAddress.gsm | No | Max 16 Character | GSM information of the shipping address will be included. |
billingAddress.email | No | Max 128 Character | Mail information of the shipping address will be included. |
hashVersion | Yes | - | It should be sent as "2.0". |
comments[0] comments[1] comments[2] comments[3] | No | Max 20 Character | These are the comment fields sent to the Garanti BBVA virtual platform. The data sent in this field is not kept in Switch tables and is not sent to a virtual platform other than Garanti BBVA virtual platform. The maximum length for each comment field is 20 characters. |
The 3D secure response message will be POSTed as Html Form by Switch 3D Secure Gateway to the successUrl or failureUrl addresses sent by the merchant in the request message together with the data set below.
Field | Description |
---|---|
swtId | This is the field where SwitchID information is returned. |
requestId | This is the field where the unique ID information sent by the workplace during the request is returned. |
txnId | is the field where the transaction ID information is returned. |
orderId | This is the field where the order number is returned. |
returnCode | Switch It is a field where information about the response code is returned. |
reasonCode | It is a field where information about the Switch Sub Answer code is returned. |
message | The field where the answer description is returned. |
txnAmount | This is the field where the transaction amount is returned. |
installmentCount | This is the field where the number of installments is returned. |
maskedNumber | This is the field where the masked card number will be returned. |
acquirerId | This is the field where the bank ID information is returned. |
acquirerName | This is the field where the name of the bank from which provision is received is returned. |
hashedData | Cevap hash bilgisinin dönüldüğü alandır. Üye işyerinin bu alanda dönen hash değerini hesaplayarak doğrulaması beklenir. Payment with 3D Response Hash It must be calculated by the workplace in accordance with the criteria described under the calculation heading. |
terminalId | is the field where the terminal information is returned. |
merchantId | This is the field where the workplace number is returned. |
authCode | This is the field where the approval code is returned in approved provision transactions. |
successUrl | This is the field where the successful transaction URL of the workplace is returned. |
failureUrl | This is the field where the failed transaction URL of the workplace is returned. |
approved | This is the field where the information about whether the transaction is approved or not is returned. |
retrefNum | This is the field where the unique transaction number on the bank side is returned. |
eci | This is the field where the ECI value received as a result of 3D secure verification is returned. |
cavv | This is the field where the CAVV value received as a result of 3D secure verification is returned. |
md | This is the field where the MD value received as a result of 3D secure verification is returned. |
xid | This is the field where the XID value received as a result of 3D secure verification is returned. |
response | This is the field where the result information of the Switch application is returned. |
mdStatus | This is the field where the MD STATUS value received as a result of 3D secure verification is returned. |
timestamp | This is the field where the timestamp information of the reply message is returned. |
acqReturnCode | This is the field where the response code generated by the merchant bank is returned. |
acqReasonCode | This is the field where the response code generated by the merchant bank is returned. |
currencyCode | This is the field where the exchange rate code is returned. |
extraData | This is the field where additional detail information is returned. If there is data in this field, Map<String, String> will be returned. |
userId | This is the field where the user who made the transaction is returned. |
vposOrderId | The orderid value generated by the Switch if generateOrderId was sent as Y or empty in the request message, or if this field was not sent at all. |
One of the fields that must be sent when paying with 3D is hashedData. In this field, the hash value generated using certain fields in the content of the 3D request sent must be fed. In the hash value calculation, the following parameters sent in the request must be concatenated as String side by side and the password value generated for the Switch user must be put into the calculation. The final String value obtained is used for hash calculation using SHA256 algorithm. The String produced as a result of the hash is converted to uppercase letters and fed into the hashedData field. The method and example are as follows:
The response form sent to the merchant after the 3D payment is received will also contain a field named hashedData. Merchant can check the validity of the incoming data by generating the value in the hashedData field using the following fields from the fields returned in the 3D response form. The Response hash can be obtained by concatenating some fields side by side as String, concatenating the Switch user password to the end of the String, hashing it with the SHA256 algorithm and converting it to uppercase letters, just like the Request hash. The method and example are as follows:
A sample HTML form for 3D payment is given below in HTML Table format. After the fields here are filled in as desired, the 3D request hash is calculated and set in the hashedData field, the 3D payment request can be triggered by submitting the form to the test or prod url given below. The posted data must be in application/x-www-form-urlencoded type.
After the fields in the 3D request HTML are set and the hash calculation is made and the hashedData field is set, the 3D process is triggered by submitting the form to the following URL for the test environment.
The following data was taken while submitting forms in the test environment.
After these fields are submitted, the Garanti Bank 3D Secure page will open, the default phone number from the dropdown here must be selected and the OK button must be pressed:
After pressing the OK button, you will be redirected to a page like the one below, where 123456 must be written in the SMS Password section for each request. After entering the password, the OK button on this page will be pressed and 3D Verification will be done:
After 3D Verification, the following fields will be returned in the form as a result:
We would love to hear from you. Do you have problems/questions about services ? Send us detailed email about it ?
Send Us a Question Send Us a Question