Added UUID support
authorfbriere <fbriere>
Fri, 17 Feb 2006 19:30:05 +0000 (19:30 +0000)
committerfbriere <fbriere>
Fri, 17 Feb 2006 19:30:05 +0000 (19:30 +0000)
InternetSecure.pm
t/30parse.t

index 2ad18fd..34acc97 100755 (executable)
@@ -37,7 +37,7 @@ sub set_defaults {
        $self->path('/process.cgi');
 
        $self->build_subs(qw(
-                               receipt_number  sales_number
+                               receipt_number  sales_number    uuid    guid
                                date
                                card_type       cardholder
                                total_amount
@@ -249,6 +249,8 @@ sub parse_response {
 
                        receipt_number  => 'ReceiptNumber',
                        sales_number    => 'SalesOrderNumber',
+                       uuid            => 'GUID',
+                       guid            => 'GUID',
 
                        date            => 'Date',
                        cardholder      => 'xxxName',
@@ -467,6 +469,15 @@ InternetSecure transactions.
 Sales order number of this transaction.  This is a number, unique to each
 merchant, which is incremented by 1 each time.
 
+=item uuid()
+
+Universally Unique Identifier associated to this transaction.  This is a
+128-bit value returned as a 36-character string such as
+C<f81d4fae-7dec-11d0-a765-00a0c91e6bf6>.  See RFC 4122 for more details on
+UUIDs.
+
+B<guid>() is provided as an alias to this method.
+
 =item date()
 
 Date and time of the transaction.  Format is C<YYYY/MM/DD hh:mm:ss>.
index cfc2b55..7962c1a 100755 (executable)
@@ -20,6 +20,8 @@ use constant RESULTS => (
                                        avs_response    => undef,
                                        cvv2_response   => undef,
                                        total_amount    => 3.88,
+                                       uuid            => 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6',
+                                       guid            => 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6',
                                },
                                {
                                        is_success      => 0,
@@ -33,6 +35,8 @@ use constant RESULTS => (
                                        avs_response    => undef,
                                        cvv2_response   => undef,
                                        total_amount    => 3.88,
+                                       uuid            => undef,
+                                       guid            => undef,
                                },
                        );
 
@@ -128,6 +132,7 @@ __DATA__
   <DoubleColonProducts>3.10::1::001::Test Product 1::{USD}{GST}{TEST}|0.20::1::010::Test Product 2::{GST}{TEST}|0.33::1::020::Test Product 3::{GST}{TEST}|0.25::1::GST::Canadian GST Charged::{TAX}{CALCULATED}</DoubleColonProducts>
   <AVSResponseCode />
   <CVV2ResponseCode />
+  <GUID>f81d4fae-7dec-11d0-a765-00a0c91e6bf6</GUID>
 </TranxResponse>
 
 <?xml version="1.0" encoding="UTF-8"?>