Pre-Authorized Payment Enrollment with Terms and Conditions
Use the AutoPay Update method for enrollment without Terms and Conditions fields.
| Name | Type | Length | Description |
|---|---|---|---|
| customerNumber | numeric | 9 | [Required] Customer Number. See Account Search methods. |
| locationNumber | numeric | 9 | [Required] Location Number. See Account Search methods. |
| transactionCode | System.String | 1 | Transaction Code. U=Update (default), V=Validate, D=Delete. |
| autoPayTypeCode | System.String | 1 | AutoPay Type Code. N=None, R=Credit Card, C=eCheck. Required for U and V transactions. |
| bankRoutingNumber | numeric | 9 | Bank Routing Number. Required for eCheck enrollment. |
| bankAccountNumber | numeric | 17 | Bank Account Number. Required for eCheck enrollment. |
| autoPayDay | numeric | 2 | Day of month for automatic payment draft. |
| prenoteRequired | System.String | 1 | Prenote Required. Y or N. Defaults to Y for eCheck. |
| tcDate | System.String | 8 | Date citizen accepted Terms and Conditions. Format: CCYYMMDD. |
| tcTime | System.String | 6 | Time citizen accepted Terms and Conditions. Format: HHMMSS. |
| pbFlag | System.String | 1 | Paperless Billing flag. |
| tcText1 | System.String | 5000 | Terms and Conditions text block 1. |
| tcText2 | System.String | 5000 | Terms and Conditions text block 2. |
| tcText3 | System.String | 5000 | Terms and Conditions text block 3. |
| tcEmail | System.String | 64 | Email address for Terms and Conditions receipt. |
POST http://localhost/FusionServices/v3/Naviline/Utilities/AutoPayEnrollment
| Name | Description |
|---|---|
| AutoPayTypeDescription | Description of the AutoPay type enrolled. |
| CustomerFlag | Customer level flag. |
| ErrorCode | 0000 |
| ErrorMessage |
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms)
{
string uri = "http://localhost/FusionServices/v3/Naviline/Utilities/AutoPayEnrollment";
System.Collections.Specialized.NameValueCollection postParms =
new System.Collections.Specialized.NameValueCollection();
// Set paramater values
postParms.Add("customerNumber",System.Web.HttpUtility.UrlEncode("201"));
postParms.Add("locationNumber",System.Web.HttpUtility.UrlEncode("28578"));
postParms.Add("transactionCode",System.Web.HttpUtility.UrlEncode("U"));
postParms.Add("autoPayTypeCode",System.Web.HttpUtility.UrlEncode("C"));
postParms.Add("bankRoutingNumber",System.Web.HttpUtility.UrlEncode("111000025"));
postParms.Add("bankAccountNumber",System.Web.HttpUtility.UrlEncode("2079951060453"));
postParms.Add("autoPayDay",System.Web.HttpUtility.UrlEncode("5"));
postParms.Add("tcDate",System.Web.HttpUtility.UrlEncode("20260604"));
postParms.Add("tcTime",System.Web.HttpUtility.UrlEncode("120000"));
postParms.Add("tcEmail",System.Web.HttpUtility.UrlEncode("test@example.com"));
WebClient req = new WebClient();
wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
wc.Headers.Set("X-APPID", "YOURID");
wc.Headers.Set("X-APPKEY", "YOURKEY");
byte[] responseBytes = wc.UploadValues(new Uri(uri), "POST", postParms);
string stringResult = Encoding.UTF8.GetString(responseBytes);
JObject response = JObject.Parse(stringResult);
string error = response["OutputParms"]["ErrorCode"].ToString();
if (error == "0000")
{
// TODO - YOUR CODE HERE
}
}
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 PostAutoPayEnrollment
{
// Add property for each input param in order to map a field to it
[Required(ErrorMessage = "Required")]
[RegularExpression("[0-9]{0,9}", ErrorMessage = "Numeric values only. Must be 9 digits or less. ")]
public string customerNumber{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("[0-9]{0,9}", ErrorMessage = "Numeric values only. Must be 9 digits or less. ")]
public string locationNumber{get; set;}
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string transactionCode{get; set;}
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string autoPayTypeCode{get; set;}
[RegularExpression("[0-9]{0,9}", ErrorMessage = "Numeric values only. Must be 9 digits or less. ")]
public string bankRoutingNumber{get; set;}
[RegularExpression("[0-9]{0,17}", ErrorMessage = "Numeric values only. Must be 17 digits or less. ")]
public string bankAccountNumber{get; set;}
[RegularExpression("[0-9]{0,2}", ErrorMessage = "Numeric values only. Must be 2 digits or less. ")]
public string autoPayDay{get; set;}
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string prenoteRequired{get; set;}
[RegularExpression("^(?=.{0,8}$).*", ErrorMessage = "Must be 8 characters or less. ")]
public string tcDate{get; set;}
[RegularExpression("^(?=.{0,6}$).*", ErrorMessage = "Must be 6 characters or less. ")]
public string tcTime{get; set;}
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string pbFlag{get; set;}
[RegularExpression("^(?=.{0,5000}$).*", ErrorMessage = "Must be 5000 characters or less. ")]
public string tcText1{get; set;}
[RegularExpression("^(?=.{0,5000}$).*", ErrorMessage = "Must be 5000 characters or less. ")]
public string tcText2{get; set;}
[RegularExpression("^(?=.{0,5000}$).*", ErrorMessage = "Must be 5000 characters or less. ")]
public string tcText3{get; set;}
[RegularExpression("^(?=.{0,64}$).*", ErrorMessage = "Must be 64 characters or less. ")]
public string tcEmail{get; set;}
public PostAutoPayEnrollment()
{
//Set any defaults here
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostAutoPayEnrollment 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.PostAutoPayEnrollment
@{
ViewBag.Title = "PostAutoPayEnrollment";
}
<h2>PostAutoPayEnrollment</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>PostAutoPayEnrollment</legend>
<div class="editor-label">
@Html.LabelFor(model => model.customerNumber)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.customerNumber)
@Html.ValidationMessageFor(model => model.customerNumber)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.locationNumber)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.locationNumber)
@Html.ValidationMessageFor(model => model.locationNumber)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.transactionCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.transactionCode)
@Html.ValidationMessageFor(model => model.transactionCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.autoPayTypeCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.autoPayTypeCode)
@Html.ValidationMessageFor(model => model.autoPayTypeCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.bankRoutingNumber)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.bankRoutingNumber)
@Html.ValidationMessageFor(model => model.bankRoutingNumber)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.bankAccountNumber)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.bankAccountNumber)
@Html.ValidationMessageFor(model => model.bankAccountNumber)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.autoPayDay)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.autoPayDay)
@Html.ValidationMessageFor(model => model.autoPayDay)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.prenoteRequired)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.prenoteRequired)
@Html.ValidationMessageFor(model => model.prenoteRequired)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.tcDate)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.tcDate)
@Html.ValidationMessageFor(model => model.tcDate)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.tcTime)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.tcTime)
@Html.ValidationMessageFor(model => model.tcTime)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.pbFlag)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.pbFlag)
@Html.ValidationMessageFor(model => model.pbFlag)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.tcText1)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.tcText1)
@Html.ValidationMessageFor(model => model.tcText1)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.tcText2)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.tcText2)
@Html.ValidationMessageFor(model => model.tcText2)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.tcText3)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.tcText3)
@Html.ValidationMessageFor(model => model.tcText3)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.tcEmail)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.tcEmail)
@Html.ValidationMessageFor(model => model.tcEmail)
</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/PostAutoPayEnrollment
public ActionResult PostAutoPayEnrollment()
{
// Create a new instance of the model to pick up any default values.
PostAutoPayEnrollment model = new PostAutoPayEnrollment();
// pass model to set to default values
// NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
return View("~/Views/MyFolderPath/PostAutoPayEnrollment.cshtml", model);
}
//
// POST: /MyController/PostAutoPayEnrollment
[HttpPost]
public ActionResult PostAutoPayEnrollment(FormCollection collection)
{
string url = "v3/Naviline/Utilities/AutoPayEnrollment";
// Get the value from each input field
NameValueCollection inputParms = new NameValueCollection();
inputParms.Add("customerNumber", collection["customerNumber"]);
inputParms.Add("locationNumber", collection["locationNumber"]);
inputParms.Add("transactionCode", collection["transactionCode"]);
inputParms.Add("autoPayTypeCode", collection["autoPayTypeCode"]);
inputParms.Add("bankRoutingNumber", collection["bankRoutingNumber"]);
inputParms.Add("bankAccountNumber", collection["bankAccountNumber"]);
inputParms.Add("autoPayDay", collection["autoPayDay"]);
inputParms.Add("prenoteRequired", collection["prenoteRequired"]);
inputParms.Add("tcDate", collection["tcDate"]);
inputParms.Add("tcTime", collection["tcTime"]);
inputParms.Add("pbFlag", collection["pbFlag"]);
inputParms.Add("tcText1", collection["tcText1"]);
inputParms.Add("tcText2", collection["tcText2"]);
inputParms.Add("tcText3", collection["tcText3"]);
inputParms.Add("tcEmail", collection["tcEmail"]);
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", "PostAutoPayEnrollment");
return View("Error", info);
}
}