Archive

Posts Tagged ‘Payment’

SWS getReceiptRules Method

April 20, 2011 Leave a comment

Retrieves a list of site-defined rules pertaining to receipts.

Parameters

Name Data Type Is Required
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.

Returned Parameters

Name Data Type
ruleID Long
Description The rule’s ID number.
ruleName String
Description The name of the rule in the system.
desc String
Description The description of the rule.
currSiteValue String
Description The option that is currently assigned to the rule.
siteValueMeaning String
Description The textual value of the currSiteValue. If the textual value is a number it will be the same.

Example

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

We will assume you have a web reference, let us name it SWS, in your Visual Studio project. At this point we need to define our objects. We will need the standard service object, a getRules request object, and a getRules response object. We can define and create those like this:

// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.getRules_Request request = new SWS.getRules_Request();
SWS.getRules_Response response;

Here’s a sample code of the request object:

// GetReceiptRules Request
request.SiteID = 123456;

Finally we can call the method and pass across the login object and the request object to retrieve the receipt rules for the specified site. 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.getReceiptRules(user_request, request);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}

Note that if something goes wrong the service will respond with an exception. You will want to capture the message returned in that exception so it can be debugged.

For a full list of methods see SWS Methods.

SWS GetAssessmentsByID Method

April 20, 2011 Leave a comment

Retrieves assessments (i.e., rent, insurance, fees, etc.) for a list of assessment ID numbers and the total amount due for each.

Parameters

Name DataType Is Required
AssessIDs Long Required
Description An array of the assessment’s ID numbers.
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.

Returned Parameters

Name DataType
SOA_GET_ASSESSMENTS SOA_GET_ASSESSMENTS
Description Object containing the information returned for the method.
TotalDue Decimal
Description The total amount due for the assessments.

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 GetAssessmentsByID request object and a GetAssessmentsByID response object.

// Create request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetAssessmentsByID_Request request = new SWS.GetAssessmentsByID_Request();
SWS.GetAssessmentsByID_Response response;

Here’s my sample code of the Request object.

// GetAssessmentsByID Request
request.SiteID = 123456;
request.AssessIDs = new long[] { 213456, 456789 };

