Home > API General, Refunds > SWS GetPreReversePayDetails Method

SWS GetPreReversePayDetails Method


Retrieves information about a payment being considered for reversal. Verifies that payment can be reversed and includes additional rentals and transactions that are affected.

Parameters

Name DataType Is Required
AccountID Long Required
Description The accounts ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method.
DontCreditCard Boolean Optional
Description This will reverse the payment in Store, but will not credit the funds back to the card (“True”) or will reverse the payment normally back to the card (“False”). “False” is the default setting which credits the payment back to the card. This is used with internally processed credit cards only. 
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.
TranDate DateTime Required
Description The date and time the transaction occurred.
TranID Long Required
Description The transaction’s ID number. Transaction IDs are system generated for each payment transaction that occurs in the system. If there is no transaction ID the transaction failed. The transaction ID is returned when any MakePayment method is used.
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.

Returned Parameters

Name DataType
ErrorMessage String
Description Message about any problems that occurred during the process, including details to locate errant code.
HasNonRetail Boolean
Description Indicates if any non-retail item will be included in the total (“True”) or not (“False”).
HasRetail Boolean
Description Indicates if any retail item will be included in the total (“True”) or not (“False”).
TnxStatus Integer
Description The numeric value of the transactions status.
RentalID Long
Description The rentals ID number.
RentalStatus Integer
Description The rentals status. Indicates whether the unit is reserved or rented.
UnitNumber String
Description The unit’s number as assigned by the organization. This is not the UnitID.
ObjectType Integer
Description Numeric value of the object type. Indicates if it is a rental object, retail item, a service, etc.
ParentID Long
Description The rental ID to which the non-rental object belongs.
TnxID Long
Description The transaction’s ID number. Transaction IDs are system generated for each payment transaction that occurs in the system. The status, roll-up and type are also included with this return.

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 ReversePayment request object and a GetPreReversePayDetails response object. You will also need one or more TranReversalInfo objects and one or more TransactionDate objects to provide transaction information for the payment(s) needing to be reversed. We can define and create those like this:

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

SWS.TransactionDate tranDates = new SWS.TransactionDate();
SWS.TranReversalInfo reverseDetails = new SWS.TranReversalInfo();

Here’s my sample code of the various objects required.

// GetPreReversePayDetails Request
tranDates.TranID = 123456;
tranDates.TranDate = DateTime.Today.AddDays(-5);

reverseDetails.AccountID = 123546;
reverseDetails.RentalID = 123456;
reverseDetails.TranDates = new SWS.TransactionDate[] { tranDates };

request.SiteID = 123456;
request.ReversalDetails =  new SWS.TranReversalInfo[] { reverseDetails };

Finally we can call the method and pass across the login object and the request object to get our filtered site unit data. 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.GetPreReversePayDetails(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, Refunds
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: