Archive

Posts Tagged ‘Auto Pay’

SWS GetAutoPaySettings Method

May 12, 2011 Leave a comment

Retrieves autopay account settings for a rental item with an active autopay rental (default). Retrieves autopay settings for the entire account if no rental item has an active autopay account.

Parameters

Name DataType Is Required
ActiveOnly Boolean Optional
Description Adds a filter to return only active autopays (“True”) or inactive autopays (“False”). Defaults to “True.”
RentalID Long Required
Description The rental item’s ID number. This is returned when using the MakeReservation method or can be searched for using the SearchBy method.
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.

Returned Parameters

Name DataType
AccountType APAccountType
Description The ACH account type.
Available values:

  • CREDIT
  • DEBIT
  • ACH_CHECKING
  • ACH_SAVINGS
ACHInfo APACHData
Description The ACH data object if ACH was used for the autopay.
AutoPayID Long
Description The AutoPay credit card’s ID number. If it’s a new AutoPay credit card then it is undefined, if it is an updated AutoPay credit card, it is required for the update.
City String
Description The credit card billing city for the address. Max string length of 50.
CreditCardData APCreditCardData
Description The credit card information, if credit card information was added to autopay.
IsActive Boolean
Description Indicates whether the autopay is active (“True”) or not (“False”).
PostalCode String
Description The credit card billing postal/ZIP code for the address. Max string length of 25.
Receipt APReceiptTypes
Description The AutoPay receipt type to be sent to the customer. Default is “None”.
Available values:

  • None
  • Email_Receipt
RentalID Long
Description The rental item’s ID number.
State String
Description The credit card billing state/province for the address. Max string length of 50.
Street String
Description The credit card billing street address. Max string length of 50.

Example

As with every method we need to pass in credentials. We do this with the LookupUser request object.

We’ll assume you’ve got a web reference, let’s name it SWS, in your Visual Studio project.  At this point we need to our objects.  We’ll need the standard service object, a GetAutoPaySettings request object and a GetAutoPaySettings response object. We can define and create those like this:

// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetAutoPaySettings_Request request = new SWS.GetAutoPaySettings_Request();
SWS.GetAutoPaySettings_Response[] response;

Here’s my sample code of the Request object.

// GetAutoPaySettings Request
request.SiteID = 123456;
request.RentalID = 1123456;
request.ActiveOnly = true;

Finally we can call the method and pass across the login object and the request object to perform our reservation. It’s a good idea to do this in a Try Catch block.

// Call the method that will load the response object
try
{
  response = service.GetAutoPaySettings(user_request,request);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}

Note that if something goes wrong the service will respond with an exception. You’ll want to take a look at that message returned in that exception so it can be debugged.

For a full list of methods see SWS Methods.