Post a Code Enforcement payment
First get the list of fees from GetCaseFees, then send this request to pay each fee one at a time, using the FeeCode.
If you are adding on a convenience fee, use the AddtlFeeCode and AddtlFeeAmount fields to send this information.
Name | Type | Length | Description |
---|---|---|---|
CaseYear | numeric | 2 | [Required] Case Year. 2 digit year the code enforcement case was created |
CaseID | numeric | 8 | [Required] Case ID. ID number of the code enforcement case |
ForeignKey | System.String | 0 | [Required] 3rd Party Transaction ID. Must be unique for each call to this method. |
OrigCode | numeric | 2 | Origination code used to map to batch payments. Defaults to 11 for 3rd Party payments. |
Modifier | System.String | 1 | Modifier code used to map to batch payments. Defaults to blank for 3rd Party payments. |
FeeCode | System.String | 2 | [Required] Fee Code. The 2 letter code indicating the type of fee. This is the FeeCode field returned from GetCaseFees |
PaymentAmount | System.String | 9 | [Required] The Dollar amount of the fee being paid. |
PaymentDesc | System.String | 25 | Description of the payment. This would be the FeeCodeDescription returned from GetCaseFees |
AddtlFeeCode | System.String | 4 | [Optional] Additional Fee Code. The 4 letter code indicating the type of fee. This is for an additional fee being charged such as a convenience fee. |
AddtlFeeAmount | System.String | 9 | The Dollar amount of the additional fee. Only used if AddtlFeeCode is entered. |
TotalPaidAmount | System.String | 9 | The total Dollar amount being paid. This includes any additional fees. If no additional fees, this will use the value of PaymentAmount. |
PaymentComment | System.String | 9 | A comment to include with the payment |
LinkedForeignKey | System.String | 15 | Optional linked Foreign Key used by 3rd party to identify payment |
SpecialNote | System.String | 30 | Optional Control field reserved for SPS applications for special processing. A ‘Y’ specified in column 1 indicates a Building Permits Application “approval” and payment ready to process. A ‘Y’ specified in column 2 indicates the overrideTenderMethod code should be applied when transaction is created in NaviLine Cash Receipts. Should not be reported by 3rd party processors |
TenderProcessFlag | System.String | 1 | Optional. Control field reserved for SPS applications for special processing . Should not be reported by 3rd party processors. |
OverrideTenderMethod | System.String | 2 | Optional. When specialNote field has a ‘Y’ specified in the 2nd position, used to override the default Tender Method Code defined in the NaviLine Application Interface batch creation defaults table. Used to show the different tender methods used for payment. |
AuthCode | System.String | 6 | Authorization code |
CardType | System.String | 10 | Credit card vendor |
CardNumber | System.String | 25 | Last 4 digits of the credit card |
PaymentDate | System.String | 8 | Date payment was made. Format: yyyyMMdd. Defaults to current date. |
PaymentTime | hhmmss | 0 | Time payment was made. Format: HHmmss. Defaults to current time. |
Comment1 | System.String | 30 | Additional comment 1 |
Comment2 | System.String | 30 | Additional comment 2 |
Comment3 | System.String | 30 | Additional comment 3 |
Comment4 | System.String | 30 | Additional comment 4 |
POST http://localhost/FusionServices/v2/NaviLine/Payment/CE
Name | Description |
---|---|
ErrorCode | 0000 for success |
ErrorMessage | Message sent back from the payment service |
ErrorResponse | Status sent back from the payment service OK/FAIL |
RoutingID | Routing ID generated by the payment service if successful |
using System;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Collections.Specialized;
using FusionServiceHelper.Models;
// NOTE: Use the namespace generated when you add the class, so that it is correct.
namespace FusionRazor.Models
{
public class PostPaymentCE
{
// Add property for each input param in order to map a field to it
[Required(ErrorMessage = "Required")]
[RegularExpression("[0-9]{0,2}", ErrorMessage = "Numeric values only. Must be 2 digits or less. ")]
public string CaseYear{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("[0-9]{0,8}", ErrorMessage = "Numeric values only. Must be 8 digits or less. ")]
public string CaseID{get; set;}
[Required(ErrorMessage = "Required")]
public string ForeignKey{get; set;}
[RegularExpression("[0-9]{0,2}", ErrorMessage = "Numeric values only. Must be 2 digits or less. ")]
public string OrigCode{get; set;}
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string Modifier{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,2}$).*", ErrorMessage = "Must be 2 characters or less. ")]
public string FeeCode{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,9}$).*", ErrorMessage = "Must be 9 characters or less. ")]
public string PaymentAmount{get; set;}
[RegularExpression("^(?=.{0,25}$).*", ErrorMessage = "Must be 25 characters or less. ")]
public string PaymentDesc{get; set;}
[RegularExpression("^(?=.{0,4}$).*", ErrorMessage = "Must be 4 characters or less. ")]
public string AddtlFeeCode{get; set;}
[RegularExpression("^(?=.{0,9}$).*", ErrorMessage = "Must be 9 characters or less. ")]
public string AddtlFeeAmount{get; set;}
[RegularExpression("^(?=.{0,9}$).*", ErrorMessage = "Must be 9 characters or less. ")]
public string TotalPaidAmount{get; set;}
[RegularExpression("^(?=.{0,9}$).*", ErrorMessage = "Must be 9 characters or less. ")]
public string PaymentComment{get; set;}
[RegularExpression("^(?=.{0,15}$).*", ErrorMessage = "Must be 15 characters or less. ")]
public string LinkedForeignKey{get; set;}
[RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
public string SpecialNote{get; set;}
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string TenderProcessFlag{get; set;}
[RegularExpression("^(?=.{0,2}$).*", ErrorMessage = "Must be 2 characters or less. ")]
public string OverrideTenderMethod{get; set;}
[RegularExpression("^(?=.{0,6}$).*", ErrorMessage = "Must be 6 characters or less. ")]
public string AuthCode{get; set;}
[RegularExpression("^(?=.{0,10}$).*", ErrorMessage = "Must be 10 characters or less. ")]
public string CardType{get; set;}
[RegularExpression("^(?=.{0,25}$).*", ErrorMessage = "Must be 25 characters or less. ")]
public string CardNumber{get; set;}
[RegularExpression("^(?=.{0,8}$).*", ErrorMessage = "Must be 8 characters or less. ")]
public string PaymentDate{get; set;}
public string PaymentTime{get; set;}
[RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
public string Comment1{get; set;}
[RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
public string Comment2{get; set;}
[RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
public string Comment3{get; set;}
[RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
public string Comment4{get; set;}
public PostPaymentCE()
{
//Set any defaults here
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostPaymentCE class. *@
@* NOTE: Select Edit as the Scaffold template. *@
@* NOTE: Use the @model line that is generated at the top. Replace the rest with the lines below.
@model FusionRazor.Models.PostPaymentCE
@{
ViewBag.Title = "PostPaymentCE";
}
<h2>PostPaymentCE</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>PostPaymentCE</legend>
<div class="editor-label">
@Html.LabelFor(model => model.CaseYear)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.CaseYear)
@Html.ValidationMessageFor(model => model.CaseYear)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.CaseID)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.CaseID)
@Html.ValidationMessageFor(model => model.CaseID)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.ForeignKey)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.ForeignKey)
@Html.ValidationMessageFor(model => model.ForeignKey)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.OrigCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.OrigCode)
@Html.ValidationMessageFor(model => model.OrigCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Modifier)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Modifier)
@Html.ValidationMessageFor(model => model.Modifier)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.FeeCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.FeeCode)
@Html.ValidationMessageFor(model => model.FeeCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.PaymentAmount)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.PaymentAmount)
@Html.ValidationMessageFor(model => model.PaymentAmount)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.PaymentDesc)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.PaymentDesc)
@Html.ValidationMessageFor(model => model.PaymentDesc)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.AddtlFeeCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.AddtlFeeCode)
@Html.ValidationMessageFor(model => model.AddtlFeeCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.AddtlFeeAmount)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.AddtlFeeAmount)
@Html.ValidationMessageFor(model => model.AddtlFeeAmount)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.TotalPaidAmount)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.TotalPaidAmount)
@Html.ValidationMessageFor(model => model.TotalPaidAmount)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.PaymentComment)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.PaymentComment)
@Html.ValidationMessageFor(model => model.PaymentComment)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.LinkedForeignKey)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.LinkedForeignKey)
@Html.ValidationMessageFor(model => model.LinkedForeignKey)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.SpecialNote)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.SpecialNote)
@Html.ValidationMessageFor(model => model.SpecialNote)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.TenderProcessFlag)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.TenderProcessFlag)
@Html.ValidationMessageFor(model => model.TenderProcessFlag)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.OverrideTenderMethod)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.OverrideTenderMethod)
@Html.ValidationMessageFor(model => model.OverrideTenderMethod)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.AuthCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.AuthCode)
@Html.ValidationMessageFor(model => model.AuthCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.CardType)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.CardType)
@Html.ValidationMessageFor(model => model.CardType)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.CardNumber)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.CardNumber)
@Html.ValidationMessageFor(model => model.CardNumber)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.PaymentDate)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.PaymentDate)
@Html.ValidationMessageFor(model => model.PaymentDate)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.PaymentTime)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.PaymentTime)
@Html.ValidationMessageFor(model => model.PaymentTime)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Comment1)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Comment1)
@Html.ValidationMessageFor(model => model.Comment1)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Comment2)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Comment2)
@Html.ValidationMessageFor(model => model.Comment2)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Comment3)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Comment3)
@Html.ValidationMessageFor(model => model.Comment3)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Comment4)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Comment4)
@Html.ValidationMessageFor(model => model.Comment4)
</div>
<p>
<input type="submit" value="Submit"/>
</p>
</fieldset>
}
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
using System;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FusionServiceHelper.Models;
// NOTE: Replace 'MyController' with the name of your controller.
//
// GET: /MyController/PostPaymentCE
public ActionResult PostPaymentCE()
{
// Create a new instance of the model to pick up any default values.
PostPaymentCE model = new PostPaymentCE();
// pass model to set to default values
// NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
return View("~/Views/MyFolderPath/PostPaymentCE.cshtml", model);
}
//
// POST: /MyController/PostPaymentCE
[HttpPost]
public ActionResult PostPaymentCE(FormCollection collection)
{
string url = "v2/NaviLine/Payment/CE";
// Get the value from each input field
NameValueCollection inputParms = new NameValueCollection();
inputParms.Add("CaseYear", collection["CaseYear"]);
inputParms.Add("CaseID", collection["CaseID"]);
inputParms.Add("ForeignKey", collection["ForeignKey"]);
inputParms.Add("OrigCode", collection["OrigCode"]);
inputParms.Add("Modifier", collection["Modifier"]);
inputParms.Add("FeeCode", collection["FeeCode"]);
inputParms.Add("PaymentAmount", collection["PaymentAmount"]);
inputParms.Add("PaymentDesc", collection["PaymentDesc"]);
inputParms.Add("AddtlFeeCode", collection["AddtlFeeCode"]);
inputParms.Add("AddtlFeeAmount", collection["AddtlFeeAmount"]);
inputParms.Add("TotalPaidAmount", collection["TotalPaidAmount"]);
inputParms.Add("PaymentComment", collection["PaymentComment"]);
inputParms.Add("LinkedForeignKey", collection["LinkedForeignKey"]);
inputParms.Add("SpecialNote", collection["SpecialNote"]);
inputParms.Add("TenderProcessFlag", collection["TenderProcessFlag"]);
inputParms.Add("OverrideTenderMethod", collection["OverrideTenderMethod"]);
inputParms.Add("AuthCode", collection["AuthCode"]);
inputParms.Add("CardType", collection["CardType"]);
inputParms.Add("CardNumber", collection["CardNumber"]);
inputParms.Add("PaymentDate", collection["PaymentDate"]);
inputParms.Add("PaymentTime", collection["PaymentTime"]);
inputParms.Add("Comment1", collection["Comment1"]);
inputParms.Add("Comment2", collection["Comment2"]);
inputParms.Add("Comment3", collection["Comment3"]);
inputParms.Add("Comment4", collection["Comment4"]);
try
{
// Send the request
FusionServiceRequest request = new FusionServiceRequest();
FusionServiceResult result = request.Post(url, inputParms);
return View("Result", result);
}
catch(Exception e)
{
HandleErrorInfo info = new HandleErrorInfo(e, "MyController", "PostPaymentCE");
return View("Error", info);
}
}