I remain confused about this requirement: "You need to send Purchase or Preauthorization or Card verification with Credential on File fields as the first transaction before you do Vault add Credit Card." I've added a card to the vault for unscheduled transactions in a test store and made a transaction with it but am unconvinced it'll work in production.
My code:
/********************** Post Request Variables *************************/ string host = ConfigurationManager.AppSettings["MonerisHost"]; string storeId = ConfigurationManager.AppSettings["MonerisStore"]; string apiToken = ConfigurationManager.AppSettings["MonerisApiToken"]; string processingCountryCode = "CA"; bool statusCheck = false; Boolean error = false; string errorMsg; // Address Verification Service AvsInfo avsCheck = new AvsInfo(); avsCheck.SetAvsStreetNumber(memberPaymentMethod.BillingAddressLine1); avsCheck.SetAvsStreetName(memberPaymentMethod.BillingAddressLine2); avsCheck.SetAvsZipCode(memberPaymentMethod.BillingAddressPostalCode); // Card Validation Digits CvdInfo cvdCheck = new CvdInfo(); cvdCheck.SetCvdIndicator("1"); cvdCheck.SetCvdValue(memberPaymentMethod.CVV); CofInfo cof = new CofInfo(); cof.SetIssuerId("168451306048014"); cof.SetPaymentIndicator("U"); //U - unscheduled merchant-initiated transaction cof.SetPaymentInformation("0"); ResAddCC resaddcc = new ResAddCC(); resaddcc.SetCustId(GetMemberId(memberPaymentMethod.ContactId).ToString()); resaddcc.SetPan(memberPaymentMethod.CardNumber); resaddcc.SetExpDate(memberPaymentMethod.ExpiryYearMonth.ToString()); resaddcc.SetCryptType("7"); resaddcc.SetDataKeyFormat("0U"); resaddcc.SetCofInfo(cof); resaddcc.SetAvsInfo(avsCheck); HttpsPostRequest mpgReq = new HttpsPostRequest(); mpgReq.SetProcCountryCode(processingCountryCode); mpgReq.SetTestMode(true); //false or comment out this line for production transactions mpgReq.SetStoreId(storeId); mpgReq.SetApiToken(apiToken); mpgReq.SetTransaction(resaddcc); mpgReq.SetStatusCheck(statusCheck); mpgReq.Send();
Receipt receipt = mpgReq.GetReceipt();
Can I simply make a transaction against this card now? I don't see where cvdCheck is used.
In reply to RamiY:
In reply to Neil: