public static Receipt AddCC(CreditCardDetail CCD, AvsInfo avsCheck, MonerisCCInput input)
        {
            var isTestMode = input.TestMode ?? false;

            var host = isTestMode ? "esqa.moneris.com" : "www3.moneris.com";

            var status_check = false;

            var resAddCC = new ResAddCC(CCD.CCNumber, CCD.ExpDate, CCD.CryptType);

            //resAddCC.SetAvsInfo(avsCheck);
            resAddCC.SetEmail(CCD.Email);
            resAddCC.SetPhone(CCD.Phone);
            resAddCC.SetNote(CCD.Note);

            var mpgReq = new HttpsPostRequest(host, input.StoreId, input.Key, resAddCC);

            mpgReq.SetProcCountryCode(CCD.ProcessingCountryCode);
            mpgReq.SetTestMode(isTestMode);             //false or comment out this line for production transactions
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            /**********************   REQUEST  ************************/

            return(mpgReq.GetReceipt());
        }
Пример #2
0
        public async Task <Receipt> TokenizeAsync(
            string cardNumber,
            string expirationDate,
            string cvv,
            string streetNumber,
            string streetName,
            string zipCode,
            string email,
            string phone)
        {
            var tokenizeCommand = new ResAddCC(cardNumber, expirationDate, CryptType_SSLEnabledMerchant);

            if (streetName.HasValueTrimmed() && streetNumber.HasValueTrimmed())
            {
                tokenizeCommand.SetAvsAddress(streetName, streetNumber);
            }

            tokenizeCommand.SetAvsZipCode(zipCode);

            if (email.HasValueTrimmed())
            {
                tokenizeCommand.SetEmail(email);
            }

            if (phone.HasValueTrimmed())
            {
                tokenizeCommand.SetPhone(phone);
            }

            tokenizeCommand.SetCvv(cvv, "1");

            var request = new HttpsPostRequest(_settings.Host, _settings.StoreId, _settings.ApiToken, tokenizeCommand, _logger);

            return(await request.GetReceiptAsync());
        }