Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
developer:sample_codes:net_hosted_payments [2018/05/28 06:52]
thiago123
developer:sample_codes:net_hosted_payments [2018/12/03 10:26]
127.0.0.1 external edit
Line 1: Line 1:
 +====== .NET Hosted Payment ======
 +
 +You can find below a high and a low level workflow diagram of the required integration. ​
 +
 +Full documentation is available in **[[developer:​api_specification|API Specification]]**. You should also use our Sandbox test accounts **[[developer:​integration_docs:​sandbox_testing|Sandbox testing]]** to test against.
 +
 +{{:​developer:​sample_codes:​workflow-integratingtohostedpaymentpage-highlevel.pdf| High Level Workflow}}
 +
 +{{developer:​sample_codes:​workflow-integratingtohostedpaymentpage-lowlevel.pdf| Low Level Workflow}}
 +
 +Here is some sample code to help in this integration:​
 +
 +**The code for generating a HASH is:**
 +
 +<code csharp>
 +
 +using System.Security.Cryptography;​
 +using System.Text;​
 +protected static String GetHash(String plainString)
 +{
 +    byte[] toBeHashed = System.Text.Encoding.UTF8.GetBytes(plainString);​
 +    MD5CryptoServiceProvider cryptHandler = new MD5CryptoServiceProvider();​
 +    byte[] hash = cryptHandler.ComputeHash(toBeHashed);​
 +    String hashed = "";​
 +    foreach (byte i in hash)
 +    {
 +        if (i < 16)
 +            hashed += "​0"​ + i.ToString("​x"​);​
 +        else
 +            hashed += i.ToString("​x"​);​
 +    }
 +    return hashed;
 +}
 +
 +</​code>​
 +
 +**You should generate the "​datetime"​ value using:**\\
 +
 +
 +<code chsarp>
 +
 +System.DateTime.Now.ToString("​dd-MM-yyyy:​HH:​mm:​ss:​fff"​);​
 +
 +</​code>​
 +
 +
  
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International