$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 => '',
phone => '(555) 555-1212',
email => 'fbriere@fbriere.net',
- description => 'Online purchase',
amount => 49.95,
currency => 'CAD',
taxes => 'GST PST',
+ description => 'Test transaction',
);
$txn->submit;
=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
=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
=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
=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)
=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()
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>.
=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()
=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()
...
=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:
=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.
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.