Rewrote parts of the manpage
authorfbriere <fbriere>
Fri, 17 Feb 2006 23:32:37 +0000 (23:32 +0000)
committerfbriere <fbriere>
Fri, 17 Feb 2006 23:32:37 +0000 (23:32 +0000)
InternetSecure.pm

index 34acc97..13e1858 100755 (executable)
@@ -315,10 +315,10 @@ Business::OnlinePayment::InternetSecure - InternetSecure backend for Business::O
   $txn->content(
        action          => 'Normal Authorization',
 
-       type            => 'Visa',
-       card_number     => '0000000000000000',
+       type            => 'Visa',                      # Optional
+       card_number     => '4111 1111 1111 1111',
        exp_date        => '2004-07',
-       cvv2            => '000',               # Optional
+       cvv2            => '000',                       # Optional
 
        name            => "Fr\x{e9}d\x{e9}ric Bri\x{e8}re",
        company         => '',
@@ -330,10 +330,10 @@ Business::OnlinePayment::InternetSecure - InternetSecure backend for Business::O
        phone           => '(555) 555-1212',
        email           => 'fbriere@fbriere.net',
 
-       description     => 'Online purchase',
        amount          => 49.95,
        currency        => 'CAD',
        taxes           => 'GST PST',
+       description     => 'Test transaction',
        );
 
   $txn->submit;
@@ -346,8 +346,8 @@ Business::OnlinePayment::InternetSecure - InternetSecure backend for Business::O
 
 =head1 DESCRIPTION
 
-Business::OnlinePayment::InternetSecure is an implementation of
-L<Business::OnlinePayment> that allows for processing online credit card
+C<Business::OnlinePayment::InternetSecure> is an implementation of
+C<Business::OnlinePayment> that allows for processing online credit card
 payments through InternetSecure.
 
 See L<Business::OnlinePayment> for more information about the generic
@@ -355,31 +355,27 @@ Business::OnlinePayment interface.
 
 =head1 CREATOR
 
-Object creation is done via L<Business::OnlinePayment>; see its manpage for
-details.  The I<merchant_id> processor option is required, and corresponds
+Object creation is done via C<Business::OnlinePayment>; see its manpage for
+details.  The B<merchant_id> processor option is required, and corresponds
 to the merchant ID assigned to you by InternetSecure.
 
 =head1 METHODS
 
-(Other methods are also available -- see L<Business::OnlinePayment> for more
-details.)
-
-=head2 Before order submission
+=head2 Transaction setup and transmission
 
 =over 4
 
 =item content( CONTENT )
 
-Sets up the data prior to a transaction (overwriting any previous data by the
-same occasion).  CONTENT is an associative array (hash), containing some of
-the following fields:
+Sets up the data prior to a transaction.  CONTENT is an associative array
+(hash), containing some of the following fields:
 
 =over 4
 
 =item action (required)
 
 What to do with the transaction.  Only C<Normal Authorization> is supported
-for the moment.
+at the moment.
 
 =item type
 
@@ -405,9 +401,9 @@ Credit card number.  Spaces are allowed, and will be automatically removed.
 
 =item exp_date (required)
 
-Credit card expiration date.  Since L<Business::OnlinePayment> does not specify
+Credit card expiration date.  Since C<Business::OnlinePayment> does not specify
 any syntax, this module is rather lax regarding what it will accept.  The
-recommended syntax is I<YYYY-MM>, but forms such as I<MM/YYYY> or I<MMYY> are
+recommended syntax is C<YYYY-MM>, but forms such as C<MM/YYYY> or C<MMYY> are
 allowed as well.
 
 =item cvv2
@@ -422,7 +418,7 @@ Code (CVC2) or Card Identification number (CID), depending on the card issuer.
 
 =item description
 
-A short description of the purchase.  See L<"Products list syntax"> for
+A short description of the transaction.  See L<"Products list syntax"> for
 an alternate syntax that allows a list of products to be specified.
 
 =item amount (usually required)
@@ -448,20 +444,38 @@ by concatenating them with spaces, such as C<GST HST>.
 
 =item name / company / address / city / state / zip / country / phone / email
 
-Customer information.  B<Country> should be a two-letter code taken from ISO
+Customer information.  B<country> should be a two-letter code taken from ISO
 3166-1.
 
 =back
 
+=item submit()
+
+Submit the transaction to InternetSecure.
+
 =back
 
-=head2 After order submission
+=head2 Post-submission methods
 
 =over 4
 
+=item is_success()
+
+Returns true if the transaction was submitted successfully.
+
+=item result_code()
+
+Response code returned by InternetSecure.
+
+=item error_message()
+
+Text description of the response code.  (Do not rely on this to check for
+errors, as a description will also be returned for successful transactions.
+Use B<is_success>() instead.)
+
 =item receipt_number()
 
-Receipt number of this transaction; this is actually a string, unique to all
+Receipt number (a string, actually) of this transaction, unique to all
 InternetSecure transactions.
 
 =item sales_number()
@@ -478,6 +492,15 @@ UUIDs.
 
 B<guid>() is provided as an alias to this method.
 
+=item authorization()
+
+Authorization code for this transaction.
+
+=item avs_response() / cvv2_response()
+
+Results of the AVS and CVV2 checks.  See the InternetSecure documentation for
+the list of possible values.
+
 =item date()
 
 Date and time of the transaction.  Format is C<YYYY/MM/DD hh:mm:ss>.
@@ -489,7 +512,7 @@ Total amount billed for this order, including taxes.
 =item cardholder()
 
 Cardholder's name.  This is currently a mere copy of the B<name> field passed
-to B<submit()>.
+to B<submit>().
 
 =item card_type()
 
@@ -508,11 +531,6 @@ following:
 
 =back
 
-=item avs_response() / cvv2_response()
-
-Results of the AVS and CVV2 checks.  See the InternetSecure documentation for
-the list of possible values.
-
 =item products_raw()
 
 ...
@@ -525,7 +543,7 @@ the list of possible values.
 
 =head2 Products list syntax
 
-Optionally, the B<description> field of B<content()> can contain a reference
+Optionally, the B<description> field of B<content>() can contain a reference
 to an array of products, instead of a simple string.  Each element of this
 array represents a different product, and must be a reference to a hash with
 the following fields:
@@ -551,11 +569,11 @@ Description of this product
 =item taxes
 
 Taxes that should be automatically added to this product.  If specified, this
-overrides the B<taxes> field passed to B<content()>.
+overrides the B<taxes> field passed to B<content>().
 
 =back
 
-When using a products list, the B<amount> field passed to B<content()> should
+When using a products list, the B<amount> field passed to B<content>() should
 be left undefined.
 
 
@@ -563,12 +581,12 @@ be left undefined.
 
 Since communication to/from InternetSecure is encoded with UTF-8, all Unicode
 characters are theoretically available when submitting information via
-B<submit()>.  (Further restrictions may be imposed by InternetSecure itself.)
+B<submit>().  (Further restrictions may be imposed by InternetSecure itself.)
 
-When using non-ASCII characters, all data provided to B<submit()> should either
+When using non-ASCII characters, all data provided to B<submit>() should either
 be in the current native encoding (typically latin-1, unless it was modified
 via the C<encoding> pragma), or be decoded via the C<Encode> module.
-Conversely, all data returned after calling B<submit()> will be automatically
+Conversely, all data returned after calling B<submit>() will be automatically
 decoded.