I had develop the website and according to requirement I have to integrate Payment Gateway-SADAD.

Can you provide me the document for this purpose so that I can integrate SADAD for "payment transaction" in my project made in ASP.Net language.

I had also referred this but not getting what are they saying.

Dani AI

Generated

As suggested, the fastest path is SADAD's official developer/merchant self‑service (register, upload business docs, generate secret key) and the sandbox. If SADAD support is slow, create a merchant account and follow the developer guide to get keys and a test mode before coding. See the SADAD developer portal for full flows and merchant panel details: SADAD Developer Docs. (developer.sadad.qa)

Key implementation notes (Web Checkout common flow): build a server-side HTML POST to SADAD's checkout endpoint with required hidden fields (merchant_id, ORDER_ID, WEBSITE, TXN_AMOUNT, CALLBACK_URL, txnDate, productdetail[], etc.). A server-side checksumhash must be generated and included in the form; on callback SADAD POSTs back a checksumhash that must be verified before marking an order paid. The WEBSITE value must match the domain used when the secret key was generated. SADAD documents the checksum generation (SHA‑256 + 4‑char salt, then AES‑128‑CBC encrypt with the specified IV) and the sandbox test card numbers. (developer.sadad.qa)

Example C# implementation of the checksum algorithm (follows SADAD's PHP example — adapt and test in sandbox):

// GenerateChecksum(payloadJson, secretKey, merchantId) -> base64 checksumhash
string GenerateChecksum(string payloadJson, string secretKey, string merchantId) {
    string keyStr = Uri.EscapeDataString(secretKey) + merchantId;
    string salt = GenerateSalt(4);
    string finalString = payloadJson + "|" + salt;

    using (var sha = SHA256.Create()) {
        var hash = sha.ComputeHash(Encoding.UTF8.GetBytes(finalString));
        var hashHex = BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
        string hashString = hashHex + salt;

        byte[] iv = Encoding.ASCII.GetBytes("@@@@&&&&####$$$$");
        byte[] keyBytes = Encoding.UTF8.GetBytes(keyStr);
        byte[] aesKey = new byte[16];
        Array.Copy(keyBytes, aesKey, Math.Min(keyBytes.Length, aesKey.Length));

        using (var aes = Aes.Create()) {
            aes.Mode = CipherMode.CBC; aes.Padding = PaddingMode.PKCS7;
            aes.Key = aesKey; aes.IV = iv;
            var cipher = aes.CreateEncryptor().TransformFinalBlock(Encoding.UTF8.GetBytes(hashString), 0, hashString.Length);
            return Convert.ToBase64String(cipher);
        }
    }
}

This mirrors SADAD's checksum approach — always validate against the sandbox and verify callbacks server‑side before updating order state. See the developer docs for field lists, test cards and the callback/verification example. (developer.sadad.qa)

Quick troubleshooting checklist: enable test mode in the merchant panel and use the documented test cards; log raw POSTs from the callback to confirm parameter names; ensure CALLBACK_URL is reachable and accepts POST; keep secret keys server‑side and URL‑encode where the docs show; if merchant panel registration stalls, open a support ticket from the merchant dashboard. (developer.sadad.qa)

For : registering in the merchant panel and using the sandbox will allow building and testing the .NET integration without waiting on email support.

Recommended Answers

All 2 Replies

I am not familliar with Sadad, but if they are like any other payment gateway, they will have an API that you must process data in a specific way and send the data to them. You will have to contact them to find out if they have a pre-made interface for ASP.Net. If not, you will have to get example code from them in a language you do understand, and translate it into ASP.Net for your particular use.

tl;dr: ask Sadad.

Thank you for your reply.
I had tried integrate Payment Gateway on "Direct Pay" but SADAD is also new for me, I had asked SADAD to provide the sample code or an API but no reply from them.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.