NAME
Business::OnlinePayment::MerchantCommerce
SYNOPSIS
use Business::OnlinePayment;
my $transaction = new Business::OnlinePayment("MerchantCommerce");
$transaction->content(type => 'VISA',
login => '12345',
action => 'Normal Authorization',
amount => '5.00',
name => 'Tim McIntyre',
card_number => '5454545454545454',
exp_date => '12/2005');
$transacton->submit;
if($transaction->is_success) {
print "Success! Authorization Code: " . $transaction->authorization."\n";
} else {
print "Failure!: " . $transaction->error_message."\n";
}
DESCRIPTION
Merchant Commerce backend for Business::OnlinePayment. Please see Buisness::OnlinePayment for details.
Supported transaction types
Visa, MasterCard, American Express, Discover, Check
Required content for all transactions
login or acctid
These keys are synonamous
name
Alternatively you may use ccname for credit cards or ckname for checking withhdrawls.
action or type
One of authorization only, post authorization, check, ns_quicksale_check, normal authorization, ns_quicksale_cc, visa, mastercard, american express, or discover.
If set to authorization only MerchantCommerce will create a method(authrefcode) that will return an authrefcode for use in a post authorization.
If set to post authorization then authrefcode becomes a required field.
Use check or ns_quicksale_check for checking withdrawls.
The last six possibilities, normal authorization, ns_quicksale_cc, visa, mastercard, american express, and discover are all synonymous as far as MerchantCommerce is concerned.
If for some reason type and action are both set action will take precidence.
amount
Additionally required content for credit cards
card_number or ccnum:
These keys are synonamous
exp_date(mm/yyyy) or expmon(mm) and expyear(yyyy)
Optional content for credit cards
authrefcode
A reference code returned from a previous authorization only action. Only used with an action of post authorization.
Additionally required content for checks
type or action
Must be set to check, or ns_quicksale_check.
account_number or ckacct
routing_code or ckaba
Optional content for all transactons
address or ci_billaddr1
ci_billaddr2
city or ci_billcity
state or ci_billstate
zip or ci_billzip
country or ci_billcountry
description or ci_memo
subid
usepost
ci_companyname
ci_phone
ci_email
ci_dlnum
ci_ssnum
ci_shipaddr1
ci_shipaddr2
ci_shipcity
ci_shipstate
ci_shipzip
ci_shipcountry
emailto
emailfrom
emailsubject
emailtext
recur_create
recur_billingcycle
recur_billingmax
recur_start
recur_amount
Content not supported
password
bank_name
invoice_number
customer_id
require_avs
fax
action => credit
Methods
orderid
Can be called on any successful authorization.
authrefcode
Can be called on successful authorization only. Returns a reference code to be used in a later post authorization.
historyid
Can be called on success or failure. Usually but not always returned for unknown reasons. Seems to be of dubious usefullness but is provided just in case.
conversation
Returns a string showing the (almost) entire transaction. The first lines are the content that was posted in the traditional hash name => value format. After that is the server status line hopefully HTTP/1.1 200 OK. Next come the response headers in their traditional NAME: value format. Last but certainly not least is content of the response in the format of name=value. The first line of the content part of the string should also contain the string <html><body><plaintext>.
post_data
Returns a reference to a hash of the data that was posted to the server.
server_response
Returns a string showing the content of the response from the server. These will be in the form of name=value deliminated by \n.
response_headers
Returns a reference to a hash containing the response headers.
server_status
Returns the server status from the server response.
accepted
On a successful transaction this method returns the same value as the authorization method. This would also mean that is_success is true.
declined
On a failed transaction this method will return the same value as error_message. This would also mean that is_success is false.
error
On a failed transaction this method will return the same value as error_message. This would also mean that is_success is false.
Please Note
If any of the following three methods are ever set it essentially means that you have found a bug in this module. If you should decide to use them and you find that they are set please email me the string returned from the conversation method so that I can determine the problem. Better yet fix it and send me that. If you decide not to use them you should be fine.
unknown_result_code
Merchant Commerce has three known possible result codes, accepted, declined, and error. If for some reason a different result code is returned this method will be set to true and error_message will contain the same value as the conversation method described above. The result code should be contained on the first line of the content of the response. That is the one containing <html><body><plaintext>.
unknown_response_format
If the content part of the server response does not contain the <html><body><plaintext> as part of its first line this method will be set to true and error_message will contain the same value as the conversation method described above.
unknown_methods
The Merchant Commerce server returns the content of its response as name=value pairs. This MerchantCommerce module parses the content and creates a method named name and sets it's value to value. The methods orderid, refcode, and historyid are known content responses. This method returns a reference to an array of method names that are unknown. You could then call these methods to get the corresponding value.
AUTHOR
Tim McIntyre, tmac@transport.com
DISCLAIMER
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
SEE ALSO
perl(1) Business::OnlinePayment