Archive
SWS GetAutoPaySettings Method
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:
|
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:
|
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.
SWS AddUpdateAutoPaySettings Method
Adds new or updates an existing automatic payment (autopay) record for the specified rental item. A separate autopay record must be defined for each rental on the account.
Parameters
Name | DataType | Is Required |
---|---|---|
AccountID | Long | Required |
Description | The account’s ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method. | |
AccountType | APAccountType | Required |
Description | The type of account that will be used for autopay. Available values:
|
|
ACHInfo | APACHData | Optional* |
Description | The autopay ACH information. If using a direct debit from a checking or savings account these fields are required. * One form of payment is required. |
|
AutoPayID | Long | Optional |
Description | The autopay record’s ID number. If it’s a new autopay record, it should be undefined. If you are updating an autopay record, it is required for the update to occur. | |
City | String | Optional |
Description | The autopay record’s billing city. This is required for new autopay record setup. Max string length of 50. | |
CreditCardInfo | APCreditCardData | Optional* |
Description | The autopay credit card’s information. If paying with credit or debit card you will need the card number, cardholders name, expiration date and CVV number of the card. * One form of payment is required. |
|
IsActive | Boolean | Required |
Description | Indicates if this autopay record will be active (“True”) or if you will be deactivating this autopay record (“False”). | |
IsNew | Boolean | Required |
Description | Indicates if this is a new autopay record (“True”) or if it is an update to an existing autopay record (“False”). | |
NoActiveAP | Boolean | Optional |
Description | Indicates that you are cancelling autopay (“True”) for the account. | |
PostalCode | String | Required |
Description | The postal/ZIP code for the address. This is required for new AutoPay credit card setups. Max string length of 25. | |
Receipt | APReceiptTypes | Optional |
Description | The type of receipt to send to customer after the AutoPay transaction occurs. Available values:
|
|
RentalID | Long | Required |
Description | The rental item’s ID number. This is returned when using the MakeReservation method or can be search for using the SearchBy method. | |
SiteID | Long | Required |
Description | The site’s ID number. This is found using the GetSiteList method. | |
State | String | Optional |
Description | The autopay credit card’s billing state/province. This is required for new autopay credit card setups. Max string length of 2. | |
StreetAddress | String | Required |
Description | The autopay credit card’s billing street address. This is required for new autopay credit card setups. Max string length of 50. |
Returned Parameters
Name | DataType |
---|---|
TransactionID | Long |
Description | The transaction’s ID number.Transaction IDs are system generated for each payment transaction that occurs in the system. |
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. Create the following objects:
// Create request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.AddUpdateAutoPaySettings_Request request = new SWS.AddUpdateAutoPaySettings_Request();
SWS.AddUpdateAutoPaySettings_Response response;
There are two sample requests below. The first is creating a brand new auto pay record on a rental that has no active existing records. The second example is updating an existing ACH record on a rental as indicated by setting the IsNew and NoActiveAP fields to false.
//Adds a New CreditCard auto payment record to a rental
request.AutoPayInfo.SiteID = 123456;
request.AutoPayInfo.AccountID = 123456;
request.AutoPayInfo.RentalID = 123456;
request.AutoPayInfo.IsNew = true;
request.AutoPayInfo.IsActive = true;
request.AutoPayInfo.StreetAddress = "123 Main St.";
request.AutoPayInfo.City = "My Town";
request.AutoPayInfo.State = "UT";
request.AutoPayInfo.PostalCode = "123456";
request.AutoPayInfo.NoActiveAP = true;
request.AutoPayInfo.Receipt = SWS.APReceiptTypes.Email_Receipt;
request.AutoPayInfo.CreditCardInfo.CardHolderName = "First Last";
request.AutoPayInfo.CreditCardInfo.CardNumber = "4000000000000000";
request.AutoPayInfo.CreditCardInfo.CVV2 = 123;
request.AutoPayInfo.CreditCardInfo.Exp = "05/2018";
//Updates an Existing ACH auto payment record
request.AutoPayInfo.SiteID = 123456;
request.AutoPayInfo.AccountID = 123456;
request.AutoPayInfo.RentalID = 123456;
request.AutoPayInfo.IsNew = false;
request.AutoPayInfo.IsActive = true;
request.AutoPayInfo.StreetAddress = "123 Main St.";
request.AutoPayInfo.City = "My Town";
request.AutoPayInfo.State = "UT";
request.AutoPayInfo.PostalCode = "123456";
request.AutoPayInfo.NoActiveAP = false;
request.AutoPayInfo.Receipt = SWS.APReceiptTypes.None;
request.AutoPayInfo.ACHInfo.AccountNumber = "023439392009";
request.AutoPayInfo.ACHInfo.RoutingNumber = "012345678";
Finally we can call the method and pass across the login object and the request object for updating autopay settings. It’s a good idea to do this in a Try Catch block.
try
{
// Call the method that will load the response object
response = service.AddUpdateAutoPaySettings(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.