initial import
[Business-OnlinePayment-PPIPayMover.git] / lib / Business / OnlinePayment / PPIPayMover / CreditCardRequest.pm
1 package Business::OnlinePayment::PPIPayMover::CreditCardRequest;\r
2 \r
3 use strict;\r
4 use vars qw(@ISA);\r
5 use Business::OnlinePayment::PPIPayMover::TransactionRequest;\r
6 use Business::OnlinePayment::PPIPayMover::CreditCardResponse;\r
7 use Business::OnlinePayment::PPIPayMover::AdditionalField;\r
8 use Business::OnlinePayment::PPIPayMover::constants;\r
9 use Business::OnlinePayment::PPIPayMover::CountryCodes;\r
10 use Business::OnlinePayment::PPIPayMover::URLEncoder;\r
11 \r
12 @ISA = qw(Business::OnlinePayment::PPIPayMover::TransactionRequest);\r
13 1;\r
14 \r
15 #default constructor\r
16 sub new {\r
17   my $class = shift;\r
18   my $self = $class->SUPER::new();\r
19 \r
20 # Misc identification fields\r
21   $self->{strCartridgeType}       = "";           # v1.5\r
22   $self->{strEcommerceIndicator}  = "";           # v1.5\r
23 \r
24 # credit card fields.\r
25   \r
26   $self->{strCreditCardNumber}    = "";\r
27   $self->{strCreditCardVerificationNumber} = "";  # v1.5\r
28   $self->{strAVSCode}             = "";           # v1.5\r
29   $self->{strExpireMonth}         = "";\r
30   $self->{strExpireYear}          = "";\r
31   $self->{strChargeType}          = "";\r
32   $self->{strChargeTotal}         = "";\r
33   $self->{dChargeTotal}           = -1.0;\r
34   $self->{strCardBrand}           = "";\r
35   $self->{strCurrency}            = "";\r
36   $self->{strOrderId}             = "";\r
37   $self->{strBankApprovalCode}    = ""; # Required if chargetype is FORCE_AUTH or FORCE_SALE\r
38   $self->{strDuplicateCheck}              = ""; #v1.7.1\r
39   $self->{strReferenceId}                               = "";   # Required if chargetype is CAPTURE, QUERY_CREDIT, QUERY_PAYMENT or ADJUSTMENT\r
40   $self->{strOrderDescription}    = "";\r
41   $self->{strOrderUserId}         = "";\r
42   $self->{strTaxAmount}           = "";\r
43   $self->{dTaxAmount}             = -1.0;\r
44   $self->{strShippingCharge}      = "";\r
45   $self->{dShippingCharge}        = -1.0;\r
46   \r
47 #   Billing info fields ...\r
48   \r
49   $self->{strBillFirstName}       = "";\r
50   $self->{strBillLastName}        = "";\r
51   $self->{strBillMiddleName}      = "";\r
52   $self->{strBillCustomerTitle}   = "";\r
53   $self->{strBillCompany}         = "";\r
54   $self->{strBillAddressOne}      = "";\r
55   $self->{strBillAddressTwo}      = "";\r
56   $self->{strBillCity}            = "";\r
57   $self->{strBillStateOrProvince} = "";\r
58   $self->{strBillPostalCode}      = "";\r
59   $self->{strBillCountryCode}     = "";\r
60   $self->{strBillEmail}           = "";\r
61   $self->{strBillPhone}           = "";\r
62   $self->{strBillFax}             = "";\r
63   $self->{strBillNote}            = "";\r
64   \r
65 # Shipping info fields default values.\r
66   \r
67   $self->{strShipFirstName}       = "";\r
68   $self->{strShipLastName}        = "";\r
69   $self->{strShipMiddleName}      = "";\r
70   $self->{strShipCustomerTitle}   = "";\r
71   $self->{strShipCompany}         = "";\r
72   $self->{strShipAddressOne}      = "";\r
73   $self->{strShipAddressTwo}      = "";\r
74   $self->{strShipCity}            = "";\r
75   $self->{strShipStateOrProvince} = "";\r
76   $self->{strShipPostalCode}      = "";\r
77   $self->{strShipCountryCode}     = "";\r
78   $self->{strShipEmail}           = "";\r
79   $self->{strShipPhone}           = "";\r
80   $self->{strShipFax}             = "";\r
81   $self->{strShipNote}            = "";\r
82   \r
83 # Authentication fields\r
84   $self->{strAuthenticationTransactionId}       = "";\r
85   $self->{strAuthenticationPayload}             = "";\r
86   $self->{boolSuccessOnAuthenticationInconclusive}      = "";\r
87 \r
88 \r
89 # Others\r
90   $self->{strBuyerCode}           = "";\r
91   $self->{strCAVV}                = "";\r
92   $self->{strCustomerIPAddress}   = "";\r
93   $self->{strPurchaseOrderNumber} = "";\r
94   $self->{dStateTax}              = -1.0;\r
95   $self->{strTrack1}              = "";\r
96   $self->{strTrack2}              = "";\r
97   $self->{strXID}                 = "";\r
98   $self->{boolTaxExempt}          = "";\r
99   $self->{strInvoiceNumber}       = "";\r
100   \r
101 # Industry Fields\r
102   $self->{strIndustry}            = "";\r
103   $self->{strFolioNumber}         = "";\r
104   \r
105   $self->{boolChargeTotalIncludesRestaurant}     = "";\r
106   $self->{boolChargeTotalIncludesGiftshop}       = "";\r
107   $self->{boolChargeTotalIncludesMinibar}        = "";\r
108   $self->{boolChargeTotalIncludesPhone}          = "";\r
109   $self->{boolChargeTotalIncludesLaundry}        = "";\r
110   $self->{boolChargeTotalIncludesOther}          = "";\r
111   \r
112   $self->{dServiceRate}           = -1.0;\r
113   $self->{strServiceRate}           = "";\r
114   $self->{intServiceEndDay}       = "";\r
115   $self->{intServiceEndMonth}     = "";\r
116   $self->{intServiceEndYear}      = "";\r
117   $self->{intServiceStartDay}     = "";\r
118   $self->{intServiceStartMonth}   = "";\r
119   $self->{intServiceStartYear}    = "";\r
120   $self->{boolServiceNoShow}     = "";\r
121   \r
122   return $self;\r
123 }\r
124 \r
125 \r
126 \r
127 #**\r
128 # * Set the value of the cartridge type.\r
129 # * <p>\r
130 # */\r
131 sub SetCartridgeType {\r
132   my $self = shift;\r
133   my $cartType = shift;  # take one string arguement to get cartridgeType\r
134   if (!defined($cartType)) {\r
135     $self->{strError} = "Cartridge type is undefined.";\r
136     return CCR_ERROR;\r
137   }\r
138   if ($cartType eq ""){\r
139     $self->{strError} = "Invalid cartridge type.";\r
140     return CCR_ERROR;\r
141   }\r
142   $self->{strCartridgeType} = $cartType;\r
143   return CCR_NO_ERROR;\r
144 }\r
145 \r
146 \r
147 #**\r
148 # * Set the value of the Ecommerce Indicator number.\r
149 # * <p>\r
150 # */\r
151 sub SetEcommerceIndicator {\r
152   my $self = shift;\r
153   my $ecommerceIndicator = shift;  # take one string arguement to get EcommerceIndicator\r
154   if (!defined($ecommerceIndicator)) {\r
155     $self->{strError} = "Ecommerce indicator is undefined.";\r
156     return CCR_ERROR;\r
157   }\r
158   if ($ecommerceIndicator eq ""){\r
159     $self->{strError} = "Invalid ecommerce indicator.";\r
160     return CCR_ERROR;\r
161   }\r
162   $self->{strEcommerceIndicator} = $ecommerceIndicator;\r
163   return CCR_NO_ERROR;\r
164 }\r
165 \r
166 \r
167 \r
168 \r
169 #**\r
170 # * Set the value of the credit card number.\r
171 # * <p>\r
172 # * @param creditCardNumber must be numeric characters\r
173 # * @exception TransactionProtocolException thrown if creditCardNumber is non-numeric or the empty String.\r
174 # */\r
175 sub SetCreditCardNumber {\r
176   my $self = shift;\r
177   my $ccNo = shift;  # take one string arguement to get creditcard number\r
178   if (!defined($ccNo)) {\r
179     $self->{strError} = "Credit card number is undefined.";\r
180     return CCR_ERROR;\r
181   }\r
182   if ($ccNo eq ""){\r
183     $self->{strError} = "Invalid credit card number.";\r
184     return CCR_ERROR;\r
185   }\r
186   if ($ccNo =~ /\D/) {\r
187     $self->{strError} = "Non-numeric credit card number.";\r
188     return CCR_ERROR;\r
189   }\r
190   if ( ( length $ccNo < 13 ) || ( length $ccNo > 19 ) ) {\r
191     $self->{strError} = "Invalid credit card number length.";\r
192     return CCR_ERROR;\r
193   }\r
194   $self->{strCreditCardNumber} = $ccNo;\r
195   return CCR_NO_ERROR;\r
196 }\r
197 \r
198 #**\r
199 # * Set the value of the credit card verification number.\r
200 # * <p>\r
201 # * @param creditCardVerificationNumber must be numeric characters\r
202 # */\r
203 sub SetCreditCardVerificationNumber {\r
204   my $self = shift;\r
205   my $ccVerNo = shift;  # take one string arguement to get creditCardVerification number\r
206   if (!defined($ccVerNo)) {\r
207     $self->{strError} = "Credit card verification number is undefined.";\r
208     return CCR_ERROR;\r
209   }\r
210   if ($ccVerNo eq ""){\r
211     $self->{strError} = "Invalid credit card verification number.";\r
212     return CCR_ERROR;\r
213   }\r
214   if ($ccVerNo =~ /\D/) {\r
215     $self->{strError} = "Non-numeric credit card verification number.";\r
216     return CCR_ERROR;\r
217   }\r
218   $self->{strCreditCardVerificationNumber} = $ccVerNo;\r
219   return CCR_NO_ERROR;\r
220 }\r
221 \r
222 \r
223 #**\r
224 # * Set the value of the credit card expiration month.\r
225 # * <p>\r
226 # * @param expireMonth Must be an integer in ASCII characters in the range "1" to "12, inclusive.\r
227 # * @exception TransactionProtocolException thrown if expireMonth is not >= 1 and <= 12.\r
228 # */\r
229 sub SetExpireMonth\r
230 {\r
231   my $self = shift;\r
232   my $expireMonth = shift; #take one string arguement\r
233   if (!defined($expireMonth)) {\r
234     $self->{strError} = "Expire month is undefined.";\r
235     return CCR_ERROR;\r
236   }\r
237   if ($expireMonth eq ""){\r
238     $self->{strError} = "Invalid expire month.";\r
239     return CCR_ERROR;\r
240   }\r
241   \r
242   if ($expireMonth =~ /\D/) {\r
243     $self->{strError} = "Invalid credit expire month (non-digit).";\r
244     return CCR_ERROR;\r
245   }\r
246   \r
247   my $iExpireMonth = 1 * $expireMonth;\r
248   if ($iExpireMonth < 1 || $iExpireMonth > 12) {\r
249     $self->{strError} .= "Invalid expire month (not 1 through 12).";\r
250     return CCR_ERROR;\r
251   }\r
252   $self->{strExpireMonth} = $expireMonth;\r
253   \r
254   return 1;\r
255 }\r
256 \r
257 \r
258 #**\r
259 # * Set the value of the credit card expiration year.\r
260 # * <p>\r
261 # * @param expireYear Must be a four-digit integer in ASCII characters. E.g. "2001".\r
262 # * @exception TransactionProtocolException thrown if expireYear is not a four digit year.\r
263 #\r
264 sub SetExpireYear\r
265 {\r
266   my $self = shift;\r
267   my $expireYear = shift; # take a string arguement\r
268   if (!defined($expireYear)) {\r
269     $self->{strError} = "Expire year is undefined.";\r
270     return CCR_ERROR;\r
271   }\r
272   if (length($expireYear) != 4) {\r
273     $self->{strError} = "Invalid expire year, must be 4 numeric characters.";\r
274     return CCR_ERROR;\r
275   }\r
276   if($expireYear =~ /\D/){\r
277     $self->{strError} = "Invalid credit expire year (non-numeric).";\r
278     return CCR_ERROR;\r
279   }\r
280   \r
281   $self->{strExpireYear} = $expireYear;\r
282   return CCR_NO_ERROR;\r
283 }\r
284 #**\r
285 # * Set the charge type.\r
286 # * <p>\r
287 # * @param chargeType Must be one of the following constants: SALE, AUTH, CAPTURE, FORCE_AUTH,\r
288 # * FORCE_SALE, VOID, QUERY_CREDIT, QUERY_PAYMENT, ADJUSTMENT or CREDIT.\r
289 # * @exception TransactionProtocolException thrown if chargeType is not a valid charge type\r
290 # * defined by this class.\r
291 # */\r
292 sub SetChargeType\r
293 {\r
294   my $self = shift;\r
295   my $chargeType = shift;  # take one string arguement\r
296   \r
297   if (!defined($chargeType)) {\r
298     $self->{strError} = "Charge type is undefined.";\r
299     return CCR_ERROR;\r
300   }\r
301   if ($chargeType eq "") {\r
302     $self->{strError} = "Invalid charge type";\r
303     return CCR_ERROR;\r
304   }\r
305   \r
306   if (!($chargeType eq SALE || $chargeType eq AUTH || \r
307         $chargeType eq CAPTURE || $chargeType eq VOID ||\r
308         $chargeType eq FORCE_AUTH || $chargeType eq FORCE_SALE ||\r
309         $chargeType eq QUERY_PAYMENT || $chargeType eq QUERY_CREDIT ||\r
310         $chargeType eq CLOSE_ORDER || $chargeType eq CANCEL_ORDER ||\r
311         $chargeType eq VOID_AUTH || $chargeType eq VOID_CAPTURE ||\r
312         $chargeType eq VOID_CREDIT || $chargeType eq CREATE_ORDER ||\r
313         $chargeType eq CREDIT || $chargeType eq ADJUSTMENT)) {\r
314     $self->{strError} = "Invalid charge type.";\r
315     return CCR_ERROR;\r
316   }\r
317   $self->{strChargeType} = $chargeType;\r
318   return CCR_NO_ERROR;\r
319 }\r
320 \r
321 \r
322 #**\r
323 # * Set the transaction amount using a floating point value.  Other amounts, such\r
324 # * as tax amount or shipping charges, do not affect the charge total\r
325 # * <p>\r
326 # * @param chargeTotal Must be a positive floating-point number.\r
327 # * E.g. Use <i>12.34</i> to represent $12.34.\r
328 # * @exception TransactionProtocolException thrown if chargeTotal less than zero\r
329 # */\r
330 sub SetChargeTotal\r
331 {\r
332   my $self = shift;\r
333   my $chargeTotal = shift; # take either one string  or float arguement\r
334   \r
335   if (!defined($chargeTotal)) {\r
336     $self->{strError} = "Charge total is undefined.";\r
337     return CCR_ERROR;\r
338   }\r
339   \r
340   if ( $chargeTotal !~ /^(\d+\.?\d*|\.\d+)$/ ) {\r
341     $self->{strError} = "Non-numeric charge.";\r
342     return CCR_ERROR;\r
343   }\r
344   \r
345   my $dChargeTotal = $chargeTotal * 1.0;\r
346   if ($dChargeTotal < 0){\r
347     $self->{strError} = "Charge total cannot be negative.";\r
348     return CCR_ERROR;\r
349   }\r
350   \r
351   $self->{dChargeTotal} = $dChargeTotal;\r
352   $self->{strChargeTotal} = "".$chargeTotal;\r
353   \r
354   return CCR_NO_ERROR;\r
355 }\r
356 \r
357 \r
358 \r
359 \r
360 #**\r
361 # * Set the transaction credit card brand.\r
362 # * <p>\r
363 # * @param cardBrand Must be one of the following constants:\r
364 # *     VISA, MASTERCARD, AMERICAN_EXPRESS, DISCOVER, NOVA, AMEX, DINERS, EUROCARD,\r
365 # *     CARD_BRAND_1, CARD_BRAND_2, CARD_BRAND_3, CARD_BRAND_4, CARD_BRAND_5, or CARD_BRAND_6.\r
366 # * @exception TransactionProtocolException thrown if cardBrand not one of the card brand constants\r
367 # * defined by this class.\r
368 # */\r
369 sub SetCardBrand\r
370 {\r
371   my $self = shift;\r
372   my $CardBrand = shift; # take a string arguement\r
373   \r
374   if (!defined($CardBrand) || $CardBrand eq ""){\r
375     $self->{strError} = "Blank or undefined card type.";\r
376     return CCR_ERROR;\r
377   }\r
378   \r
379   if ($CardBrand ne VISA &&\r
380     $CardBrand ne MASTERCARD &&\r
381     $CardBrand ne AMERICAN_EXPRESS &&\r
382     $CardBrand ne DISCOVER &&\r
383     $CardBrand ne NOVA &&\r
384     $CardBrand ne AMEX &&\r
385     $CardBrand ne DINERS &&\r
386     $CardBrand ne EUROCARD &&\r
387     $CardBrand ne CARD_BRAND_1 &&\r
388     $CardBrand ne CARD_BRAND_2 &&\r
389     $CardBrand ne CARD_BRAND_3 &&\r
390     $CardBrand ne CARD_BRAND_4 &&\r
391     $CardBrand ne CARD_BRAND_5 &&\r
392     $CardBrand ne CARD_BRAND_6) {\r
393     $self->{strError} = "Invalid card brand:$CardBrand.";\r
394     return CCR_ERROR;\r
395   }\r
396   $self->{strCardBrand} = $CardBrand;\r
397   return CCR_NO_ERROR;\r
398 }\r
399 \r
400 #**\r
401 # * Set the order ID.\r
402 # */\r
403 sub SetOrderId\r
404 {\r
405   my $self = shift;\r
406   my $OrderId = shift; # take a string arguement\r
407   if (!defined($OrderId)) {\r
408     $self->{strError} = "Order id is undefined.";\r
409     return CCR_ERROR;\r
410   }\r
411   $self->{strOrderId} = $OrderId;\r
412   return CCR_NO_ERROR;\r
413 }\r
414 \r
415 #**\r
416 # * Set the capture reference ID (used in tracking captures / deposits).\r
417 # * This field is required if chargeType is CAPTURE.\r
418 # */\r
419 sub SetCaptureReferenceId\r
420 {\r
421   my $self = shift;\r
422   my $CaptureReferenceId = shift; #take a string arguement\r
423   if (!defined($CaptureReferenceId)){\r
424     $self->{strError} = "Capture reference id is undefined.";\r
425     return CCR_ERROR;\r
426   }\r
427   $self->{strReferenceId} = $CaptureReferenceId;\r
428   return CCR_NO_ERROR;\r
429 }\r
430 \r
431 #\r
432 # Set Reference Id\r
433 # This should be used instead of SetCaptureReferenceId\r
434 # Added in v1.6\r
435 #\r
436 sub SetReferenceId\r
437 {\r
438   my $self = shift;\r
439   my $ReferenceId = shift; #take a string arguement\r
440   if (!defined($ReferenceId)){\r
441     $self->{strError} = "Reference id is undefined.";\r
442     return CCR_ERROR;\r
443   }\r
444   $self->{strReferenceId} = $ReferenceId;\r
445   return CCR_NO_ERROR;\r
446 }\r
447 \r
448 #**\r
449 # * Set a comment describing the order.\r
450 # */\r
451 sub SetOrderDescription\r
452 {\r
453   my $self = shift;\r
454   my $OrderDescription = shift;  #take a string arguement\r
455   if (!defined($OrderDescription)) {\r
456     $self->{strError} = "Order description is undefined.";\r
457     return CCR_ERROR;\r
458   }\r
459   $self->{strOrderDescription} = $OrderDescription;\r
460   return CCR_NO_ERROR;\r
461 }\r
462 \r
463 \r
464 #/**\r
465 # * Set the order's user id.  The order user id is an identifier\r
466 # * for a merchant's customer.  It is not required, but may provide\r
467 # * increased searching functionality in the merchant support center.\r
468 # */\r
469 sub SetOrderUserId\r
470 {\r
471   my $self = shift;\r
472   my $OrderUserId = shift;  # take a string arguement\r
473   if (!defined($OrderUserId)) {\r
474     $self->{strError} = "Order user ID is undefined.";\r
475     return CCR_ERROR;\r
476   }\r
477   $self->{strOrderUserId} = $OrderUserId;\r
478   return CCR_NO_ERROR;\r
479 }\r
480 \r
481 #**\r
482 # * Set the bank approval code (used in force sale and force auth).\r
483 # * This field is required if chargeType is FORCE_AUTH or FORCE_SALE.\r
484 # */\r
485 sub SetBankApprovalCode\r
486 {\r
487   my $self = shift;\r
488   my $BankApprovalCode = shift; #take a string arguement\r
489   if (!defined($BankApprovalCode)){\r
490     $self->{strError} = "Bank Approval Code is undefined.";\r
491     return CCR_ERROR;\r
492   }\r
493   $self->{strBankApprovalCode} = $BankApprovalCode;\r
494   return CCR_NO_ERROR;\r
495 }\r
496 \r
497 #**\r
498 # * Set the duplicate check.\r
499 # * Possible values are CHECK, OVERRIDE, NO_CHECK\r
500 # */\r
501 sub SetDuplicateCheck\r
502 {\r
503   my $self = shift;\r
504   my $DuplicateCheck = shift; #take a string arguement\r
505   if (!defined($DuplicateCheck)){\r
506     $self->{strError} = "Duplicate Check is undefined.";\r
507     return CCR_ERROR;\r
508   }\r
509   $self->{strDuplicateCheck} = $DuplicateCheck;\r
510   return CCR_NO_ERROR;\r
511 }\r
512 \r
513 \r
514 #**\r
515 # * Set the tax amount using a floating point value.\r
516 # * The tax amount is the amount of the chargeTotal that is tax.\r
517 # * <p>\r
518 # * @param taxAmount Must be a positive floating-point number.\r
519 # * E.g. Use <i>11.55</i> to represent $11.55.\r
520 # * @exception TransactionProtocolException thrown if taxAmount less than zero\r
521 # */\r
522 sub SetTaxAmount\r
523 {\r
524   my $self = shift;\r
525   my $TaxAmount = shift; # take a string or an integer arguement\r
526   \r
527   if (!defined($TaxAmount)) {\r
528     $self->{strError} = "Tax amount is undefined.";\r
529     return CCR_ERROR;\r
530   }\r
531   if ( $TaxAmount !~ /^(\d+\.?\d*|\.\d+)$/ ) {\r
532     $self->{strError} = "Non-numeric tax amount.";\r
533     return CCR_ERROR;\r
534   }\r
535   \r
536   my $dTaxAmount = $TaxAmount * 1.0;\r
537   if ($dTaxAmount < 0) {\r
538     $self->{strError} = "Tax amount cannot be negative.";\r
539     return CCR_ERROR;\r
540   }\r
541   \r
542   $self->{dTaxAmount} = $dTaxAmount;\r
543   $self->{strTaxAmount} = "".$TaxAmount;\r
544   return CCR_NO_ERROR;\r
545 }\r
546 \r
547 \r
548 #**\r
549 # * Set the shipping charge using a floating point value.\r
550 # * The shipping charge is the amount of the chargeTotal that is shipping charges.\r
551 # * <p>\r
552 # * @param shippingCharge Must be a positive floating-point number.\r
553 # * E.g. Use <i>11.55</i> to represent $11.55.\r
554 # * @exception TransactionProtocolException thrown if shippingCharge less than zero\r
555 # */\r
556 sub SetShippingCharge\r
557 {\r
558   my $self = shift;\r
559   my $ShippingCharge = shift; # take a string or an integer arguement\r
560   \r
561   if (!defined($ShippingCharge)) {\r
562     $self->{strError} = "Shipping charge is undefined.";\r
563     return CCR_ERROR;\r
564   }\r
565   if ( $ShippingCharge !~ /^(\d+\.?\d*|\.\d+)$/ ) {\r
566     $self->{strError} = "Non-numeric shipping charge.";\r
567     return CCR_ERROR;\r
568   }\r
569   \r
570   my $dShippingCharge = $ShippingCharge * 1.0;\r
571   if ($dShippingCharge < 0.00) {\r
572     $self->{strError} = "Shipping charge cannot be negative.";\r
573     return CCR_ERROR;\r
574   }\r
575   \r
576   $self->{dShippingCharge} = $dShippingCharge;\r
577   $self->{strShippingCharge} = "".$ShippingCharge;\r
578   return CCR_NO_ERROR;\r
579 }\r
580 \r
581 \r
582 #**\r
583 # * Set the first name of the customer being billed.\r
584 # */\r
585 sub SetBillFirstName\r
586 {\r
587   my $self = shift;\r
588   my $BillFirstName = shift; # take a string arguement\r
589   if (!defined($BillFirstName)) {\r
590     $self->{strError} = "Bill first name is undefined.";\r
591     return CCR_ERROR;\r
592   }\r
593   $self->{strBillFirstName} = $BillFirstName;\r
594   return CCR_NO_ERROR;\r
595 }\r
596 \r
597 \r
598 #**\r
599 # * Set the last name of the customer being billed.\r
600 # */\r
601 sub SetBillLastName\r
602 {\r
603   my $self = shift;\r
604   my $BillLastName = shift; # take a string arguement\r
605   if (!defined($BillLastName)) {\r
606     $self->{strError} = "Bill last name is undefined.";\r
607     return CCR_ERROR;\r
608   }\r
609   $self->{strBillLastName}  = $BillLastName;\r
610   return CCR_NO_ERROR;\r
611 }\r
612 \r
613 \r
614 #**\r
615 # * Set the middle name of the customer being billed.\r
616 #\r
617 sub SetBillMiddleName\r
618 {\r
619   my $self = shift;\r
620   my $BillMiddleName = shift; # take a string arguement\r
621   if (!defined($BillMiddleName)) {\r
622     $self->{strError} = "Bill middle name is undefined.";\r
623     return CCR_ERROR;\r
624   }\r
625   $self->{strBillMiddleName} = $BillMiddleName;\r
626   return CCR_NO_ERROR;\r
627 }\r
628 \r
629 \r
630 #**\r
631 # * Set the title of the customer being billed, such as "Mr." or "Sales Manager".\r
632 #/\r
633 sub SetBillCustomerTitle\r
634 {\r
635   my $self = shift;\r
636   my $BillCustomerTitle = shift; # take a string arguement\r
637   if (!defined($BillCustomerTitle)) {\r
638     $self->{strError} = "Bill customer title is undefined.";\r
639     return CCR_ERROR;\r
640   }\r
641   $self->{strBillCustomerTitle} = $BillCustomerTitle;\r
642   return CCR_NO_ERROR;\r
643 }\r
644 \r
645 \r
646 #**\r
647 # * Set the name of the company of the customer being billed.\r
648 # */\r
649 sub SetBillCompany\r
650 {\r
651   my $self = shift;\r
652   my $BillCompany = shift; # take a string arguement\r
653   if (!defined($BillCompany)) {\r
654     $self->{strError} = "Bill company is undefined.";\r
655     return CCR_ERROR;\r
656   }\r
657   $self->{strBillCompany} = $BillCompany;\r
658   return CCR_NO_ERROR;\r
659 }\r
660 \r
661 \r
662 #**\r
663 # * Set the first part of the address of the customer being billed,\r
664 # * such as "1455 Cedar Springs Drive".\r
665 # */\r
666 sub SetBillAddressOne\r
667 {\r
668   my $self = shift;\r
669   my $BillAddressOne = shift; # take a string arguement\r
670   if (!defined($BillAddressOne)) {\r
671     $self->{strError} = "Bill address one  is undefined.";\r
672     return CCR_ERROR;\r
673   }\r
674   $self->{strBillAddressOne} = $BillAddressOne;\r
675   return CCR_NO_ERROR;\r
676 }\r
677 \r
678 \r
679 #*\r
680 # * Set the second part of the address of the customer being billed,\r
681 # * such as "Suite 100".\r
682 # */\r
683 sub SetBillAddressTwo\r
684 {\r
685   my $self = shift;\r
686   my $BillAddressTwo = shift; # take a string arguement\r
687   if (!defined($BillAddressTwo)) {\r
688     $self->{strError} = "Bill address two is undefined.";\r
689     return CCR_ERROR;\r
690   }\r
691   $self->{strBillAddressTwo} = $BillAddressTwo;\r
692   return CCR_NO_ERROR;\r
693 }\r
694 \r
695 \r
696 #**\r
697 # * Set the city of the customer being billed.\r
698 # */\r
699 sub SetBillCity\r
700 {\r
701   my $self = shift;\r
702   my $BillCity = shift; # take a string arguement\r
703   if (!defined($BillCity)) {\r
704     $self->{strError} = "Bill city is undefined.";\r
705     return CCR_ERROR;\r
706   }\r
707   $self->{strBillCity} = $BillCity;\r
708   return CCR_NO_ERROR;\r
709 }\r
710 \r
711 \r
712 #**\r
713 # * Set the state or province of the customer being billed.\r
714 # */\r
715 sub SetBillStateOrProvince\r
716 {\r
717   my $self = shift;\r
718   my $BillStateOrProvince = shift; # take a string arguement\r
719   if (!defined($BillStateOrProvince)) {\r
720     $self->{strError} = "Bill state or province is undefined.";\r
721     return CCR_ERROR;\r
722   }\r
723   $self->{strBillStateOrProvince} = $BillStateOrProvince;\r
724   return CCR_NO_ERROR;\r
725 }\r
726 \r
727 \r
728 #**\r
729 # * Set the postal code (or zip code) of the customer being billed.\r
730 # */\r
731 sub SetBillPostalCode\r
732 {\r
733   my $self = shift;\r
734   my $BillPostalCode = shift; # take a string arguement\r
735   if (!defined($BillPostalCode)) {\r
736     $self->{strError} = "Bill postal code is undefined.";\r
737     return CCR_ERROR;\r
738   }\r
739   $self->{strBillPostalCode} = $BillPostalCode;\r
740   return CCR_NO_ERROR;\r
741 }\r
742 \r
743 \r
744 #**\r
745 # * @param billCountryCode      The alphabetic country code of the billing address.\r
746 # * Must be a valid country code from ISO-3166. E.g. "CA" or "US".\r
747 # * <p>\r
748 # * @see com.paygateway.CountryCodes\r
749 # * @exception TransactionProtocolException thrown if an invalid country code is passed in\r
750 # */\r
751 sub SetBillCountryCode\r
752 {\r
753   my $self = shift;\r
754   my $BillCountryCode = shift; # take a string arguement (either country code or country name)\r
755   \r
756   if (!defined($BillCountryCode)) {\r
757     $self->{strError} = "Country code is undefined.";\r
758     return CCR_ERROR;\r
759   }\r
760   my $CountryCode = getCCodeFromCName($BillCountryCode);\r
761   if (isValidCountryCode($BillCountryCode)) {\r
762     $self->{strBillCountryCode}  = $BillCountryCode;\r
763     return CCR_NO_ERROR;\r
764   }\r
765   elsif (defined($CountryCode))  {\r
766     $self->{strBillCountryCode} = $CountryCode;\r
767     return CCR_NO_ERROR;\r
768   }\r
769   else {\r
770     $self->{strError} = "Invalid country code for billing address.";\r
771     return CCR_ERROR;\r
772   }\r
773 }\r
774 \r
775 \r
776 #**\r
777 # * Set the email address of the customer being billed.\r
778 # */\r
779 sub SetBillEmail\r
780 {\r
781   my $self = shift;\r
782   my $BillEmail = shift;\r
783   if (!defined($BillEmail)) {\r
784     $self->{strError} = "Bill email is undefined.";\r
785     return CCR_ERROR;\r
786   }\r
787   if ($BillEmail !~ /.+@.+\..+/ ) {\r
788     $self->{strError} = "Invalid bill email format.";\r
789     return CCR_ERROR;\r
790   }\r
791   $self->{strBillEmail} = $BillEmail;\r
792   return CCR_NO_ERROR;\r
793 }\r
794 \r
795 \r
796 #**\r
797 #* Set the phone number\r
798 #*/\r
799 sub SetBillPhone\r
800 {\r
801   my $self = shift;\r
802   my $BillPhone = shift; # take a string arguement\r
803   if (!defined($BillPhone)) {\r
804     $self->{strError} = "Bill phone is undefined.";\r
805     return CCR_ERROR;\r
806   }\r
807   $self->{strBillPhone} = $BillPhone;\r
808   return CCR_NO_ERROR;\r
809 }\r
810 \r
811 \r
812 #**\r
813 # * Set the facsimile number of the customer being billed.\r
814 # */\r
815 sub SetBillFax\r
816 {\r
817   my $self = shift;\r
818   my $BillFax = shift;\r
819   if (!defined($BillFax)) {\r
820     $self->{strError} = "Bill fax is undefined";\r
821     return CCR_ERROR;\r
822   }\r
823   $self->{strBillFax} = $BillFax;\r
824   return CCR_NO_ERROR;\r
825 }\r
826 \r
827 \r
828 #**\r
829 # * Set the billing note.  This a comment about the billing information.\r
830 # */\r
831 sub SetBillNote\r
832 {\r
833   my $self = shift;\r
834   my $BillNote = shift; #take a string arguement\r
835   if (!defined($BillNote)) {\r
836     $self->{strError} = "Bill note is undefined";\r
837     return CCR_ERROR;\r
838   }\r
839   $self->{strBillNote} = $BillNote;\r
840   return CCR_NO_ERROR;\r
841 }\r
842 \r
843 \r
844 #**\r
845 # * Set the first name for the shipping information.\r
846 # */\r
847 sub SetShipFirstName\r
848 {\r
849   my $self = shift;\r
850   my $ShipFirstName = shift; # take a string arguement\r
851   if (!defined($ShipFirstName)) {\r
852     $self->{strError} = "Ship first name is undefined";\r
853     return CCR_ERROR;\r
854   }\r
855   $self->{strShipFirstName} = $ShipFirstName;\r
856   return CCR_NO_ERROR;\r
857 }\r
858 \r
859 \r
860 #**\r
861 # * Set the last name for the shipping information.\r
862 # */\r
863 sub SetShipLastName\r
864 {\r
865   my $self = shift;\r
866   my $ShipLastName = shift;  # take a string arguement\r
867   if (!defined($ShipLastName)) {\r
868     $self->{strError} = "Ship last is undefined.";\r
869     return CCR_ERROR;\r
870   }\r
871   $self->{strShipLastName} = $ShipLastName;\r
872   return CCR_NO_ERROR;\r
873 }\r
874 \r
875 \r
876 #**\r
877 # * Set the middle name for the shipping information.\r
878 # */\r
879 sub SetShipMiddleName\r
880 {\r
881   my $self = shift;\r
882   my $ShipMiddleName = shift; # take a string arguement\r
883   \r
884   if (!defined($ShipMiddleName)) {\r
885     $self->{strError} = "Ship middle name is undefined.";\r
886     return CCR_ERROR;\r
887   }\r
888   $self->{strShipMiddleName} = $ShipMiddleName;\r
889   return CCR_NO_ERROR;\r
890 }\r
891 \r
892 \r
893 #**\r
894 # * Set the customer title of the customer being jstrShipped to.\r
895 # */\r
896 sub SetShipCustomerTitle\r
897 {\r
898   my $self = shift;\r
899   my $ShipCustomerTitle = shift; # take a string arguement\r
900   if (!defined($ShipCustomerTitle)) {\r
901     $self->{strError} = "Ship customer title is undefined.";\r
902     return CCR_ERROR;\r
903   }\r
904   $self->{strShipCustomerTitle} = $ShipCustomerTitle;\r
905   return CCR_NO_ERROR;\r
906 }\r
907 \r
908 \r
909 #**\r
910 # * Set the company for the shipping information.\r
911 # */\r
912 sub SetShipCompany\r
913 {\r
914   my $self = shift;\r
915   my $ShipCompany = shift; # take a string arguement\r
916   if (!defined($ShipCompany)) {\r
917     $self->{strError} = "Ship company is undefined.";\r
918     return CCR_ERROR;\r
919   }\r
920   $self->{strShipCompany} = $ShipCompany;\r
921   return CCR_NO_ERROR;\r
922 }\r
923 \r
924 \r
925 #**\r
926 # * Set the first part of the shipping address, such as\r
927 # * "485 Bridestone Way".\r
928 # */\r
929 sub SetShipAddressOne\r
930 {\r
931   my $self = shift;\r
932   my $ShipAddressOne = shift; # take a string arguement\r
933   if (!defined($ShipAddressOne)) {\r
934     $self->{strError} = "Ship address is undefined.";\r
935     return CCR_ERROR;\r
936   }\r
937   $self->{strShipAddressOne} = $ShipAddressOne;\r
938   return CCR_NO_ERROR;\r
939 }\r
940 \r
941 \r
942 #**\r
943 # * Set the second part of the shipping address, such as\r
944 # * "Suite 234".\r
945 \r
946 sub SetShipAddressTwo\r
947 {\r
948   my $self = shift;\r
949   my $ShipAddressTwo = shift; # take a string arguement\r
950   if (!defined($ShipAddressTwo)) {\r
951     $self->{strError} = "Ship address two is undefined.";\r
952     return CCR_ERROR;\r
953   }\r
954   $self->{strShipAddressTwo} = $ShipAddressTwo;\r
955   return CCR_NO_ERROR;\r
956 }\r
957 \r
958 \r
959 #**\r
960 # * Set the city for the shipping address.\r
961 # */\r
962 sub SetShipCity\r
963 {\r
964   my $self = shift;\r
965   my $ShipCity = shift; # take a string arguement\r
966   if (!defined($ShipCity)) {\r
967     $self->{strError} = "Ship city is undefined.";\r
968     return CCR_ERROR;\r
969   }\r
970   $self->{strShipCity} = $ShipCity;\r
971   return CCR_NO_ERROR;\r
972 }\r
973 \r
974 \r
975 #**\r
976 # * Set the state or provicnce for the shipping address.\r
977 # */\r
978 sub SetShipStateOrProvince\r
979 {\r
980   my $self = shift;\r
981   my $ShipStateOrProvince = shift; # take a string arguement\r
982   if (!defined($ShipStateOrProvince)) {\r
983     $self->{strError} = "Ship state or province is undefined.";\r
984     return CCR_ERROR;\r
985   }\r
986   $self->{strShipStateOrProvince} = $ShipStateOrProvince;\r
987   return CCR_NO_ERROR;\r
988 }\r
989 \r
990 \r
991 #**\r
992 # * Set the postal code (or zip code) for the shipping address.\r
993 # */\r
994 sub SetShipPostalCode\r
995 {\r
996   my $self = shift;\r
997   my $ShipPostalCode = shift; # take a string arguement\r
998   if (!defined($ShipPostalCode)) {\r
999     $self->{strError} = "Ship postal code is undefined.";\r
1000     return CCR_ERROR;\r
1001   }\r
1002   $self->{strShipPostalCode} = $ShipPostalCode;\r
1003   return CCR_NO_ERROR;\r
1004 }\r
1005 \r
1006 #**\r
1007 # * Set the shipping country code.\r
1008 # * @param shipCountryCode      The alphabetic country code of the billing address.\r
1009 # * Must be a valid country code from ISO-3166. E.g. "CA" or "US".\r
1010 # * <p>\r
1011 # * @see com.paygateway.CountryCodes\r
1012 # * @exception TransactionProtocolException thrown if an invalid country code is passed in\r
1013 # */\r
1014 sub SetShipCountryCode\r
1015 {\r
1016   my $self = shift;\r
1017   my $ShipCountryCode = shift; # take a string arguement (either country code or country name)\r
1018   \r
1019   if (!defined($ShipCountryCode)) {\r
1020     $self->{strError} = "Ship country code is undefined.";\r
1021     return CCR_ERROR;\r
1022   }\r
1023   my $CountryCode = getCCodeFromCName($ShipCountryCode) ;\r
1024   if (isValidCountryCode($ShipCountryCode)) {\r
1025     $self->{strShipCountryCode}  = $ShipCountryCode;\r
1026     return CCR_NO_ERROR;\r
1027   }\r
1028   elsif (defined($CountryCode))  {\r
1029     $self->{strShipCountryCode} = $CountryCode;\r
1030     return CCR_NO_ERROR;\r
1031   }\r
1032   else {\r
1033     $self->{strError} = "Invalid country code for shipping address";\r
1034     return CCR_ERROR;\r
1035   }\r
1036 }\r
1037 \r
1038 \r
1039 #**\r
1040 # * Set the email address of the customer being shipped to.\r
1041 # */\r
1042 sub SetShipEmail\r
1043 {\r
1044   my $self = shift;\r
1045   my $ShipEmail = shift;  # take a string arguement\r
1046   if (!defined($ShipEmail)) {\r
1047     $self->{strError} = "Ship email is undefined.";\r
1048     return CCR_ERROR;\r
1049   }\r
1050   $self->{strShipEmail} = $ShipEmail;\r
1051   return CCR_NO_ERROR;\r
1052 }\r
1053 \r
1054 \r
1055 #**\r
1056 # * Set the phone number of the customer being shipped to.\r
1057 # */\r
1058 sub SetShipPhone\r
1059 {\r
1060   my $self = shift;\r
1061   my $ShipPhone = shift; # take a string arguement\r
1062   if (!defined($ShipPhone)) {\r
1063     $self->{strError} = "Ship phone is undefined";\r
1064     return CCR_ERROR;\r
1065   }\r
1066   $self->{strShipPhone} = $ShipPhone;\r
1067   return CCR_NO_ERROR;\r
1068 }\r
1069 \r
1070 \r
1071 #**\r
1072 # * Set the facsimile number of the customer being shipped to.\r
1073 # */\r
1074 sub SetShipFax\r
1075 {\r
1076   my $self = shift;\r
1077   my $ShipFax = shift; # take a string arguement\r
1078   if (!defined($ShipFax)) {\r
1079     $self->{strError} = "Ship fax is undefined";\r
1080     return CCR_ERROR;\r
1081   }\r
1082   $self->{strShipFax} = $ShipFax;\r
1083   return CCR_NO_ERROR;\r
1084 }\r
1085 \r
1086 \r
1087 #**\r
1088 # * Set a note (comment) for the shipping information.\r
1089 # */\r
1090 sub SetShipNote\r
1091 {\r
1092   my $self = shift;\r
1093   my $ShipNote = shift;\r
1094   if (!defined($ShipNote)) {\r
1095     $self->{strError} = "Ship note is undefined.";\r
1096     return CCR_ERROR;\r
1097   }\r
1098   $self->{strShipNote} = $ShipNote;\r
1099   return CCR_NO_ERROR;\r
1100 }\r
1101 \r
1102 \r
1103 #/**\r
1104 # * Sets the currency\r
1105 # */\r
1106 sub SetCurrency\r
1107 {\r
1108   my $self = shift;\r
1109   my $Currency = shift;  # take a string arguement\r
1110   if (!defined($Currency)) {\r
1111     $self->{strError} = "Currency is undefined.";\r
1112     return CCR_ERROR;\r
1113   }\r
1114   $self->{strCurrency} = $Currency;\r
1115   return CCR_NO_ERROR;\r
1116 }\r
1117 \r
1118 #/**\r
1119 # * Sets the buyer code\r
1120 # */\r
1121 sub SetBuyerCode\r
1122 {\r
1123   my $self = shift;\r
1124   my $buyerCode = shift;  # take a string arguement\r
1125   if (!defined($buyerCode)) {\r
1126     $self->{strError} = "Buyer code is undefined.";\r
1127     return CCR_ERROR;\r
1128   }\r
1129   $self->{strBuyerCode} = $buyerCode;\r
1130   return CCR_NO_ERROR;\r
1131 }\r
1132 \r
1133 #/**\r
1134 # * Sets the CAVV (for VBV transactions)\r
1135 # */\r
1136 sub SetCAVV\r
1137 {\r
1138   my $self = shift;\r
1139   my $cavv = shift;  # take a string arguement\r
1140   if (!defined($cavv)) {\r
1141     $self->{strError} = "CAVV is undefined.";\r
1142     return CCR_ERROR;\r
1143   }\r
1144   $self->{strCAVV} = $cavv;\r
1145   return CCR_NO_ERROR;\r
1146 }\r
1147 \r
1148 #/**\r
1149 # * Sets the Customer IP Address\r
1150 # */\r
1151 sub SetCustomerIPAddress\r
1152 {\r
1153   my $self = shift;\r
1154   my $ip = shift;  # take a string arguement\r
1155   if (!defined($ip)) {\r
1156     $self->{strError} = "Customer IP address is undefined.";\r
1157     return CCR_ERROR;\r
1158   }\r
1159   $self->{strCustomerIPAddress} = $ip;\r
1160   return CCR_NO_ERROR;\r
1161 }\r
1162 \r
1163 #/**\r
1164 # * Sets the Order Customer ID\r
1165 # */\r
1166 sub SetOrderCustomerId\r
1167 {\r
1168   my $self = shift;\r
1169   my $orderCustomerID = shift;  # take a string arguement\r
1170   if (!defined($orderCustomerID)) {\r
1171     $self->{strError} = "Order customer ID is undefined.";\r
1172     return CCR_ERROR;\r
1173   }\r
1174   $self->{strOrderCustomerID} = $orderCustomerID;\r
1175   return CCR_NO_ERROR;\r
1176 }\r
1177 \r
1178 #/**\r
1179 # * Sets the purchase order number\r
1180 # */\r
1181 sub SetPurchaseOrderNumber\r
1182 {\r
1183   my $self = shift;\r
1184   my $purchaseOrderNumber = shift;  # take a string arguement\r
1185   if (!defined($purchaseOrderNumber)) {\r
1186     $self->{strError} = "Purchase order number is undefined.";\r
1187     return CCR_ERROR;\r
1188   }\r
1189   $self->{strPurchaseOrderNumber} = $purchaseOrderNumber;\r
1190   return CCR_NO_ERROR;\r
1191 }\r
1192 \r
1193 #/**\r
1194 # * Sets the state tax\r
1195 # */\r
1196 sub SetStateTax\r
1197 {\r
1198   my $self = shift;\r
1199   my $stateTax = shift;  # take a string arguement\r
1200   if (!defined($stateTax)) {\r
1201     $self->{strError} = "State tax is undefined.";\r
1202     return CCR_ERROR;\r
1203   }\r
1204 \r
1205   if ( $stateTax !~ /^(\d+\.?\d*|\.\d+)$/ ) {\r
1206     $self->{strError} = "Non-numeric state tax amount.";\r
1207     return CCR_ERROR;\r
1208   }\r
1209   \r
1210   $stateTax = $stateTax * 1.0;\r
1211   if ($stateTax < 0) {\r
1212     $self->{strError} = "State tax cannot be negative.";\r
1213     return CCR_ERROR;\r
1214   }\r
1215 \r
1216   $self->{dStateTax} = $stateTax;\r
1217   return CCR_NO_ERROR;\r
1218 }\r
1219 \r
1220 #/**\r
1221 # * Sets the track 1 data\r
1222 # */\r
1223 sub SetTrack1\r
1224 {\r
1225   my $self = shift;\r
1226   my $track1 = shift;  # take a string arguement\r
1227   if (!defined($track1)) {\r
1228     $self->{strError} = "Track 1 is undefined.";\r
1229     return CCR_ERROR;\r
1230   }\r
1231   $self->{strTrack1} = $track1;\r
1232   return CCR_NO_ERROR;\r
1233 }\r
1234 \r
1235 #/**\r
1236 # * Sets the track 2 data\r
1237 # */\r
1238 sub SetTrack2\r
1239 {\r
1240   my $self = shift;\r
1241   my $track2 = shift;  # take a string arguement\r
1242   if (!defined($track2)) {\r
1243     $self->{strError} = "Track 2 is undefined.";\r
1244     return CCR_ERROR;\r
1245   }\r
1246   $self->{strTrack2} = $track2;\r
1247   return CCR_NO_ERROR;\r
1248 }\r
1249 \r
1250 #/**\r
1251 # * Sets the transaction condition code\r
1252 # */\r
1253 sub SetTransactionConditionCode\r
1254 {\r
1255   my $self = shift;\r
1256   my $tcc = shift;  # take a string arguement\r
1257   if (!defined($tcc)) {\r
1258     $self->{strError} = "Transaction condition code is undefined.";\r
1259     return CCR_ERROR;\r
1260   }\r
1261   $self->{strTransactionConditionCode} = $tcc;\r
1262   return CCR_NO_ERROR;\r
1263 }\r
1264 \r
1265 #/**\r
1266 # * Sets the xid\r
1267 # */\r
1268 sub SetXID\r
1269 {\r
1270   my $self = shift;\r
1271   my $xid = shift;  # take a string arguement\r
1272   if (!defined($xid)) {\r
1273     $self->{strError} = "XID is undefined.";\r
1274     return CCR_ERROR;\r
1275   }\r
1276   $self->{strXID} = $xid;\r
1277   return CCR_NO_ERROR;\r
1278 }\r
1279 \r
1280 #/**\r
1281 # * Sets tax exempt flag\r
1282 # */\r
1283 sub SetTaxExempt\r
1284 {\r
1285   my $self = shift;\r
1286   my $taxExempt = shift;  # take a string arguement\r
1287   if (!defined($taxExempt)) {\r
1288     $self->{strError} = "Tax exempt flag is undefined.";\r
1289     return CCR_ERROR;\r
1290   }\r
1291   $self->{boolTaxExempt} = $taxExempt;\r
1292   return CCR_NO_ERROR;\r
1293 }\r
1294 \r
1295 #/**\r
1296 # * Sets invoice number\r
1297 # */\r
1298 sub SetInvoiceNumber\r
1299 {\r
1300   my $self = shift;\r
1301   my $invoiceNumber = shift;  # take a string arguement\r
1302   if (!defined($invoiceNumber)) {\r
1303     $self->{strError} = "Invoice number is undefined.";\r
1304     return CCR_ERROR;\r
1305   }\r
1306   $self->{strInvoiceNumber} = $invoiceNumber;\r
1307   return CCR_NO_ERROR;\r
1308 }\r
1309 \r
1310 #/**\r
1311 # * Sets the Authentication Transaction ID\r
1312 # * \r
1313 # * Used in Payer Authentication transaction type\r
1314 # */\r
1315 sub SetAuthenticationTransactionId\r
1316 {\r
1317   my $self = shift;\r
1318   my $authenticationTransactionId = shift;  # take a string arguement\r
1319   if (!defined($authenticationTransactionId)) {\r
1320     $self->{strError} = "Authentication Transaction ID is undefined.";\r
1321     return CCR_ERROR;\r
1322   }\r
1323   $self->{strAuthenticationTransactionId} = $authenticationTransactionId;\r
1324   return CCR_NO_ERROR;\r
1325 }\r
1326 \r
1327 #/**\r
1328 # * Sets the Authentication Payload\r
1329 # * \r
1330 # * Used in Payer Authentication transaction type\r
1331 # */\r
1332 sub SetAuthenticationPayload\r
1333 {\r
1334   my $self = shift;\r
1335   my $authenticationPayload = shift;  # take a string arguement\r
1336   if (!defined($authenticationPayload)) {\r
1337     $self->{strError} = "Authentication Payload is undefined.";\r
1338     return CCR_ERROR;\r
1339   }\r
1340   $self->{strAuthenticationPayload} = $authenticationPayload;\r
1341   return CCR_NO_ERROR;\r
1342 }\r
1343 \r
1344 #/**\r
1345 # * Sets the Success On Authentication Inconclusive\r
1346 # * \r
1347 # * Used in Payer Authentication transaction type\r
1348 # */\r
1349 sub SetDoTransactionOnAuthenticationInconclusive\r
1350 {\r
1351   my $self = shift;\r
1352   my $successOnAuthenticationInconclusive = shift;  # take a string arguement\r
1353   if (!defined($successOnAuthenticationInconclusive)) {\r
1354     $self->{strError} = "Success on authentication inconclusive is undefined.";\r
1355     return CCR_ERROR;\r
1356   }\r
1357   $self->{boolSuccessOnAuthenticationInconclusive} = $successOnAuthenticationInconclusive;\r
1358   return CCR_NO_ERROR;\r
1359 }\r
1360 \r
1361 \r
1362 #**\r
1363 # * Set the Industry type.\r
1364 # * <p>\r
1365 # * @param industry Must be one of the following constants: DIRECT_MARKETING, RETAIL, LODGING, RESTAURANT.\r
1366 # * @exception TransactionProtocolException thrown if industry is not a valid charge type\r
1367 # * defined by this class.\r
1368 # */\r
1369 sub SetIndustry\r
1370 {\r
1371   my $self = shift;\r
1372   my $industry = shift;  # take one string arguement\r
1373   \r
1374   if (!defined($industry)) {\r
1375     $self->{strError} = "Industry is undefined.";\r
1376     return CCR_ERROR;\r
1377   }\r
1378   if ($industry eq "") {\r
1379     $self->{strError} = "Invalid industry";\r
1380     return CCR_ERROR;\r
1381   }\r
1382   \r
1383   if (!($industry eq DIRECT_MARKETING ||\r
1384         $industry eq RETAIL || \r
1385         $industry eq LODGING ||\r
1386         $industry eq RESTAURANT )) {\r
1387     $self->{strError} = "Invalid industry.";\r
1388     return CCR_ERROR;\r
1389   }\r
1390   $self->{strIndustry} = $industry;\r
1391   return CCR_NO_ERROR;\r
1392 }\r
1393 \r
1394 \r
1395 #/**\r
1396 # * Sets folio number\r
1397 # */\r
1398 sub SetFolioNumber\r
1399 {\r
1400   my $self = shift;\r
1401   my $folioNumber = shift;  # take a string arguement\r
1402   if (!defined($folioNumber)) {\r
1403     $self->{strError} = "Folio number is undefined.";\r
1404     return CCR_ERROR;\r
1405   }\r
1406   $self->{strFolioNumber} = $folioNumber;\r
1407   return CCR_NO_ERROR;\r
1408 }\r
1409 \r
1410 \r
1411 \r
1412 #**\r
1413 # * Set the service rate using a floating point value.\r
1414 # * <p>\r
1415 # * @param ServiceRate Must be a positive floating-point number.\r
1416 # * E.g. Use <i>11.55</i> to represent $11.55.\r
1417 # * @exception TransactionProtocolException thrown if ServiceRate less than zero\r
1418 # */\r
1419 sub SetServiceRate\r
1420 {\r
1421   my $self = shift;\r
1422   my $ServiceRate = shift; # take a string or an integer arguement\r
1423   \r
1424   if (!defined($ServiceRate)) {\r
1425     $self->{strError} = "Service rate is undefined.";\r
1426     return CCR_ERROR;\r
1427   }\r
1428   if ( $ServiceRate !~ /^(\d+\.?\d*|\.\d+)$/ ) {\r
1429     $self->{strError} = "Non-numeric Service Rate.";\r
1430     return CCR_ERROR;\r
1431   }\r
1432   \r
1433   my $dServiceRate = $ServiceRate * 1.0;\r
1434   if ($dServiceRate < 0) {\r
1435     $self->{strError} = "Service rate cannot be negative.";\r
1436     return CCR_ERROR;\r
1437   }\r
1438   \r
1439   $self->{dServiceRate} = $dServiceRate;\r
1440   $self->{strServiceRate} = "".$ServiceRate;\r
1441   return CCR_NO_ERROR;\r
1442 }\r
1443 \r
1444 \r
1445 #**\r
1446 # * Set the service end day\r
1447 # */  \r
1448 sub SetServiceEndDay\r
1449 {\r
1450   my $self = shift;\r
1451   my $serviceEndDay = shift; #take one string arguement\r
1452   if (!defined($serviceEndDay)) {\r
1453     $self->{strError} = "Service end day is undefined.";\r
1454     return CCR_ERROR;\r
1455   }\r
1456   if ($serviceEndDay eq ""){\r
1457     $self->{strError} = "Invalid service end day.";\r
1458     return CCR_ERROR;\r
1459   }\r
1460   \r
1461   if ($serviceEndDay =~ /\D/) {\r
1462     $self->{strError} = "Invalid service end day (non-digit).";\r
1463     return CCR_ERROR;\r
1464   }\r
1465   \r
1466   $serviceEndDay = 1 * $serviceEndDay;\r
1467   if ($serviceEndDay < 1 || $serviceEndDay > 31) {\r
1468     $self->{strError} .= "Invalid service end day (not 1 through 31).";\r
1469     return CCR_ERROR;\r
1470   }\r
1471   $self->{intServiceEndDay} = $serviceEndDay;\r
1472   \r
1473   return 1;\r
1474 }  \r
1475 \r
1476   \r
1477 #**\r
1478 # * Set the service end month\r
1479 # */  \r
1480 sub SetServiceEndMonth\r
1481 {\r
1482   my $self = shift;\r
1483   my $serviceEndMonth = shift; #take one string arguement\r
1484   if (!defined($serviceEndMonth)) {\r
1485     $self->{strError} = "Service end month is undefined.";\r
1486     return CCR_ERROR;\r
1487   }\r
1488   if ($serviceEndMonth eq ""){\r
1489     $self->{strError} = "Invalid service end month.";\r
1490     return CCR_ERROR;\r
1491   }\r
1492   \r
1493   if ($serviceEndMonth =~ /\D/) {\r
1494     $self->{strError} = "Invalid service end month (non-digit).";\r
1495     return CCR_ERROR;\r
1496   }\r
1497   \r
1498   $serviceEndMonth = 1 * $serviceEndMonth;\r
1499   if ($serviceEndMonth < 1 || $serviceEndMonth > 12) {\r
1500     $self->{strError} .= "Invalid service end month (not 1 through 12).";\r
1501     return CCR_ERROR;\r
1502   }\r
1503   $self->{intServiceEndMonth} = $serviceEndMonth;\r
1504   \r
1505   return 1;\r
1506 }   \r
1507   \r
1508 #**\r
1509 # * Set the service end year\r
1510 # */  \r
1511 sub SetServiceEndYear\r
1512 {\r
1513   my $self = shift;\r
1514   my $serviceEndYear = shift; #take one string arguement\r
1515   if (!defined($serviceEndYear)) {\r
1516     $self->{strError} = "Service end year is undefined.";\r
1517     return CCR_ERROR;\r
1518   }\r
1519   if ($serviceEndYear eq ""){\r
1520     $self->{strError} = "Invalid service end year.";\r
1521     return CCR_ERROR;\r
1522   }\r
1523   \r
1524   if ($serviceEndYear =~ /\D/) {\r
1525     $self->{strError} = "Invalid service end year (non-digit).";\r
1526     return CCR_ERROR;\r
1527   }\r
1528   \r
1529   $serviceEndYear = 1 * $serviceEndYear;\r
1530   if ($serviceEndYear < 2005 || $serviceEndYear > 9999) {\r
1531     $self->{strError} .= "Invalid service end year.";\r
1532     return CCR_ERROR;\r
1533   }\r
1534   $self->{intServiceEndYear} = $serviceEndYear;\r
1535   \r
1536   return 1;\r
1537 }  \r
1538 \r
1539 \r
1540 #**\r
1541 # * Set the service start day\r
1542 # */  \r
1543 sub SetServiceStartDay\r
1544 {\r
1545   my $self = shift;\r
1546   my $serviceStartDay = shift; #take one string arguement\r
1547   if (!defined($serviceStartDay)) {\r
1548     $self->{strError} = "Service start day is undefined.";\r
1549     return CCR_ERROR;\r
1550   }\r
1551   if ($serviceStartDay eq ""){\r
1552     $self->{strError} = "Invalid service start day.";\r
1553     return CCR_ERROR;\r
1554   }\r
1555   \r
1556   if ($serviceStartDay =~ /\D/) {\r
1557     $self->{strError} = "Invalid service start day (non-digit).";\r
1558     return CCR_ERROR;\r
1559   }\r
1560   \r
1561   $serviceStartDay = 1 * $serviceStartDay;\r
1562   if ($serviceStartDay < 1 || $serviceStartDay > 31) {\r
1563     $self->{strError} .= "Invalid service start day (not 1 through 31).";\r
1564     return CCR_ERROR;\r
1565   }\r
1566   $self->{intServiceStartDay} = $serviceStartDay;\r
1567   \r
1568   return 1;\r
1569 }  \r
1570 \r
1571   \r
1572 #**\r
1573 # * Set the service start month\r
1574 # */  \r
1575 sub SetServiceStartMonth\r
1576 {\r
1577   my $self = shift;\r
1578   my $serviceStartMonth = shift; #take one string arguement\r
1579   if (!defined($serviceStartMonth)) {\r
1580     $self->{strError} = "Service start month is undefined.";\r
1581     return CCR_ERROR;\r
1582   }\r
1583   if ($serviceStartMonth eq ""){\r
1584     $self->{strError} = "Invalid service start month.";\r
1585     return CCR_ERROR;\r
1586   }\r
1587   \r
1588   if ($serviceStartMonth =~ /\D/) {\r
1589     $self->{strError} = "Invalid service start month (non-digit).";\r
1590     return CCR_ERROR;\r
1591   }\r
1592   \r
1593   $serviceStartMonth = 1 * $serviceStartMonth;\r
1594   if ($serviceStartMonth < 1 || $serviceStartMonth > 12) {\r
1595     $self->{strError} .= "Invalid service start month (not 1 through 12).";\r
1596     return CCR_ERROR;\r
1597   }\r
1598   $self->{intServiceStartMonth} = $serviceStartMonth;\r
1599   \r
1600   return 1;\r
1601 }   \r
1602   \r
1603 #**\r
1604 # * Set the service start year\r
1605 # */  \r
1606 sub SetServiceStartYear\r
1607 {\r
1608   my $self = shift;\r
1609   my $serviceStartYear = shift; #take one string arguement\r
1610   if (!defined($serviceStartYear)) {\r
1611     $self->{strError} = "Service start year is undefined.";\r
1612     return CCR_ERROR;\r
1613   }\r
1614   if ($serviceStartYear eq ""){\r
1615     $self->{strError} = "Invalid service start year.";\r
1616     return CCR_ERROR;\r
1617   }\r
1618   \r
1619   if ($serviceStartYear =~ /\D/) {\r
1620     $self->{strError} = "Invalid service start year (non-digit).";\r
1621     return CCR_ERROR;\r
1622   }\r
1623   \r
1624   $serviceStartYear = 1 * $serviceStartYear;\r
1625   if ($serviceStartYear < 2005 || $serviceStartYear > 9999) {\r
1626     $self->{strError} .= "Invalid service start year.";\r
1627     return CCR_ERROR;\r
1628   }\r
1629   $self->{intServiceStartYear} = $serviceStartYear;\r
1630   \r
1631   return 1;\r
1632 }  \r
1633 \r
1634 \r
1635 \r
1636 #/**\r
1637 # * Sets the Charge Total Includes Restaurant flag\r
1638 # * \r
1639 # */\r
1640 sub SetChargeTotalIncludesRestaurant\r
1641 {\r
1642   my $self = shift;\r
1643   my $isChargeTotalIncludesRestaurant = shift;  # take a string arguement\r
1644   if (!defined($isChargeTotalIncludesRestaurant)) {\r
1645     $self->{strError} = "Charge Total Includes Restaurant is undefined.";\r
1646     return CCR_ERROR;\r
1647   }\r
1648   $self->{boolChargeTotalIncludesRestaurant} = $isChargeTotalIncludesRestaurant;\r
1649   return CCR_NO_ERROR;\r
1650 }\r
1651 \r
1652 #/**\r
1653 # * Sets the Charge Total Includes Giftshop flag\r
1654 # * \r
1655 # */\r
1656 sub SetChargeTotalIncludesGiftshop\r
1657 {\r
1658   my $self = shift;\r
1659   my $isChargeTotalIncludesGiftshop = shift;  # take a string arguement\r
1660   if (!defined($isChargeTotalIncludesGiftshop)) {\r
1661     $self->{strError} = "Charge Total Includes Giftshop is undefined.";\r
1662     return CCR_ERROR;\r
1663   }\r
1664   $self->{boolChargeTotalIncludesGiftshop} = $isChargeTotalIncludesGiftshop;\r
1665   return CCR_NO_ERROR;\r
1666 }\r
1667 \r
1668 #/**\r
1669 # * Sets the Charge Total Includes Minibar flag\r
1670 # * \r
1671 # */\r
1672 sub SetChargeTotalIncludesMinibar\r
1673 {\r
1674   my $self = shift;\r
1675   my $isChargeTotalIncludesMinibar = shift;  # take a string arguement\r
1676   if (!defined($isChargeTotalIncludesMinibar)) {\r
1677     $self->{strError} = "Charge Total Includes Minibar is undefined.";\r
1678     return CCR_ERROR;\r
1679   }\r
1680   $self->{boolChargeTotalIncludesMinibar} = $isChargeTotalIncludesMinibar;\r
1681   return CCR_NO_ERROR;\r
1682 }\r
1683 \r
1684 #/**\r
1685 # * Sets the Charge Total Includes Phone flag\r
1686 # * \r
1687 # */\r
1688 sub SetChargeTotalIncludesPhone\r
1689 {\r
1690   my $self = shift;\r
1691   my $isChargeTotalIncludesPhone = shift;  # take a string arguement\r
1692   if (!defined($isChargeTotalIncludesPhone)) {\r
1693     $self->{strError} = "Charge Total Includes Phone is undefined.";\r
1694     return CCR_ERROR;\r
1695   }\r
1696   $self->{boolChargeTotalIncludesPhone} = $isChargeTotalIncludesPhone;\r
1697   return CCR_NO_ERROR;\r
1698 }\r
1699 \r
1700 #/**\r
1701 # * Sets the Charge Total Includes Laundry flag\r
1702 # * \r
1703 # */\r
1704 sub SetChargeTotalIncludesLaundry\r
1705 {\r
1706   my $self = shift;\r
1707   my $isChargeTotalIncludesLaundry = shift;  # take a string arguement\r
1708   if (!defined($isChargeTotalIncludesLaundry)) {\r
1709     $self->{strError} = "Charge Total Includes Laundry is undefined.";\r
1710     return CCR_ERROR;\r
1711   }\r
1712   $self->{boolChargeTotalIncludesLaundry} = $isChargeTotalIncludesLaundry;\r
1713   return CCR_NO_ERROR;\r
1714 }\r
1715 \r
1716 #/**\r
1717 # * Sets the Charge Total Includes Other flag\r
1718 # * \r
1719 # */\r
1720 sub SetChargeTotalIncludesOther\r
1721 {\r
1722   my $self = shift;\r
1723   my $isChargeTotalIncludesOther = shift;  # take a string arguement\r
1724   if (!defined($isChargeTotalIncludesOther)) {\r
1725     $self->{strError} = "Charge Total Includes Other is undefined.";\r
1726     return CCR_ERROR;\r
1727   }\r
1728   $self->{boolChargeTotalIncludesOther} = $isChargeTotalIncludesOther;\r
1729   return CCR_NO_ERROR;\r
1730 }\r
1731 \r
1732 #/**\r
1733 # * Sets the Service No Show flag\r
1734 # * \r
1735 # */\r
1736 sub SetServiceNoShow\r
1737 {\r
1738   my $self = shift;\r
1739   my $isServiceNoShow = shift;  # take a string arguement\r
1740   if (!defined($isServiceNoShow)) {\r
1741     $self->{strError} = "Service No Show is undefined.";\r
1742     return CCR_ERROR;\r
1743   }\r
1744   $self->{boolServiceNoShow} = $isServiceNoShow;\r
1745   return CCR_NO_ERROR;\r
1746 }\r
1747 \r
1748 \r
1749 \r
1750 #/////////////////////////////////////////////////////////////////////////////////////////////////////\r
1751 #// Get Methods.\r
1752 #\r
1753 \r
1754 #/**\r
1755 # * Get the cartridge type.\r
1756 # * @returns the type of cartridge being used\r
1757 # */\r
1758 sub GetCartridgeType\r
1759 {\r
1760   my $self = shift;\r
1761   $self->{strCartridgeType};\r
1762 }\r
1763 \r
1764 #/**\r
1765 # * Get the Ecommerce Indicator\r
1766 # * @returns the Ecommerce Indicator\r
1767 # */\r
1768 sub GetEcommerceIndicator\r
1769 {\r
1770   my $self = shift;\r
1771   $self->{strEcommerceIndicator};\r
1772 }\r
1773 \r
1774 #/**\r
1775 # * Get the value of the credit card number.\r
1776 # * @see #setCreditCardNumber(JString)\r
1777 # * @return the value of the credit card number or an empty String if the credit card number was not set\r
1778 # */\r
1779 sub GetCreditCardNumber\r
1780 {\r
1781   my $self = shift;\r
1782   $self->{strCreditCardNumber};\r
1783 }\r
1784 \r
1785 #/**\r
1786 # * Get the value of the credit card number.\r
1787 # * @return the value of the credit card verification number or an empty String if the credit card number was not set\r
1788 # */\r
1789 sub GetCreditCardVerificationNumber\r
1790 {\r
1791   my $self = shift;\r
1792   $self->{strCreditCardVerificationNumber};\r
1793 }\r
1794 \r
1795 #**\r
1796 # * Get the value of the credit card's expire year.\r
1797 # * @see #setExpireYear(JString)\r
1798 # * @return the String passed to setExpireYear or an empty String if the expire year was not set\r
1799 # */\r
1800 sub GetExpireYear\r
1801 {\r
1802   my $self = shift;\r
1803   $self->{strExpireYear};\r
1804 }\r
1805 \r
1806 \r
1807 #**\r
1808 # * Get the value of the credit card's expire month.\r
1809 # * @see #setExpireMonth(String)\r
1810 # * @return the String passed to setExpireMonth or an empty String if the expire month was not set\r
1811 # */\r
1812 sub GetExpireMonth\r
1813 {\r
1814   my $self = shift;\r
1815   $self->{strExpireMonth};\r
1816 }\r
1817 \r
1818 \r
1819 #**\r
1820 # * Get the value of the charge type.  The possible values are defined\r
1821 # * by the constants of this class documented in setChargeType(String)\r
1822 # * The chage type indicates what action to take with this credit card\r
1823 # * transaction.\r
1824 # * @see #setChargeType(String)\r
1825 # * @return the String passed to setChargeType or an empty String if the charge type was not set\r
1826 #\r
1827 sub GetChargeType()\r
1828 {\r
1829   my $self = shift;\r
1830   $self->{strChargeType};\r
1831 }\r
1832 \r
1833 \r
1834 #**\r
1835 # * Get the value of the charge total.  The charge total is the amount that\r
1836 # * will be used for this credit card transaction.\r
1837 # * @see #setChargeTotal(double)\r
1838 # * @see #setChargeTotal(String)\r
1839 # * @return the value of the charge total or -1 if the charge total was not set\r
1840 #\r
1841 sub GetChargeTotal\r
1842 {\r
1843   my $self = shift;\r
1844   $self->{dChargeTotal};\r
1845 }\r
1846 \r
1847 sub GetChargeTotalStr\r
1848 {\r
1849   my $self = shift;\r
1850   $self->{strChargeTotal};\r
1851 }\r
1852 \r
1853 #**\r
1854 # * Get the value of the card brand.  The card brand identifies the type\r
1855 # * of card being used.  The card brand must be one of the constants defined\r
1856 # * by this class and documented in setCardBrand(JString)\r
1857 # * @see #setCardBrand(JString)\r
1858 # * @return the value of the card brand or an empty String if the card brand was not set\r
1859 #/\r
1860 sub GetCardBrand\r
1861 {\r
1862   my $self = shift;\r
1863   $self->{strCardBrand};\r
1864 }\r
1865 \r
1866 #**\r
1867 # * Get the value of the order id.  The order id must be a unique identifier\r
1868 # * for a paticular order.\r
1869 # * @see #setOrderId(JString)\r
1870 # * @return the value of the order id or an empty String if the order id was not set\r
1871 # */\r
1872 sub GetOrderId\r
1873 {\r
1874   my $self = shift;\r
1875   $self->{strOrderId};\r
1876 }\r
1877 \r
1878 \r
1879 \r
1880 #**\r
1881 # * Get the value of the capture reference id.  The capture reference id is the\r
1882 # * value returned from an "AUTH" credit card transaction that must be presented\r
1883 # * when to the "CAPTURE" for that order.\r
1884 # * @see #setCaptureReferenceId(JString)\r
1885 # * @return the value of the capture reference id or an empty String if the capture reference id was not set\r
1886 #\r
1887 sub GetCaptureReferenceId\r
1888 {\r
1889   my $self = shift;\r
1890   $self->{strReferenceId};\r
1891 }\r
1892 \r
1893 #\r
1894 # Get Reference Id\r
1895 # This should be used instead of GetCaptureReferenceId\r
1896 # Added in v1.6\r
1897 #\r
1898 sub GetReferenceId\r
1899 {\r
1900   my $self = shift;\r
1901   $self->{strReferenceId};\r
1902 }\r
1903 \r
1904 #/**\r
1905 # * Get the value of the order description.  The order description is a comment\r
1906 # * that describes the order.\r
1907 # * @see #setOrderDescription(JString)\r
1908 # * @return the value of the order description or an empty String if the order description was not set\r
1909 #/\r
1910 sub GetOrderDescription\r
1911 {\r
1912   my $self = shift;\r
1913   $self->{strOrderDescription};\r
1914 }\r
1915 \r
1916 #**\r
1917 # * Get the value of the order user id.  The order user id is a unique identifier\r
1918 # * for a merchant's customer.\r
1919 # * @see #setOrderUserId(String)\r
1920 # * @return the value of the order user id of an empty String if order user id was not set\r
1921 #\r
1922 sub GetOrderUserId\r
1923 {\r
1924   my $self = shift;\r
1925   $self->{strOrderUserId};\r
1926 }\r
1927 \r
1928 #**\r
1929 # * Get the value of the duplicate check.  \r
1930 # * Possible values are: CHECK; OVERRIDE; NO_CHECK.\r
1931 # * @see #setDuplicateCheck(String)\r
1932 # * @return the value of the duplicate check or an empty String if the dc was not set\r
1933 #\r
1934 sub GetDuplicateCheck\r
1935 {\r
1936   my $self = shift;\r
1937   $self->{strDuplicateCheck};\r
1938 }\r
1939 \r
1940 \r
1941 #**\r
1942 # * Get the value of the bank approval code.  The bank approval code is the\r
1943 # * value required for a "FORCE_AUTH" or "FORCE_SALE" credit card transaction.\r
1944 # * It is obtained offline via a phone call to the merchant's bank 'voice auth' \r
1945 # * phone number.  The card holder is not present in this type of transaction.\r
1946 # * @see #setBankApprovalCode(String)\r
1947 # * @return the value of the bank approval code or an empty String if the bac was not set\r
1948 #\r
1949 sub GetBankApprovalCode\r
1950 {\r
1951   my $self = shift;\r
1952   $self->{strBankApprovalCode};\r
1953 }\r
1954 \r
1955 \r
1956 #**\r
1957 # * The tax amount is the amount of the the charge total that is tax.\r
1958 # * @see #setTaxAmount\r
1959 # * @see #setChargeTotal\r
1960 # * @return value of the tax amount of -1 if the tax amount has not been set.\r
1961 #\r
1962 sub GetTaxAmount\r
1963 {\r
1964   my $self = shift;\r
1965   $self->{dTaxAmount};\r
1966 }\r
1967 \r
1968 sub GetTaxAmountStr\r
1969 {\r
1970   my $self = shift;\r
1971   $self->{strTaxAmount};\r
1972 }\r
1973 \r
1974 \r
1975 #**\r
1976 # * The shipping charge is the amount of the charge total that is shipping charges.\r
1977 # * @see #setShippingCharge\r
1978 # * @see #setChargeTotal\r
1979 # * @return value of the shipping charge or -1 if the shipping charge has not been set\r
1980 # */\r
1981 sub GetShippingCharge\r
1982 {\r
1983   my $self = shift;\r
1984   $self->{dShippingCharge};\r
1985 }\r
1986 \r
1987 sub GetShippingChargeStr\r
1988 {\r
1989   my $self = shift;\r
1990   $self->{strShippingCharge};\r
1991 }\r
1992 \r
1993 \r
1994 #/**\r
1995 # * Get the value of the first name of the customer being billed.\r
1996 # * @see #setBillFirstName(JString)\r
1997 # * @return the billing first name or an empty String if the billing first name was not set\r
1998 # */\r
1999 sub GetBillFirstName\r
2000 {\r
2001   my $self = shift;\r
2002   $self->{strBillFirstName};\r
2003 }\r
2004 \r
2005 \r
2006 #**\r
2007 # * Get the value of the last name of the customer being billed.\r
2008 # * @see #setBillLastName(String)\r
2009 # * return the billing last name or an empty String if the billing last name was not set\r
2010 # */\r
2011 sub GetBillLastName\r
2012 {\r
2013   my $self = shift;\r
2014   $self->{strBillLastName};\r
2015 }\r
2016 \r
2017 \r
2018 #**\r
2019 # * Get the value of the middle name of the customer being billed.\r
2020 # * @see #setBillMiddleName(JString)\r
2021 # * @return the billing middle name or an empty String if the billing middle name was not set\r
2022 # */\r
2023 sub GetBillMiddleName\r
2024 {\r
2025   my $self = shift;\r
2026   $self->{strBillMiddleName};\r
2027 }\r
2028 \r
2029 \r
2030 #**\r
2031 # * Get the value of the title of the customer being billed.\r
2032 # * @see #setBillCustomerTitle(JString)\r
2033 # * @return the billing customer title or an empty String if billing customer title was not set\r
2034 # */\r
2035 sub GetBillCustomerTitle\r
2036 {\r
2037   my $self = shift;\r
2038   $self->{strBillCustomerTitle};\r
2039 }\r
2040 \r
2041 #**\r
2042 # * Get the value of the company name of the customer being billed.\r
2043 # * @see #setBillCompany(JString)\r
2044 # * @return the billing company name or an empty String if the billing company name was not set\r
2045 #\r
2046 sub GetBillCompany\r
2047 {\r
2048   my $self = shift;\r
2049   $self->{strBillCompany};\r
2050 }\r
2051 \r
2052 \r
2053 #**\r
2054 # * Get the value of the first part of the billing address.\r
2055 # * @see #setBillAddressOne(JString)\r
2056 # * @return the first part of the billing address or an empty String if the billing address part one was not set\r
2057 # */\r
2058 sub GetBillAddressOne\r
2059 {\r
2060   my $self = shift;\r
2061   $self->{strBillAddressOne};\r
2062 }\r
2063 \r
2064 \r
2065 #**\r
2066 # * Get the value of the second part of the billing address.\r
2067 # * @see #setBillAddressTwo(JString)\r
2068 # * @return the second part of the billing address or an empty String if the billing address part two was not set\r
2069 # */\r
2070 sub GetBillAddressTwo\r
2071 {\r
2072   my $self = shift;\r
2073   $self->{strBillAddressTwo};\r
2074 }\r
2075 \r
2076 \r
2077 #**\r
2078 # * Get the value of the city for the billing address.\r
2079 # * @see #setBillCity(JString)\r
2080 # * @return the billing address city or an empty String if the billing city was not set\r
2081 # */\r
2082 sub GetBillCity\r
2083 {\r
2084   my $self = shift;\r
2085   $self->{strBillCity};\r
2086 }\r
2087 \r
2088 \r
2089 #**\r
2090 # * Get the value of the state or province for the billing address.\r
2091 # * @see #setBillStateOrProvince(String)\r
2092 # * @return the billing address state or province or an empty String if billing state or province was not set\r
2093 # */\r
2094 sub GetBillStateOrProvince\r
2095 {\r
2096   my $self = shift;\r
2097   $self->{strBillStateOrProvince};\r
2098 }\r
2099 \r
2100 \r
2101 #**\r
2102 # * Get the value of the postal code for the billing address.\r
2103 # * @see #setBillPostalCode(String)\r
2104 # * @return the billing address postal code or an empty String if billing postal code was not set\r
2105 #*/\r
2106 sub GetBillPostalCode\r
2107 {\r
2108   my $self = shift;\r
2109   $self->{strBillPostalCode};\r
2110 }\r
2111 \r
2112 \r
2113 #**\r
2114 # * Get the value of the country for the billing address.\r
2115 # * @see #setBillCountryCode(JString)\r
2116 # * @return the billing country or an empty String if the billing country was not set\r
2117 #\r
2118 sub GetBillCountryCode\r
2119 {\r
2120   my $self = shift;\r
2121   $self->{strBillCountryCode};\r
2122 }\r
2123 \r
2124 \r
2125 #**\r
2126 # * Get the value of the email address of the customer being billed.\r
2127 # * @see #setBillEmail(JString)\r
2128 # * @return the billing email address or an empty String if the billing email was not set\r
2129 #\r
2130 sub GetBillEmail\r
2131 {\r
2132   my $self = shift;\r
2133   $self->{strBillEmail};\r
2134 }\r
2135 \r
2136 \r
2137 #**\r
2138 # * Get the value of the phone number of the customer being billed.\r
2139 # * @see #setBillPhone(JString)\r
2140 # * @return the billing phone number or an empty String if the billing phone number was not set\r
2141 # */\r
2142 sub GetBillPhone\r
2143 {\r
2144   my $self = shift;\r
2145   $self->{strBillPhone};\r
2146 }\r
2147 \r
2148 \r
2149 #**\r
2150 # * Get the value of the fax number of the customer being billed.\r
2151 # * @see #setBillFax(JString)\r
2152 # * @return the billing fax number or an empty String if the billing fax number was not set\r
2153 # */\r
2154 sub GetBillFax\r
2155 {\r
2156   my $self = shift;\r
2157   $self->{strBillFax};\r
2158 }\r
2159 \r
2160 \r
2161 #**\r
2162 # * Get the value of the billing note.  The billing note is an extra\r
2163 # * comment to the billing information.\r
2164 # * @see #setBillNote(JString)\r
2165 # * @return the billing note or an empty String if the billing not was not set\r
2166 #\r
2167 sub GetBillNote\r
2168 {\r
2169   my $self = shift;\r
2170   $self->{strBillNote};\r
2171 }\r
2172 \r
2173 #**\r
2174 # * Get the value of the first name of the customer being shipped to.\r
2175 # * @see #setShipFirstName(JString)\r
2176 # * @return the shipping first name or an empty String if the shipping first name was not set\r
2177 #\r
2178 sub GetShipFirstName\r
2179 {\r
2180   my $self = shift;\r
2181   $self->{strShipFirstName};\r
2182 }\r
2183 \r
2184 \r
2185 #**\r
2186 # * Get the value of the last name of the customer being shipped to.\r
2187 # * @see #setShipLastName(JString)\r
2188 # * @return the shipping last name or an empty String if the shipping last name was not set\r
2189 # */\r
2190 sub GetShipLastName\r
2191 {\r
2192   my $self = shift;\r
2193   $self->{strShipLastName};\r
2194 }\r
2195 \r
2196 \r
2197 #**\r
2198 # * Get the value of the middle name of the customer being shipped to.\r
2199 # * @see #setShipMiddleName(JString)\r
2200 # * @return the shipping middle name or an empty String if the shipping middle name was not set\r
2201 # */\r
2202 sub GetShipMiddleName\r
2203 {\r
2204   my $self = shift;\r
2205   $self->{strShipMiddleName};\r
2206 }\r
2207 \r
2208 \r
2209 #**\r
2210 # * Get the value of the title of the customer being shipped to.\r
2211 # * @see #setShipCustomerTitle(String)\r
2212 # * @return the shipping customer title or an empty String if the shipping customer title was not set\r
2213 #\r
2214 sub GetShipCustomerTitle\r
2215 {\r
2216   my $self = shift;\r
2217   $self->{strShipCustomerTitle};\r
2218 }\r
2219 \r
2220 \r
2221 #**\r
2222 # * Get the value of the company name of the customer being shipped to.\r
2223 # * @see #setShipCompany(JString)\r
2224 # * @return the shipping company name or an empty String if the shipping company name was not set\r
2225 # */\r
2226 sub GetShipCompany\r
2227 {\r
2228   my $self = shift;\r
2229   $self->{strShipCompany};\r
2230 }\r
2231 \r
2232 \r
2233 #**\r
2234 # * Get the value of the first part of the shipping address.\r
2235 # * @see #setShipAddressOne(JString)\r
2236 # * @return the first part of the shipping address or an empty String if the shipping address part one was not set\r
2237 # */\r
2238 sub GetShipAddressOne\r
2239 {\r
2240   my $self = shift;\r
2241   $self->{strShipAddressOne};\r
2242 }\r
2243 \r
2244 \r
2245 #**\r
2246 # * Get the value of the second part of the shipping address.\r
2247 # * @see #setShipAddressTwo(JString)\r
2248 # * @return the second part of the shipping address or an empty String if the shipping address part two was not set\r
2249 #\r
2250 sub GetShipAddressTwo\r
2251 {\r
2252   my $self = shift;\r
2253   $self->{strShipAddressTwo};\r
2254 }\r
2255 \r
2256 \r
2257 #**\r
2258 # * Get the value of the city for the shipping address.\r
2259 # * @see #setShipCity(JString)\r
2260 # * @return the shipping address city or an empty String if the shipping city was not set\r
2261 #\r
2262 sub GetShipCity\r
2263 {\r
2264   my $self = shift;\r
2265   $self->{strShipCity};\r
2266 }\r
2267 \r
2268 #**\r
2269 # * Get the value of the state or province for the shipping address.\r
2270 # * @see #setShipStateOrProvince(JString)\r
2271 # * @return the shipping address state or province or an empty String if the shipping state or provice was not set\r
2272 # */\r
2273 sub GetShipStateOrProvince\r
2274 {\r
2275   my $self = shift;\r
2276   $self->{strShipStateOrProvince};\r
2277 }\r
2278 \r
2279 \r
2280 #*\r
2281 # * Get the value of the postal code for the shipping address.\r
2282 # * @see #setShipPostalCode(JString)\r
2283 # * @return the shipping address postal code or an empty String if the shipping postal code was not set\r
2284 # */\r
2285 sub GetShipPostalCode\r
2286 {\r
2287   my $self = shift;\r
2288   $self->{strShipPostalCode};\r
2289 }\r
2290 \r
2291 \r
2292 #**\r
2293 # * Get the value of the country for the shipping address.\r
2294 # * @see #setShipCountryCode(JString)\r
2295 # * @return the shipping country or an empty String if the shipping country was not set\r
2296 # */\r
2297 sub GetShipCountryCode\r
2298 {\r
2299   my $self = shift;\r
2300   $self->{strShipCountryCode};\r
2301 }\r
2302 \r
2303 \r
2304 #**\r
2305 # * Get the value of the email address of the customer being shipped to.\r
2306 # * @see #setShipEmail(JString)\r
2307 # * @return the shipping email address or an empty String if the shipping customer email address was not set\r
2308 # */\r
2309 sub GetShipEmail\r
2310 {\r
2311   my $self = shift;\r
2312   $self->{strShipEmail};\r
2313 }\r
2314 \r
2315 \r
2316 #**\r
2317 # * Get the value of the phone number of the customer being shipped to.\r
2318 # * @see #setShipPhone(JString)\r
2319 # * @return the shipping phone number or an empty String if the shipping customer phone number was not set\r
2320 # */\r
2321 sub GetShipPhone\r
2322 {\r
2323   my $self = shift;\r
2324   $self->{strShipPhone};\r
2325 }\r
2326 \r
2327 \r
2328 #**\r
2329 # * Get the value of the fax number of the customer being shipped to.\r
2330 # * @see #setShipFax(JString)\r
2331 # * @return the shipping fax number or an empty JString if the shipping customer fax number was not set\r
2332 # */\r
2333 sub GetShipFax\r
2334 {\r
2335   my $self = shift;\r
2336   $self->{strShipFax};\r
2337 }\r
2338 \r
2339 \r
2340 #**\r
2341 # * Get the value of the shipping note.  The shipping note is an extra\r
2342 # * comment to the shipping information.\r
2343 # * @see #setShipNote(JString)\r
2344 # * @return the shipping note or an empty String if the shipping note was not set\r
2345 # */\r
2346 sub GetShipNote\r
2347 {\r
2348   my $self = shift;\r
2349   $self->{strShipNote};\r
2350 }\r
2351 \r
2352 \r
2353 #**\r
2354 # * Method to get a CreditCardResponse object.\r
2355 # */\r
2356 sub GetTransResponseObject\r
2357 {\r
2358   my $self = shift;\r
2359   my $InString = shift;\r
2360   return new Business::OnlinePayment::PPIPayMover::CreditCardResponse($InString);\r
2361 }\r
2362 \r
2363 \r
2364 #/**\r
2365 # * Get the value of the currency.  The currency that\r
2366 # * will be used for this transaction. If the merchant\r
2367 # * does not have an account configured to process this currency, the\r
2368 # * Transaction Server will return an error.\r
2369 # * @see #setCurrency(String) \r
2370 # * @return the currency or "" if the currency was not set\r
2371 # */\r
2372 sub GetCurrency\r
2373 {\r
2374   my $self = shift;\r
2375   $self->{strCurrency};\r
2376 }\r
2377 \r
2378 \r
2379 #/**\r
2380 # * Gets the buyer code\r
2381 # */\r
2382 sub GetBuyerCode\r
2383 {\r
2384   my $self = shift;\r
2385   $self->{strBuyerCode};\r
2386 }\r
2387 \r
2388 #/**\r
2389 # * Gets the CAVV (for VBV transactions)\r
2390 # */\r
2391 sub GetCAVV\r
2392 {\r
2393   my $self = shift;\r
2394   $self->{strCAVV};\r
2395 }\r
2396 \r
2397 #/**\r
2398 # * Gets the Customer IP Address\r
2399 # */\r
2400 sub GetCustomerIPAddress\r
2401 {\r
2402   my $self = shift;\r
2403   $self->{strCustomerIPAddress};\r
2404 }\r
2405 \r
2406 #/**\r
2407 # * Gets the Order Customer ID\r
2408 # */\r
2409 sub GetOrderCustomerId\r
2410 {\r
2411   my $self = shift;\r
2412   $self->{strOrderCustomerID};\r
2413 }\r
2414 \r
2415 #/**\r
2416 # * Gets the purchase order number\r
2417 # */\r
2418 sub GetPurchaseOrderNumber\r
2419 {\r
2420   my $self = shift;\r
2421   $self->{strPurchaseOrderNumber};\r
2422 }\r
2423 \r
2424 #/**\r
2425 # * Gets the state tax\r
2426 # */\r
2427 sub GetStateTax\r
2428 {\r
2429   my $self = shift;\r
2430   $self->{dStateTax};\r
2431 }\r
2432 \r
2433 #/**\r
2434 # * Gets the track 1 data\r
2435 # */\r
2436 sub GetTrack1\r
2437 {\r
2438   my $self = shift;\r
2439   $self->{strTrack1};\r
2440 }\r
2441 \r
2442 #/**\r
2443 # * Gets the track 2 data\r
2444 # */\r
2445 sub GetTrack2\r
2446 {\r
2447   my $self = shift;\r
2448   $self->{strTrack2};\r
2449 }\r
2450 \r
2451 #/**\r
2452 # * Gets the transaction condition code\r
2453 # */\r
2454 sub GetTransactionConditionCode\r
2455 {\r
2456   my $self = shift;\r
2457   $self->{strTransactionConditionCode};\r
2458 }\r
2459 \r
2460 #/**\r
2461 # * Gets the xid\r
2462 # */\r
2463 sub GetXID\r
2464 {\r
2465   my $self = shift;\r
2466   $self->{strXID};\r
2467 }\r
2468 \r
2469 #/**\r
2470 # * Gets tax exempt flag\r
2471 # */\r
2472 sub GetTaxExempt\r
2473 {\r
2474   my $self = shift;\r
2475   $self->{boolTaxExempt};\r
2476 }\r
2477 \r
2478 #/**\r
2479 # * Gets invoice number\r
2480 # */\r
2481 sub GetInvoiceNumber\r
2482 {\r
2483   my $self = shift;\r
2484   $self->{strInvoiceNumber};\r
2485 }\r
2486 \r
2487 #/**\r
2488 # * Gets the Authentication Transaction ID\r
2489 # * \r
2490 # * Used in Payer Authentication transaction type\r
2491 # */\r
2492 sub GetAuthenticationTransactionId\r
2493 {\r
2494   my $self = shift;\r
2495   $self->{strAuthenticationTransactionId};\r
2496 }\r
2497 \r
2498 #/**\r
2499 # * Gets the Authentication Payload\r
2500 # * \r
2501 # * Used in Payer Authentication transaction type\r
2502 # */\r
2503 sub GetAuthenticationPayload\r
2504 {\r
2505   my $self = shift;\r
2506   $self->{strAuthenticationPayload};\r
2507 }\r
2508 \r
2509 #/**\r
2510 # * Gets the Success On Authentication Inconclusive\r
2511 # * \r
2512 # * Used in Payer Authentication transaction type\r
2513 # */\r
2514 sub GetDoTransactionOnAuthenticationInconclusive\r
2515 {\r
2516   my $self = shift;\r
2517   $self->{boolSuccessOnAuthenticationInconclusive};\r
2518 }\r
2519 \r
2520 \r
2521 #/**\r
2522 # * Gets the industry\r
2523 # */\r
2524 sub GetIndustry\r
2525 {\r
2526   my $self = shift;\r
2527   $self->{strIndustry};\r
2528 }\r
2529 \r
2530 #/**\r
2531 # * Gets the folio number\r
2532 # */\r
2533 sub GetFolioNumber\r
2534 {\r
2535   my $self = shift;\r
2536   $self->{strFolioNumber};\r
2537 }\r
2538 \r
2539 #/**\r
2540 # * Gets the service rate\r
2541 # */\r
2542 sub GetServiceRate\r
2543 {\r
2544   my $self = shift;\r
2545   $self->{dServiceRate};\r
2546 }\r
2547 \r
2548 #/**\r
2549 # * Gets the service rate as a String\r
2550 # */\r
2551 sub GetServiceRateStr\r
2552 {\r
2553   my $self = shift;\r
2554   $self->{strServiceRate};\r
2555 }\r
2556 \r
2557 #/**\r
2558 # * Gets the service start year\r
2559 # */\r
2560 sub GetServiceStartYear\r
2561 {\r
2562   my $self = shift;\r
2563   $self->{intServiceStartYear};\r
2564 }\r
2565 \r
2566 #/**\r
2567 # * Gets the service start month\r
2568 # */\r
2569 sub GetServiceStartMonth\r
2570 {\r
2571   my $self = shift;\r
2572   $self->{intServiceStartMonth};\r
2573 }\r
2574 \r
2575 #/**\r
2576 # * Gets the service start day\r
2577 # */\r
2578 sub GetServiceStartDay\r
2579 {\r
2580   my $self = shift;\r
2581   $self->{intServiceStartDay};\r
2582 }\r
2583 \r
2584 #/**\r
2585 # * Gets the service end year\r
2586 # */\r
2587 sub GetServiceEndYear\r
2588 {\r
2589   my $self = shift;\r
2590   $self->{intServiceEndYear};\r
2591 }\r
2592 \r
2593 #/**\r
2594 # * Gets the service end month\r
2595 # */\r
2596 sub GetServiceEndMonth\r
2597 {\r
2598   my $self = shift;\r
2599   $self->{intServiceEndMonth};\r
2600 }\r
2601 \r
2602 #/**\r
2603 # * Gets the service end day\r
2604 # */\r
2605 sub GetServiceEndDay\r
2606 {\r
2607   my $self = shift;\r
2608   $self->{intServiceEndDay};\r
2609 }\r
2610 \r
2611 #/**\r
2612 # * Gets the Charge Total Includes Restaurant flag\r
2613 # */\r
2614 sub GetChargeTotalIncludesRestaurant\r
2615 {\r
2616   my $self = shift;\r
2617   $self->{boolChargeTotalIncludesRestaurant};\r
2618 }\r
2619 \r
2620 #/**\r
2621 # * Gets the Charge Total Includes Giftshop flag\r
2622 # */\r
2623 sub GetChargeTotalIncludesGiftshop\r
2624 {\r
2625   my $self = shift;\r
2626   $self->{boolChargeTotalIncludesGiftshop};\r
2627 }\r
2628 \r
2629 #/**\r
2630 # * Gets the Charge Total Includes Minibar flag\r
2631 # */\r
2632 sub GetChargeTotalIncludesMinibar\r
2633 {\r
2634   my $self = shift;\r
2635   $self->{boolChargeTotalIncludesMinibar};\r
2636 }\r
2637 \r
2638 #/**\r
2639 # * Gets the Charge Total Includes Laundry flag\r
2640 # */\r
2641 sub GetChargeTotalIncludesLaundry\r
2642 {\r
2643   my $self = shift;\r
2644   $self->{boolChargeTotalIncludesLaundry};\r
2645 }\r
2646 \r
2647 #/**\r
2648 # * Gets the Charge Total Includes Phone flag\r
2649 # */\r
2650 sub GetChargeTotalIncludesPhone\r
2651 {\r
2652   my $self = shift;\r
2653   $self->{boolChargeTotalIncludesPhone};\r
2654 }\r
2655 \r
2656 #/**\r
2657 # * Gets the Charge Total Includes Other flag\r
2658 # */\r
2659 sub GetChargeTotalIncludesOther\r
2660 {\r
2661   my $self = shift;\r
2662   $self->{boolChargeTotalIncludesOther};\r
2663 }\r
2664 \r
2665 #/**\r
2666 # * Gets the Service No Show flag\r
2667 # */\r
2668 sub GetServiceNoShow\r
2669 {\r
2670   my $self = shift;\r
2671   $self->{boolServiceNoShow};\r
2672 }\r
2673 \r
2674 \r
2675 \r
2676 #**\r
2677 # * Method to create the post string.\r
2678 # */\r
2679 sub WriteRequest\r
2680 {\r
2681   my $self = shift;\r
2682   my $class =ref($self);\r
2683   my $PostString = shift; # a pointer to string as arguement\r
2684   my $temp = "";\r
2685   $self->SUPER::WriteRequest($PostString);\r
2686   \r
2687 #        Cartridge Type\r
2688   $temp = Encode( $self->{strCartridgeType} );\r
2689   $$PostString .= "cartridge_type=$temp";\r
2690   $$PostString .= $self->{strParamSeparator};\r
2691 \r
2692 #        Ecommerce Indicator\r
2693   $temp = Encode( $self->{strEcommerceIndicator} );\r
2694   $$PostString .= "ecommerce_indicator=$temp";\r
2695   $$PostString .= $self->{strParamSeparator};\r
2696   \r
2697 #        fixed value for transaction_type\r
2698   $$PostString .= "transaction_type=CREDIT_CARD";\r
2699   $$PostString .= $self->{strParamSeparator};\r
2700   \r
2701 #        creditCardNumber\r
2702   $temp = Encode( $self->{strCreditCardNumber} );\r
2703   $$PostString .= "credit_card_number=$temp";\r
2704   $$PostString .= $self->{strParamSeparator};\r
2705 \r
2706 #        creditCardVerificationNumber\r
2707   $temp = Encode( $self->{strCreditCardVerificationNumber} );\r
2708   $$PostString .= "credit_card_verification_number=$temp";\r
2709   $$PostString .= $self->{strParamSeparator};\r
2710   \r
2711 # expireMonth\r
2712   $temp = Encode( $self->{strExpireMonth} );\r
2713   $$PostString .= "expire_month=$temp";\r
2714   $$PostString .= $self->{strParamSeparator};\r
2715   \r
2716 # expireYear\r
2717   $temp = Encode( $self->{strExpireYear} );\r
2718   $$PostString .= "expire_year=$temp";\r
2719   $$PostString .= $self->{strParamSeparator};\r
2720   \r
2721 #  chargeType\r
2722   $temp = Encode( $self->{strChargeType} );\r
2723   $$PostString .= "charge_type=$temp";\r
2724   $$PostString .= $self->{strParamSeparator};\r
2725   \r
2726 #   chargeTotal\r
2727   $$PostString .= "charge_total=";\r
2728   $$PostString .= Encode( $self->{dChargeTotal} );\r
2729   $$PostString .= $self->{strParamSeparator};\r
2730   \r
2731 #   cardBrand\r
2732 #  $$PostString .= "card_brand=";\r
2733 #  $$PostString .= Encode( $self->{strCardBrand} );\r
2734 #  $$PostString .= $self->{strParamSeparator};\r
2735   \r
2736 #   orderId\r
2737   $temp = Encode( $self->{strOrderId} );\r
2738   $$PostString .= "order_id=$temp";\r
2739   $$PostString .= $self->{strParamSeparator};\r
2740   \r
2741 #    captureReferenceId\r
2742   $temp = Encode( $self->{strReferenceId} );\r
2743   $$PostString .= "reference_id=$temp";\r
2744   $$PostString .= $self->{strParamSeparator};\r
2745   \r
2746 #   orderDescription\r
2747   $temp = Encode( $self->{strOrderDescription} );\r
2748   $$PostString .= "order_description=$temp";\r
2749   $$PostString .= $self->{strParamSeparator};\r
2750   \r
2751 #    orderUserId\r
2752   $temp = Encode( $self->{strOrderUserId} );\r
2753   $$PostString .= "order_user_id=$temp";\r
2754   $$PostString .= $self->{strParamSeparator};\r
2755 \r
2756 #    BankApprovalCode\r
2757   $temp = Encode( $self->{strBankApprovalCode} );\r
2758   $$PostString .= "bank_approval_code=$temp";\r
2759   $$PostString .= $self->{strParamSeparator};\r
2760   \r
2761 #    DuplicateCheck\r
2762   $temp = Encode( $self->{strDuplicateCheck} );\r
2763   $$PostString .= "duplicate_check=$temp";\r
2764   $$PostString .= $self->{strParamSeparator};\r
2765 \r
2766 #   taxAmount\r
2767   $$PostString .= "tax_amount=";\r
2768   $$PostString .= Encode( $self->{dTaxAmount} );\r
2769   $$PostString .= $self->{strParamSeparator};\r
2770   \r
2771 #   shippingCharge\r
2772   $$PostString .= "shipping_charge=";\r
2773   $$PostString .= Encode( $self->{dShippingCharge} );\r
2774   $$PostString .= $self->{strParamSeparator};\r
2775   \r
2776 #   billFirstName\r
2777   $temp = Encode( $self->{strBillFirstName} );\r
2778   $$PostString .= "bill_first_name=$temp";\r
2779   $$PostString .= $self->{strParamSeparator};\r
2780   \r
2781 #   billMiddleName\r
2782   $temp = Encode( $self->{strBillMiddleName} );\r
2783   $$PostString .= "bill_middle_name=$temp";\r
2784   $$PostString .= $self->{strParamSeparator};\r
2785   \r
2786 #   billLastName\r
2787   $temp = Encode( $self->{strBillLastName} );\r
2788   $$PostString .= "bill_last_name=$temp";\r
2789   $$PostString .= $self->{strParamSeparator};\r
2790   \r
2791 #   billCustomerTitle\r
2792   $temp = Encode( $self->{strBillCustomerTitle} );\r
2793   $$PostString .= "bill_customer_title=$temp";\r
2794   $$PostString .= $self->{strParamSeparator};\r
2795   \r
2796 #   billCompany\r
2797   $temp = Encode( $self->{strBillCompany} );\r
2798   $$PostString .= "bill_company=$temp";\r
2799   $$PostString .= $self->{strParamSeparator};\r
2800   \r
2801 #   billAddressOne\r
2802   $temp = Encode( $self->{strBillAddressOne} );\r
2803   $$PostString .= "bill_address_one=$temp";\r
2804   $$PostString .= $self->{strParamSeparator};\r
2805   \r
2806 #   billAddressTwo\r
2807   $temp = Encode( $self->{strBillAddressTwo} );\r
2808   $$PostString .= "bill_address_two=$temp";\r
2809   $$PostString .= $self->{strParamSeparator};\r
2810   \r
2811 #   billCity\r
2812   $temp = Encode( $self->{strBillCity} );\r
2813   $$PostString .= "bill_city=$temp";\r
2814   $$PostString .= $self->{strParamSeparator};\r
2815   \r
2816 #   billStateOrProvince\r
2817   $temp = Encode( $self->{strBillStateOrProvince} );\r
2818   $$PostString .= "bill_state_or_province=$temp";\r
2819   $$PostString .= $self->{strParamSeparator};\r
2820   \r
2821 #    billPostalCode\r
2822   $temp = Encode( $self->{strBillPostalCode} );\r
2823   $$PostString .= "bill_postal_code=$temp";\r
2824   $$PostString .= $self->{strParamSeparator};\r
2825   \r
2826 #   billCountryCode\r
2827   $temp = Encode( $self->{strBillCountryCode} );\r
2828   $$PostString .= "bill_country_code=$temp";\r
2829   $$PostString .= $self->{strParamSeparator};\r
2830   \r
2831 #   billEmail\r
2832   $temp = Encode( $self->{strBillEmail} );\r
2833   $$PostString .= "bill_email=$temp";\r
2834   $$PostString .= $self->{strParamSeparator};\r
2835   \r
2836 #   billPhone\r
2837   $temp = Encode( $self->{strBillPhone} );\r
2838   $$PostString .= "bill_phone=$temp";\r
2839   $$PostString .= $self->{strParamSeparator};\r
2840   \r
2841 #   billFax\r
2842   $temp = Encode( $self->{strBillFax} );\r
2843   $$PostString .= "bill_fax=$temp";\r
2844   $$PostString .= $self->{strParamSeparator};\r
2845   \r
2846 #   billNote\r
2847   $temp = Encode( $self->{strBillNote} );\r
2848   $$PostString .= "bill_note=$temp";\r
2849   $$PostString .= $self->{strParamSeparator};\r
2850   \r
2851 #   shipFirstName\r
2852   $temp = Encode( $self->{strShipFirstName} );\r
2853   $$PostString .= "ship_first_name=$temp";\r
2854   $$PostString .= $self->{strParamSeparator};\r
2855   \r
2856 #   shipMiddleName\r
2857   $temp = Encode( $self->{strShipMiddleName} );\r
2858   $$PostString .= "ship_middle_name=$temp";\r
2859   $$PostString .= $self->{strParamSeparator};\r
2860   \r
2861 #   shipLastName\r
2862   $temp = Encode( $self->{strShipLastName} );\r
2863   $$PostString .= "ship_last_name=$temp";\r
2864   $$PostString .= $self->{strParamSeparator};\r
2865   \r
2866 #   shipCustomerTitle\r
2867   $temp = Encode( $self->{strShipCustomerTitle} );\r
2868   $$PostString .= "ship_customer_title=$temp";\r
2869   $$PostString .= $self->{strParamSeparator};\r
2870   \r
2871 #  shipCompany\r
2872   $temp = Encode( $self->{strShipCompany} );\r
2873   $$PostString .= "ship_company=$temp";\r
2874   $$PostString .= $self->{strParamSeparator};\r
2875   \r
2876 #   shipAddressOne\r
2877   $temp = Encode( $self->{strShipAddressOne} );\r
2878   $$PostString .= "ship_address_one=$temp";\r
2879   $$PostString .= $self->{strParamSeparator};\r
2880   \r
2881 #   shipAddressTwo\r
2882   $temp = Encode( $self->{strShipAddressTwo} );\r
2883   $$PostString .= "ship_address_two=$temp";\r
2884   $$PostString .= $self->{strParamSeparator};\r
2885   \r
2886 #   shipCity\r
2887   $temp = Encode( $self->{strShipCity} );\r
2888   $$PostString .= "ship_city=$temp";\r
2889   $$PostString .= $self->{strParamSeparator};\r
2890   \r
2891 #   shipStateOrProvince\r
2892   $temp = Encode( $self->{strShipStateOrProvince} );\r
2893   $$PostString .= "ship_state_or_province=$temp";\r
2894   $$PostString .= $self->{strParamSeparator};\r
2895   \r
2896 #  shipPostalCode\r
2897   $temp = Encode( $self->{strShipPostalCode} );\r
2898   $$PostString .= "ship_postal_code=$temp";\r
2899   $$PostString .= $self->{strParamSeparator};\r
2900   \r
2901 #   shipCountryCode\r
2902   $temp = Encode( $self->{strShipCountryCode} );\r
2903   $$PostString .= "ship_country_code=$temp";\r
2904   $$PostString .= $self->{strParamSeparator};\r
2905   \r
2906 #   shipEmail\r
2907   $temp = Encode( $self->{strShipEmail} );\r
2908   $$PostString .= "ship_email=$temp";\r
2909   $$PostString .= $self->{strParamSeparator};\r
2910   \r
2911 #   shipPhone\r
2912   $temp = Encode( $self->{strShipPhone} );\r
2913   $$PostString .= "ship_phone=$temp";\r
2914   $$PostString .= $self->{strParamSeparator};\r
2915   \r
2916 #   shipFax\r
2917   $temp = Encode( $self->{strShipFax} );\r
2918   $$PostString .= "ship_fax=$temp";\r
2919   $$PostString .= $self->{strParamSeparator};\r
2920   \r
2921 #   shipNote\r
2922   $temp = Encode( $self->{strShipNote} );\r
2923   $$PostString .= "ship_note=$temp";\r
2924   $$PostString .= $self->{strParamSeparator};\r
2925  \r
2926 #   Currency \r
2927 #  $temp = Encode( $self->{strCurrency} );\r
2928 #  $$PostString .= "currency=$temp";\r
2929 #  $$PostString .= $self->{strParamSeparator};\r
2930 \r
2931 #   Buyer Code\r
2932   $temp = Encode( $self->{strBuyerCode} );\r
2933   $$PostString .= "buyer_code=$temp";\r
2934   $$PostString .= $self->{strParamSeparator};\r
2935 \r
2936 #   CAVV\r
2937   $temp = Encode( $self->{strCAVV} );\r
2938   $$PostString .= "cavv=$temp";\r
2939   $$PostString .= $self->{strParamSeparator};\r
2940 \r
2941 #   Customer IP Address\r
2942   $temp = Encode( $self->{strCustomerIPAddress} );\r
2943   $$PostString .= "customer_ip_address=$temp";\r
2944   $$PostString .= $self->{strParamSeparator};\r
2945 \r
2946 #   Order Customer ID\r
2947   $temp = Encode( $self->{strOrderCustomerID} );\r
2948   $$PostString .= "order_customer_id=$temp";\r
2949   $$PostString .= $self->{strParamSeparator};\r
2950 \r
2951 #   Purchase Order Number\r
2952   $temp = Encode( $self->{strPurchaseOrderNumber} );\r
2953   $$PostString .= "purchase_order_number=$temp";\r
2954   $$PostString .= $self->{strParamSeparator};\r
2955 \r
2956 #   State Tax\r
2957   $temp = Encode( $self->{dStateTax} );\r
2958   if( $temp == -1 ) {\r
2959     $temp = "";\r
2960   }\r
2961   $$PostString .= "state_tax=$temp";\r
2962   $$PostString .= $self->{strParamSeparator};\r
2963 \r
2964 #   Track 1\r
2965   $temp = Encode( $self->{strTrack1} );\r
2966   $$PostString .= "track1=$temp";\r
2967   $$PostString .= $self->{strParamSeparator};\r
2968 \r
2969 #   Track 2\r
2970   $temp = Encode( $self->{strTrack2} );\r
2971   $$PostString .= "track2=$temp";\r
2972   $$PostString .= $self->{strParamSeparator};\r
2973 \r
2974 #   Transaction condition code\r
2975   $temp = Encode( $self->{strTransactionConditionCode} );\r
2976   $$PostString .= "transaction_condition_code=$temp";\r
2977   $$PostString .= $self->{strParamSeparator};\r
2978 \r
2979 #   XID\r
2980   $temp = Encode( $self->{strXID} );\r
2981   $$PostString .= "x_id=$temp";\r
2982   $$PostString .= $self->{strParamSeparator};\r
2983   \r
2984 #   Invoice number\r
2985   $temp = Encode( $self->{strInvoiceNumber} );\r
2986   $$PostString .= "invoice_number=$temp";\r
2987   $$PostString .= $self->{strParamSeparator};  \r
2988 \r
2989 #   Tax Exempt\r
2990   $temp = $self->{boolTaxExempt};\r
2991   if ( $temp eq "" ) {\r
2992     #not set.  leave it.\r
2993   } elsif ( $temp ) {\r
2994     $temp = "true";\r
2995   } elsif(! $temp) {\r
2996     $temp = "false";\r
2997   } else {\r
2998     $temp = "";\r
2999   }\r
3000   $$PostString .= "tax_exempt=$temp";\r
3001   $$PostString .= $self->{strParamSeparator}; \r
3002   \r
3003 #   Authentication Transaction ID\r
3004   $temp = Encode( $self->{strAuthenticationTransactionId} );\r
3005   $$PostString .= "authentication_transaction_id=$temp";\r
3006   $$PostString .= $self->{strParamSeparator};\r
3007 \r
3008 #   Authentication Payload\r
3009   $temp = Encode( $self->{strAuthenticationPayload} );\r
3010   $$PostString .= "authentication_payload=$temp";\r
3011   $$PostString .= $self->{strParamSeparator};  \r
3012 \r
3013 #   Success On Authentication Inconclusive\r
3014   $temp = $self->{boolSuccessOnAuthenticationInconclusive};\r
3015   if ( $temp eq "" ) {\r
3016     #not set.  leave it.\r
3017   } elsif ( $temp ) {\r
3018     $temp = "true";\r
3019   } elsif(!$temp) {\r
3020     $temp = "false";\r
3021   } else {\r
3022     $temp = "";\r
3023   }\r
3024   $$PostString .= "success_on_authentication_inconclusive=$temp";\r
3025   $$PostString .= $self->{strParamSeparator};  \r
3026   \r
3027 #   Industry\r
3028   $temp = Encode( $self->{strIndustry} );\r
3029   $$PostString .= "industry=$temp";\r
3030   $$PostString .= $self->{strParamSeparator};  \r
3031   \r
3032 #   Folio number\r
3033   $temp = Encode( $self->{strFolioNumber} );\r
3034   $$PostString .= "folio_number=$temp";\r
3035   $$PostString .= $self->{strParamSeparator};  \r
3036   \r
3037 #   Service Rate\r
3038   $temp = Encode( $self->{dServiceRate} );\r
3039   if( $temp == -1 ) {\r
3040     $temp = "";\r
3041   }\r
3042   $$PostString .= "service_rate=$temp";\r
3043   $$PostString .= $self->{strParamSeparator};\r
3044   \r
3045 # Service Start Day\r
3046   $temp = Encode( $self->{intServiceStartDay} );\r
3047   $$PostString .= "service_start_day=$temp";\r
3048   $$PostString .= $self->{strParamSeparator};  \r
3049   \r
3050 # Service Start Month\r
3051   $temp = Encode( $self->{intServiceStartMonth} );\r
3052   $$PostString .= "service_start_month=$temp";\r
3053   $$PostString .= $self->{strParamSeparator};  \r
3054   \r
3055 # Service Start Year\r
3056   $temp = Encode( $self->{intServiceStartYear} );\r
3057   $$PostString .= "service_start_year=$temp";\r
3058   $$PostString .= $self->{strParamSeparator};  \r
3059   \r
3060 # Service End Day\r
3061   $temp = Encode( $self->{intServiceEndDay} );\r
3062   $$PostString .= "service_end_day=$temp";\r
3063   $$PostString .= $self->{strParamSeparator};  \r
3064   \r
3065 # Service End Month\r
3066   $temp = Encode( $self->{intServiceEndMonth} );\r
3067   $$PostString .= "service_end_month=$temp";\r
3068   $$PostString .= $self->{strParamSeparator};  \r
3069   \r
3070 # Service End Year\r
3071   $temp = Encode( $self->{intServiceEndYear} );\r
3072   $$PostString .= "service_end_year=$temp";\r
3073   $$PostString .= $self->{strParamSeparator};  \r
3074   \r
3075 # Charge Total Includes Restaurant\r
3076   $temp = Encode( $self->{boolChargeTotalIncludesRestaurant} );\r
3077     if ( $temp eq "" ) {\r
3078       #not set.  leave it.\r
3079     } elsif ( $temp ) {\r
3080       $temp = "true";\r
3081     } elsif(!$temp) {\r
3082       $temp = "false";\r
3083     } else {\r
3084       $temp = "";\r
3085   }\r
3086   $$PostString .= "charge_total_incl_restaurant=$temp";\r
3087   $$PostString .= $self->{strParamSeparator};  \r
3088   \r
3089 # Charge Total Includes Giftshop\r
3090   $temp = Encode( $self->{boolChargeTotalIncludesGiftshop} );\r
3091     if ( $temp eq "" ) {\r
3092       #not set.  leave it.\r
3093     } elsif ( $temp ) {\r
3094       $temp = "true";\r
3095     } elsif(!$temp) {\r
3096       $temp = "false";\r
3097     } else {\r
3098       $temp = "";\r
3099   }\r
3100   $$PostString .= "charge_total_incl_giftshop=$temp";\r
3101   $$PostString .= $self->{strParamSeparator}; \r
3102   \r
3103 # Charge Total Includes Minibar\r
3104   $temp = Encode( $self->{boolChargeTotalIncludesMinibar} );\r
3105     if ( $temp eq "" ) {\r
3106       #not set.  leave it.\r
3107     } elsif ( $temp ) {\r
3108       $temp = "true";\r
3109     } elsif(!$temp) {\r
3110       $temp = "false";\r
3111     } else {\r
3112       $temp = "";\r
3113   }\r
3114   $$PostString .= "charge_total_incl_minibar=$temp";\r
3115   $$PostString .= $self->{strParamSeparator}; \r
3116   \r
3117 # Charge Total Includes Phone\r
3118   $temp = Encode( $self->{boolChargeTotalIncludesPhone} );\r
3119     if ( $temp eq "" ) {\r
3120       #not set.  leave it.\r
3121     } elsif ( $temp ) {\r
3122       $temp = "true";\r
3123     } elsif(!$temp) {\r
3124       $temp = "false";\r
3125     } else {\r
3126       $temp = "";\r
3127   }\r
3128   $$PostString .= "charge_total_incl_phone=$temp";\r
3129   $$PostString .= $self->{strParamSeparator}; \r
3130 \r
3131 # Charge Total Includes Laundry\r
3132   $temp = Encode( $self->{boolChargeTotalIncludesLaundry} );\r
3133     if ( $temp eq "" ) {\r
3134       #not set.  leave it.\r
3135     } elsif ( $temp ) {\r
3136       $temp = "true";\r
3137     } elsif(!$temp) {\r
3138       $temp = "false";\r
3139     } else {\r
3140       $temp = "";\r
3141   }\r
3142   $$PostString .= "charge_total_incl_laundry=$temp";\r
3143   $$PostString .= $self->{strParamSeparator}; \r
3144   \r
3145 # Charge Total Includes Other\r
3146   $temp = Encode( $self->{boolChargeTotalIncludesOther} );\r
3147     if ( $temp eq "" ) {\r
3148       #not set.  leave it.\r
3149     } elsif ( $temp ) {\r
3150       $temp = "true";\r
3151     } elsif(!$temp) {\r
3152       $temp = "false";\r
3153     } else {\r
3154       $temp = "";\r
3155   }\r
3156   $$PostString .= "charge_total_incl_other=$temp";\r
3157   $$PostString .= $self->{strParamSeparator}; \r
3158   \r
3159 # Service No Show\r
3160   $temp = Encode( $self->{boolServiceNoShow} );\r
3161     if ( $temp eq "" ) {\r
3162       #not set.  leave it.\r
3163     } elsif ( $temp ) {\r
3164       $temp = "true";\r
3165     } elsif(!$temp) {\r
3166       $temp = "false";\r
3167     } else {\r
3168       $temp = "";\r
3169   }\r
3170   $$PostString .= "service_no_show=$temp";\r
3171   \r
3172 # No parameter separator on last line.\r
3173 \r
3174 }\r
3175 \r
3176 sub GetErrorString\r
3177 {\r
3178   my $self = shift;\r
3179   return $self->{strError};\r
3180 }\r
3181 \r
3182 \r