Download the Hesabe API 2.0 .Net Core Kit.
Extract the contents of the Zip file. Open the folder containing the contents of the zip file. Double Click and open the Visual Studio solution file HesabeDotNetCore.sln.
Once the project is loaded inside the IDE, go to the HesabeConstants.cs file and change the following parameter values using the values from your admin panel.
string ACCESS_CODE = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; string MERCHANT_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; string MERCHANT_IV = "xxxxxxxxxxxxxxxx"; string MERCHANT_CODE = "1234567890123";
Change the below values as per the URLs defined in your application.
string RESPONSE_URL = "https://yourdomain.com/PaymentResponse"; string FAILURE_URL = "https://yourdomain.com/PaymentFailure";
Once these values are updated you are done with the configuration part. Now lets move on to the integration part of the code.
There are 4 main components of the Code:
Here you configure your credentials. (Already detailed above)
This helper makes POST API call to the checkout endpoint in order to retrieve the token
This is the encryption and decryption library which will encrypt your payment data before making API call or before posting to the payment URL. Once you recieve the response, then this library will help you to decrypt that as well.
Class Models These are the models which defines your request and response data.