Skip to Content
0
Former Member
Oct 01, 2009 at 02:53 PM

Credit Card Verification Codes Not Loading All The Time

72 Views

I've been loading NPOrder objects to obtain the NPOrderPayment objects contained in the Payment member. It seems like sometimes the verification code decrypts correctly, but other times a value of "9dYzocKjDdPP+l8Unv3PKw==" appears instead. I am retrieving the code as follows:

netpoint.api.data.NPConnection npc = // Create a connection
  new netpoint.api.data.NPConnection(
    ConfigurationManager.ConnectionStrings["conn"].ConnectionString,
    ""
  );
string privateKey = // Obtain the private key for the website
  ConfigurationManager.AppSettings["WebTools_Production_PrivateKey"];
int OrderID = 200000;  // Some arbitrary order ID
NPOrder o = new NPOrder(Convert.ToInt32(OrderID), npc, privateKey);
NPOrderPayment op = ((NPOrderPayment)(o.Payments[0]));
int VerificationCode = op.VerificationCode;

When the verification code comes back incorrectly, it is always the same encrypted value. Why is this the case? How is the VerificationCode handled/encrypted? All I want to do is get the code for each payment.