Method PostAutoPayUpdateExt

Summary

Auto Pay Update Extended

Remarks

Auto Pay Update Extended

Input Parameters

NameTypeLengthDescription
customerNumber numeric 9 [Required] Customer Number. See Account Search methods.
locationNumber numeric 9 [Required] Location Number. See Account Search methods.
transactionID System.String 1 Transaction Code. R=Search, U=Update, V=Validate. Default is U=Update. Use V to validate eCheck account numbers before saving.
autoPayTypeCode System.String 1 Auto Pay Type Code. N=None R=CreditCard C=Checking 5 = CreditCard no Final S = Savings. Required if U=Update (default). Use N to disable auto-pay.
bankRouting numeric 9 Bank Routing Number. Required for eCheck.
bankCode numeric 2 Bank Code. Required for eCheck or savings.
bankDescription numeric 25 Bank Description.
acctNumber numeric 17 Bank Account Number. Required for eCheck or savings.
autoPayDay numeric 2 Day of month to pay on. If DraftDaysUsed from GetAutoPaySetup is set to Y, then autoPayDay is required when setting to Checking or Credit Card. Use GetAutoPaySetup to get list of valid days.

Example

POST http://localhost/FusionServices/v3/Naviline/Utilities/AutoPayUpdateExt

Return Values

NameDescription
AutoPay Auto Pay Type Code
BankRate Bank Rate
BankCode Bank Code
BankDescription Bank Description
AccountNumber Bank Account Number
AutoPayDay Day of month to pay on
AutoPayDescription Description of current auto-pay settings
CustomerFlag Customer Flag
ErrorCode Error code returned from the call. 0000 indicates success.
ErrorMessage Error message returned if there was an error.

Sample Responses

Sample Code

using System.Net;
using Newtonsoft.Json.Linq;

public void MethodName(parms)
{
   string uri = "http://localhost/FusionServices/v3/Naviline/Utilities/AutoPayUpdateExt";
   System.Collections.Specialized.NameValueCollection postParms = 
     new System.Collections.Specialized.NameValueCollection(); 
   // Set paramater values
   postParms.Add("customerNumber",System.Web.HttpUtility.UrlEncode("200787"));
   postParms.Add("locationNumber",System.Web.HttpUtility.UrlEncode("290291"));
   postParms.Add("autoPayTypeCode",System.Web.HttpUtility.UrlEncode("5"));

   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
   }
}

C# Razor MVC Sample Code

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 PostAutoPayUpdateExt
   {
       // 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 transactionID{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 bankRouting{get; set;}

       [RegularExpression("[0-9]{0,2}", ErrorMessage = "Numeric values only. Must be 2 digits or less. ")]
       public string bankCode{get; set;}

       [RegularExpression("[0-9]{0,25}", ErrorMessage = "Numeric values only. Must be 25 digits or less. ")]
       public string bankDescription{get; set;}

       [RegularExpression("[0-9]{0,17}", ErrorMessage = "Numeric values only. Must be 17 digits or less. ")]
       public string acctNumber{get; set;}

       [RegularExpression("[0-9]{0,2}", ErrorMessage = "Numeric values only. Must be 2 digits or less. ")]
       public string autoPayDay{get; set;}

       public PostAutoPayUpdateExt()
       {
           //Set any defaults here
       }
   }
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostAutoPayUpdateExt 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.PostAutoPayUpdateExt

@{
   ViewBag.Title = "PostAutoPayUpdateExt";
}

<h2>PostAutoPayUpdateExt</h2>
@using (Html.BeginForm()) {
   @Html.AntiForgeryToken()
   @Html.ValidationSummary(true)
   <fieldset>
   <legend>PostAutoPayUpdateExt</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.transactionID)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.transactionID)
           @Html.ValidationMessageFor(model => model.transactionID)
       </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.bankRouting)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.bankRouting)
           @Html.ValidationMessageFor(model => model.bankRouting)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.bankCode)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.bankCode)
           @Html.ValidationMessageFor(model => model.bankCode)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.bankDescription)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.bankDescription)
           @Html.ValidationMessageFor(model => model.bankDescription)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.acctNumber)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.acctNumber)
           @Html.ValidationMessageFor(model => model.acctNumber)
       </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>
       <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/PostAutoPayUpdateExt
public ActionResult PostAutoPayUpdateExt()
{
   // Create a new instance of the model to pick up any default values.
   PostAutoPayUpdateExt model =  new PostAutoPayUpdateExt();

   // pass model to set to default values
   // NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
   return View("~/Views/MyFolderPath/PostAutoPayUpdateExt.cshtml", model);
}

// 
// POST: /MyController/PostAutoPayUpdateExt
[HttpPost]
public ActionResult PostAutoPayUpdateExt(FormCollection collection)
{
   string url = "v3/Naviline/Utilities/AutoPayUpdateExt";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("customerNumber", collection["customerNumber"]);
   inputParms.Add("locationNumber", collection["locationNumber"]);
   inputParms.Add("transactionID", collection["transactionID"]);
   inputParms.Add("autoPayTypeCode", collection["autoPayTypeCode"]);
   inputParms.Add("bankRouting", collection["bankRouting"]);
   inputParms.Add("bankCode", collection["bankCode"]);
   inputParms.Add("bankDescription", collection["bankDescription"]);
   inputParms.Add("acctNumber", collection["acctNumber"]);
   inputParms.Add("autoPayDay", collection["autoPayDay"]);

   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", "PostAutoPayUpdateExt");
       return View("Error", info);
   }
}