• Multi Bank Virtual POS

Reverse General Concepts

The payment made through TAMI can be canceled on the same day (before the end of the day). In order to cancel, the order number (orderId) of the payment must be sent. Sending the amount and reason is not mandatory. If the cancellation is successful, the canceled amount will be returned from the service.

Test/Prod Envirenement API User Information

For Virtual POS transactions, merchants can use the merchant information given in the table below for the controls they want to perform in the test environment.

For Virtual POS transactions to be realized from the prod environment via Tami, the merchant number is obtained by making an application.

You can access the Sandbox test portal at https://sandbox-portal.tami.com.tr. When you log in to the test portal with the users provided below, the transactions made by the workplace connected to this user can be viewed. Transactions can be canceled/refunded.

User Phone Number User Password Sms / Email Otp Workplace Number Terminal Number Secret Key
5346484700 147850 147852 77006950 84006953 0edad05a-7ea7-40f1-a80c-d600121ca51b
5346484709 147850 147852 77006951 84006954 c8581bb6-a4b2-4925-8c94-529fc651399e
5346484803 147850 147852 77006952 84006955 ff7d4895-0c32-4f48-86ab-fb9ecca9f3d7
5346484807 147850 147852 77006953 84006956 33124ff0-0b19-4cf9-b002-13a35eae865b
5346484800 147850 147852 77006954 84006957 7daf9631-e136-4164-9ddb-dd1c02df851d
5346484808 147850 147852 77006956 84006959 fe6f3fff-0434-4932-a27d-bb3dac9de49d

Hash Calculation

The request sent for many transaction types should include the PG-Auth-Token in the header information. The PG-Auth-Token consists of the values "MerchantNumber:TerminalNumber:Hash".

When calculating the hash here, the merchantNumber, terminalNumber, and secretKey information belonging to the merchant are hashed with sha256 and converted to a string.

public class SHA256Example {\n public static String sha256(Long merchantNumber, Long terminalNumber, String secretKey) {\n String text = merchantNumber.toString() + terminalNumber.toString() + secretKey;\n try {\n MessageDigest digest = MessageDigest.getInstance(\"SHA-256\");\n byte[] hash = digest.digest(text.getBytes(StandardCharsets.UTF_8));\n String sha256Hex = DatatypeConverter.printBase64Binary(hash);\n return sha256Hex;\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n return null;\n }\n }\n}

TAMİ Test Portal Information

You can access the Tami test portal at https://sandbox-portal.tami.com.tr. From this address, you can view the portal screen with the users specified above. 

For your production environment information you can become a member at https://portal.tami.com.tr or You can apply to the e-commerce support unit.

Reverse Transaction API Information

In test environment, the "https://sandbox-paymentapi.tami.com.tr/payment/reverse" URL will be used.

In production environment, the "https://paymentapi.tami.com.tr/payment/reverse " URL will be used.

Reverse Transaction API Request Parameters and Descriptions

Field Format Maximum Size (O)psiyonel / (M)andatory Description
orderId String (2-36) M Is the order number of the sales transaction to be canceled.
amount Decimal O It is used for partial refund requests. It should be sent when you want to return a certain part of the transaction, not the whole transaction. If empty, it takes the value of the order. The fraction separator must be made with a period (.).
reason String 150 O Reason for Reverse/Refund
securityHash String M It is the value expected to be calculated and transmitted according in the document. If it is missing or incorrect, the transaction is not routed to the bank, an error is given.    

Reverse Transaction API Request Example

{\n \"amount\":\"300\",\n \"orderId\": \"orderreverse\",\n \"securityHash\": \"648rksks99848wskkd==\"\n}

Reverse Transaction API Response Example

{\n \"amount\": 300,\n \"currency\": \"TRY\",\n \"orderId\": \"orderreverse\",\n \"securityHash\": \"738dsjdnfkfke93930ld==\",\n \"success\": true,\n \"systemTime\": \"2023-09-05T00:56:38.402\",\n \"correlationId\": \"correlation3349\"\n}

Reverse Transaction API Response Parameters and Descriptions

Field Format Description
success String Reports the result of the operation. If True, the operation succeeds, if False, the operation fails.
currency String The foreign currency code of the successful canceled/refunded transaction.
amount Number The foreign currency code of the successful canceled/refunded transaction.
systemTime DateTime Time of transaction execution
correlationId String The transaction number value sent by the merchant in the cancellation/refund request.
errorCode String This parameter is passed if the operation fails. Error code information.
errorMessage String This parameter is passed if the operation fails. Error message information.
orderId String Order number
securityHash The value to be used to determine that the result of the operation comes from the correct source. The documentation describes how to calculate it.

Security Hash Calculation

You can use the documentation here to calculate the securityHash field in service requests and incoming service responses. 

Error Codes

You can access the list of error codees on this page.

Test Cards

You can access the list of test cards on this page.

We are here for all your questions and support requests.

Ask a Question Ask a Question