private void radioAuthorization_Click(object sender,EventArgs e) { radioSale.Checked=false; radioAuthorization.Checked=true; radioVoid.Checked=false; radioReturn.Checked=false; textRefNumber.Visible=false; labelRefNumber.Visible=false; trantype=PayConnectService.transType.AUTH; textCardNumber.Focus();//Usually transaction type is chosen before card number is entered, but textCardNumber box must be selected in order for card swipe to work. }
private void radioVoid_Click(object sender, EventArgs e) { radioSale.Checked = false; radioAuthorization.Checked = false; radioVoid.Checked = true; radioReturn.Checked = false; textRefNumber.Visible = true; labelRefNumber.Visible = true; trantype = PayConnectService.transType.VOID; textCardNumber.Focus(); //Usually transaction type is chosen before card number is entered, but textCardNumber box must be selected in order for card swipe to work. }
private void radioForce_Click(object sender, EventArgs e) { radioSale.Checked = false; radioAuthorization.Checked = false; radioVoid.Checked = false; radioReturn.Checked = false; radioForce.Checked = true; textRefNumber.Visible = true; labelRefNumber.Visible = true; labelRefNumber.Text = Lan.g(this, "Authorization Code"); _trantype = PayConnectService.transType.FORCE; if (radioWebService.Checked) { textCardNumber.Focus(); //Usually transaction type is chosen before card number is entered, but textCardNumber box must be selected in order for card swipe to work. } else { textAmount.Focus(); } }
///<summary>Parameters starting at authCode are optional, because our eServices probably reference this function as well.</summary> public static PayConnectService.creditCardRequest BuildSaleRequest(decimal amount, string cardNumber, int expYear, int expMonth, string nameOnCard, string securityCode, string zip, string magData, PayConnectService.transType transtype, string refNumber, bool tokenRequested, string authCode = "", bool isForced = false) { PayConnectService.creditCardRequest request = new PayConnectService.creditCardRequest(); request.Amount = amount; request.AmountSpecified = true; request.CardNumber = cardNumber; request.Expiration = new PayConnectService.expiration(); request.Expiration.year = expYear; request.Expiration.month = expMonth; if (magData != null) //MagData is the data returned from magnetic card readers. Will only be present if a card was swiped. { request.MagData = magData; } request.NameOnCard = nameOnCard; request.RefNumber = refNumber; request.SecurityCode = securityCode; request.TransType = transtype; request.Zip = zip; request.PaymentTokenRequestedSpecified = true; request.PaymentTokenRequested = tokenRequested; //request.AuthCode=authCode;//This field does not exist in the WSDL yet. Dentalxchange will let us know once they finish adding it. request.ForceDuplicateSpecified = true; request.ForceDuplicate = isForced; return(request); }
public static string BuildReceiptString(PayConnectService.transType transType, string refNum, string nameOnCard, string cardNumber, string magData, string authCode, string statusDescription, List <string> messages, decimal amount, int sigResponseStatusCode, long clinicNum) { string result = ""; cardNumber = cardNumber ?? ""; //Prevents null reference exceptions when PayConnectPortal transactions don't have an associated card number int xmin = 0; int xleft = xmin; int xright = 15; int xmax = 37; result += Environment.NewLine; result += CreditCardUtils.AddClinicToReceipt(clinicNum); //Print body result += "Date".PadRight(xright - xleft, '.') + DateTime.Now.ToString() + Environment.NewLine; result += Environment.NewLine; result += "Trans Type".PadRight(xright - xleft, '.') + transType + Environment.NewLine; result += Environment.NewLine; result += "Transaction #".PadRight(xright - xleft, '.') + refNum + Environment.NewLine; result += "Name".PadRight(xright - xleft, '.') + nameOnCard + Environment.NewLine; result += "Account".PadRight(xright - xleft, '.'); for (int i = 0; i < cardNumber.Length - 4; i++) { result += "*"; } if (cardNumber.Length >= 4) { result += cardNumber.Substring(cardNumber.Length - 4) + Environment.NewLine; //last 4 digits of card number only. } result += "Card Type".PadRight(xright - xleft, '.') + CreditCardUtils.GetCardType(cardNumber) + Environment.NewLine; result += "Entry".PadRight(xright - xleft, '.') + (String.IsNullOrEmpty(magData) ? "Manual" : "Swiped") + Environment.NewLine; result += "Auth Code".PadRight(xright - xleft, '.') + authCode + Environment.NewLine; result += "Result".PadRight(xright - xleft, '.') + statusDescription + Environment.NewLine; if (messages != null) { string label = "Message"; foreach (string m in messages) { result += label.PadRight(xright - xleft, '.') + m + Environment.NewLine; label = ""; } } result += Environment.NewLine + Environment.NewLine + Environment.NewLine; if (transType.In(PayConnectService.transType.RETURN, PayConnectService.transType.VOID)) { result += "Total Amt".PadRight(xright - xleft, '.') + (amount * -1) + Environment.NewLine; } else { result += "Total Amt".PadRight(xright - xleft, '.') + amount + Environment.NewLine; } result += Environment.NewLine + Environment.NewLine + Environment.NewLine; result += "I agree to pay the above total amount according to my card issuer/bank agreement." + Environment.NewLine; result += Environment.NewLine + Environment.NewLine + Environment.NewLine + Environment.NewLine + Environment.NewLine; if (sigResponseStatusCode != 0) { result += "Signature X".PadRight(xmax - xleft, '_'); } else { result += "Electronically signed"; } return(result); }
public static PayConnectService.creditCardRequest BuildSaleRequest(decimal amount, string cardNumber, int expYear, int expMonth, string nameOnCard, string securityCode, string zip, string magData, PayConnectService.transType transtype, string refNumber) { PayConnectService.creditCardRequest request = new OpenDental.PayConnectService.creditCardRequest(); request.Amount = amount; request.AmountSpecified = true; request.CardNumber = cardNumber; request.Expiration = new OpenDental.PayConnectService.expiration(); request.Expiration.year = expYear; request.Expiration.month = expMonth; if (magData != null) //MagData is the data returned from magnetic card readers. Will only be present if a card was swiped. { request.MagData = magData; } request.NameOnCard = nameOnCard; request.RefNumber = refNumber; request.SecurityCode = securityCode; request.TransType = transtype; request.Zip = zip; return(request); }
private void FormPayConnect_Load(object sender, EventArgs e) { _progCur = Programs.GetCur(ProgramName.PayConnect); if (_progCur == null) { MsgBox.Show(this, "PayConnect does not exist in the database."); DialogResult = DialogResult.Cancel; return; } if (PIn.Bool(ProgramProperties.GetPropVal(_progCur.ProgramNum, "TerminalProcessingEnabled", _clinicNum))) { try { //If the config file for the DentalXChange credit card processing .dll doesn't exist, construct it from the included resource. if (!File.Exists("DpsPos.dll.config")) { File.WriteAllText("DpsPos.dll.config", Properties.Resources.DpsPos_dll_config); } } catch (Exception ex) { FriendlyException.Show("Unable to create the config file for the terminal. Trying running the program as an administrator.", ex); //We will still allow them to run the transaction. Probably the worse that will happen is the timeout variable will be less than desired. } } if (!PIn.Bool(ProgramProperties.GetPropVal(_progCur.ProgramNum, "TerminalProcessingEnabled", _clinicNum)) || _isAddingCard) //When adding a card, the web service must be used. { groupProcessMethod.Visible = false; Height -= 55; //All the controls except for the Transaction Type group box should be anchored to the bottom, so they will move themselves up. } else { string procMethod = ProgramProperties.GetPropValForClinicOrDefault(_progCur.ProgramNum, PayConnect.ProgramProperties.DefaultProcessingMethod, _clinicNum); if (procMethod == "0") { radioWebService.Checked = true; } else if (procMethod == "1") { radioTerminal.Checked = true; } } textAmount.Text = POut.Decimal(_amountInit); if (_patCur == null) //Prepaid card { radioAuthorization.Enabled = false; radioVoid.Enabled = false; radioReturn.Enabled = false; textZipCode.ReadOnly = true; textNameOnCard.ReadOnly = true; checkSaveToken.Enabled = false; sigBoxWrapper.Enabled = false; } else //Other cards { textZipCode.Text = _patCur.Zip; textNameOnCard.Text = _patCur.GetNameFL(); checkSaveToken.Checked = PrefC.GetBool(PrefName.StoreCCtokens); if (PrefC.GetBool(PrefName.StoreCCnumbers)) { labelStoreCCNumWarning.Visible = true; } FillFieldsFromCard(); } if (_isAddingCard) //We will run a 0.01 authorization so we will not allow the user to change the transaction type or the amount. { radioAuthorization.Checked = true; _trantype = PayConnectService.transType.AUTH; groupTransType.Enabled = false; labelAmount.Visible = false; textAmount.Visible = false; checkSaveToken.Checked = true; checkSaveToken.Enabled = false; checkForceDuplicate.Checked = true; checkForceDuplicate.Enabled = false; } }