Finally we can call the method and pass across the login object and the request object to get our assessments by ID. 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.GetAssessmentsByID(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.

How to enable the Transaction Details API for Authorize.NET

April 16, 2011 Leave a comment

If you use Authorize.NET to verify your Credit Card or ACH transactions for Store then you may need to enable the “Transaction Details API” if you want to get updates on your transactions. The “Transaction Details API” provided by Authorize.NET provides detailed reporting on past transactions which occurred through Authorize.NET. To enable the API you will need to login to your Authorize.NET portal. The portal address and login information will be provided by Authorize.NET.  Once logged in, click on the “Account” menu item on the top. Under the “Security Settings” section at the bottom you should see a link that says “Transaction Details API”. After clicking on the link, you should see a button on the page labeled “Enable Transaction Details API”.  Once enabled you are ready to go.

SWS MakePayment Method

April 16, 2011 Leave a comment

Allows for payment on an account for rental and/or retail items. Any unused amount will be applied to their account as cash credit/escrow, if the site rules allow. Partial payments are not allowed through the API. This payment method allows you to use two payment types at one time, with up to three payments per type. Due to system restrictions you will not be able to use multiple payment types, if there are multiple units and a check is involved. To apply the check, use it towards one unit. The balance will apply to cash credit/escrow which can be used towards the remaining payment/s.

Parameters

Name DataType Is Required
AcctID 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.
CashCreditAmount Decimal Optional
Description You can find the amount of cash credit/escrow on the account using the GetCashCredit method. If you are using any portion of a cash credit/escrow, this is required to tell the system how much of the cash credit/escrow to use.
CashCreditID Decimal Optional
Description You can find the amount of cash credit/escrow on the account using the GetCashCredit method. If you are using any portion of a cash credit/escrow, this is required to tell the system which cash credit to use for the cash credit amount if there are multiple cash credits.
CashInfo Decimal Optional*
Description This is the total amount of the cash portion of the payment.
* At least one form of payment is required.
CheckInfo CheckData Optional*
Description If making a check payment, you can use the CheckData object for up to three checks.
* At least one form of payment is required.
CreditCardInfo CreditCardData Optional*
Description If making a credit card payment, you can use the CreditCardData object for up to three credit cards.
* At least one form of payment is required.
Cycles Integer Array Optional
Description The number of rental cycles/periods for which the payment will apply. If no cycles are passed in it is assumed only one cycle should be paid. You are limited to the number of cycles you can apply based on the “Allowed Number of Days Paid Ahead” rule for the site. This can be found using the GetSiteRules method. This array must contain the same number of items as the RentalIDs. The arrays will match one to one when determining how many cycles to pay on each rental item. For example if an account has two rentals and you wish to pay for 2 cycles on the first and 1 cycle on the second, the value for this field would be {2,1}.
IsRetail Boolean Required
Description Indicates if the payment will be for only retail assessments (“True”) or only for rental assessments (“False”).
IsRetailAndRental Boolean Required
Description Indicates if the payment will be for both retail and rental assessments (“True”) or only for rental assessments (“False”).
MoveOutDate DateTime Optional
Description The date applied when vacating a rental item. This defaults to today’s date unless otherwise specified, if the payment is for a move out. The date can be set in the past, based on the site’s End Rental rule settings. This can be found using the GetSiteRules method. No future dates are allowed.
PayAssessData AssessmentData Optional
Description Allows a tenant to pay for specific assessments on a rental item instead of the amount due. This will allow a customer to pay one month of assessment if they are delinquent.
RentalIDs Long Array Optional
Description The rental item’s ID number, or an array of rental IDs, to specify which units are to be paid. If no IDs are passed in, all rentals on the account are paid. This array must contain the same number of items as the cycles. The arrays will match one to one when determining how many cycles to pay on each rental item.
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.
TaxExemptNumber String Optional
Description If the organization is tax exempt, the tax ID must be included here. If the tax ID number is not the same as it is for the rental or if the rental is not tax exempt, multiple MakePayment transactions must be completed. String limit 20 characters.
TotalAmtDue Decimal Required
Description The total amount due based on the rental IDs, retail items, tax and other assessments. To obtain the total due, see the GetAssessments and GetTotalDue methods.
TotalAmtPaid Decimal Required
Description The total amount paid for the rental item which amounts to the total amount due. Only payment in full is accepted. The entire amount is applied.

Returned Parameters

Name DataType
CashCreditApplied Boolean
Description Indicates if an existing cash credit/escrow was successfully applied to the payment (“True”) or not (“False”).
TranID Long
Description The transaction’s ID number. Transaction IDs are system generated for each payment transaction that occurs in the system. A null or “0” response indicates the transaction failed.

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 MakePayment request object and a MakePayment response object. I am alos creating a CardData object as this example is for a credit card payment.

// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.MakePayment_Request request = new SWS.MakePayment_Request();
SWS.MakePayment_Response response;

SWS.CreditCardData cardRequest = new SWS.CreditCardData();

Here’s my sample code of the Request object paying for two rentals on an account for 2 cycles on each rental using a credit card.

// MakePayment Request
cardRequest.CardHolderName = "John Doe";
cardRequest.CardNumber = "4111111111111111";
cardRequest.CVV2 = "111";
cardRequest.ExpireMonth = "02";
cardRequest.ExpireYear = "2020";
cardRequest.Amount = 100m;

request.SiteID = 123456;
request.AcctID = 123456;
request.RentalIDs = new long[] { 123456, 456789 };
request.Cycles = new int[] { 2, 2 };
request.IsRetail = false;
request.TotalAmtDue = 100m;
request.TotalAmtPaid = 100m;
request.CreditCardInfo = new SWS.CreditCardData[] { cardRequest };

Finally we can call the method and pass across the login object and the request object to make our payment. 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.MakePayment(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.

Categories: API General, Payments Tags: