processsale
Description
processsale takes a description of a sale and queues it for processing asynchronously. Synchronously: approvals are obtained for credit cards. Asynchronously: The sale is "read" by Sales32c and credit cards are activated in the batch. For a description of the
<sale> tag and an extended example, see
Overview of tags in <sale>.
Example:
<sale><settlement><swipe>*378340467012013^1201~</swipe></settlement> <item><dci>PASSES COPPER SPR1 </dci><qty>1</qty> <guest><renew><guest_no>15010000</guest_no></renew></guest></item></sale>
A sub-function called verifysale is called by processsale to help cut down on bad sale strings getting passed to Sales Host for processing. This function runs a variety of checks on the sale to make sure that it is OK to be processed. verifysale checks payment amounts, quantities of items in the sale, the number of modifiers and the existence of templates, as well as guest information (if required).
The ww.dll allow a card on file from a guest record to be used for payment inside of the settlement section of the processsale call. This is accomplished by including the guest_no and devicetype along with a pmt_type of *CARDONFILE* inside of the <settlement> tags.
Example:
<settlement><pmt_type>*CARDONFILE*</pmt_type><guest_no>6000001</guest_no><devicetype>15</devicetype></settlement>
or,
<settlement><pmt1><pmt_type>*CARDONFILE*</pmt_type><guest_no>6000001</guest_no><devicetype>15</devicetype></pmt1></settlement>
The presence of the *CARDONFILE* in the pmt_type instructs ww.dll to use the guest_no in order to find the correct guests.cc_swipe field to use for payment.
Note: that the <devicetype> tag is still required to indicate how to process.
Processsale will also check the validation number (PIN). If a DebitWare card is configured to require a validation number (PIN) for purchases, then the PIN must be included in the call to GetDebitwareApproval that ww.dll makes when processing the processsale call. If an incorrect PIN or no PIN is passed in for a DebitWare card that requires a PIN, the GetDebitwareApproval stored procedure returns, “ERR: Unable to GetDebitwareApproval: PIN Does Not Match” and the processing of the sale stops.
Input fields
Return fields
XML tag | Description |
<wwsale_id> | Web sale ID. If a wwsale_id that is passed already exists in the ww_sales table, ww.dll returns, “ERR:wwsale_id is not unique.” |
Examples
Example invocation:
<func>processsale</func>
<sale>
<res_hdr><guest_no>16099000</guest_no></res_hdr>
<save><first_name>MATT</first_name><last_name>MESSINGER</last_name></save>
<settlement><card_no>4300000000000009</card_no><exp_date>0505</exp_date>
<card_addr>202 Nowhere Ln.</card_addr><card_zip>02061</card_zip>
<ship_zip>80302</ship_zip>
<amount>40.05</amount>
<tax>0.00</tax>
<card_cvv2>101</card_cvv2>
</settlement>
<item><dci>AAA-MATT AAA CANDY</dci>
<qty>1</qty><price>40.05</price><date>01/18/2004</date>
</item>
</sale>
Example return string:
OK: <wwsale_id>1000000<wwsale_id>
See also
None