Knowledge Base

Get help for payment solutions. Search our articles or browse by category below.

.NET Hosted Secure Card Amazon Solution

This solution requires our Card Storage solution called SecureCard. It's designed so that the checkout is like the Amazon checkout, in that the cardholder must register a card for their account and then they can use, update or delete the card info in their account settings. The integration is quite complex though, as there is a lot of functionality.

The first thing they will need to do is register their card. Full documentation is available in section 6.1 of our Integrator Guide available here.

Here is some sample code to help in this integration:

The code for generating a HASH is:

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;
}

You should generate the “datetime” value using:

System.DateTime.Now.ToString("dd-MM-yyyy:HH:mm:ss:fff");

You should then store the card token details as per the sample code. You can then in the future update the card details using the same sample code. You can also delete it using the “XmlSecureCardDelRequest” method in our XML API.

You may also require 3D Secure. If so, then you will have to use the code in section 5.2 of our Integrator Guide before the XML payment, and include the MPIREF with the payment request.

When you want to pay using the card you can do this by using this XML sample code. Note that you will have to use the “Card Reference” from before in place of the Card Number, you will not need to send the Expiry Date, and the Card Type will be “SECURECARD”, but sample code takes care of all of this.

Copyright © 2017 Worldnet Knowledge Base | Powered by DokuWiki
developer/sample_codes/net_hosted_secure_cards_amazon_solution.txt · Last modified: 2016/07/26 10:55 (external edit)