1 ##############################################################################
\r
2 # Business::OnlinePayment::OpenECHO
\r
4 # Credit card transactions via SSL to
\r
5 # Electronic Clearing House (ECHO) Systems
\r
7 # Refer to ECHO's documentation for more info
\r
8 # http://www.openecho.com/echo_gateway_guide.html
\r
11 # Michael Lehmkuhl <michael@electricpulp.com>
\r
14 # Jim Darden <jdarden@echo-inc.com>
\r
15 # Dan Browning <db@kavod.com>
\r
17 # BUSINESS::ONLINEPAYMENT IMPLEMENTATION
\r
18 # Ivan Kohler <ivan-openecho@420.am>
\r
21 # + v1.2 08/17/2002 Corrected problem with certain string comparisons.
\r
22 # + v1.3 08/23/2002 Converted Interchange GlobalSub to Vend::Payment module.
\r
23 # + v1.3.1 11/12/2002 Updated the OpenECHO_example.perl test script.
\r
24 # + v1.4 11/18/2002 Corrected a problem with Submit method when using LWP.
\r
25 # + v1.5 03/29/2003 Updated for additional status and avs_result codes.
\r
26 # + v1.6 08/26/2003 Cleaned up code (salim qadeer sqadeer@echo-inc.com)
\r
27 # + v1.6.2 09/23/2003 Added DH transaction type (salim qadeer sqadeer@echo-inc.com)
\r
29 # + v0.1 08/26/2004 Business::OnlinePayment implementation
\r
31 # Copyright (C) 2002 Electric Pulp. <info@electricpulp.com>
\r
32 # Copyright (C) 2004 Ivan Kohler
\r
34 # This program is free software; you can redistribute it and/or modify
\r
35 # it under the terms of the GNU General Public License as published by
\r
36 # the Free Software Foundation; either version 2 of the License, or
\r
37 # (at your option) any later version.
\r
39 # This program is distributed in the hope that it will be useful,
\r
40 # but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
41 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
42 # GNU General Public License for more details.
\r
44 # You should have received a copy of the GNU General Public
\r
45 # License along with this program; if not, write to the Free
\r
46 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
\r
47 # MA 02111-1307 USA.
\r
49 ################################################################################
\r
51 package Business::OnlinePayment::OpenECHO;
\r
55 use Business::OnlinePayment 3;
\r
56 use Business::OnlinePayment::HTTPS;
\r
57 use vars qw($VERSION @ISA);
\r
59 @ISA = qw(Business::OnlinePayment::HTTPS);
\r
65 $self->server('wwws.echo-inc.com');
\r
67 $self->path('/scripts/INR200.EXE');
\r
69 $self->build_subs(qw(
\r
70 order_number avs_code
\r
73 # md5 cvv2_response cavv_response
\r
77 #map_fileds originally from AuthorizeNet.pm
\r
82 ##AD (Address Verification) - 0.18 cents
\r
83 #AS (Authorization) - 0.18 cents
\r
84 #AV (Authorization with Address Verification) - 0.18 cents
\r
85 #CR (Credit) - 0.18 cents + 0.12 cents (discount fee returned to merchant)
\r
86 #DS (Deposit) - 0.18 cents + 0.12 cents
\r
87 #ES (Authorization and Deposit) - 0.18 cents + 0.12 cents + an extra 0.17%
\r
88 #EV (Authorization and Deposit with Address Verification) - 0.18 cents + 0.12 cents
\r
89 ##CK (System check) - 0.18 cents
\r
90 #DV (Electronic Check Verification) - check your contract
\r
91 #DD (Electronic Check Debit with Verification) - check your contract
\r
92 #DH (Electronic Check Debit ACH Only) - check your contract
\r
93 #DC (Electronic Check Credit) - check your contract
\r
95 my %content = $self->content();
\r
97 my $avs = $self->require_avs;
\r
98 $avs = 1 unless defined($avs) && length($avs); #default AVS on unless explicitly turned off
\r
102 $content{'type'} =~ /^(cc|visa|mastercard|american express|discover)$/i
\r
105 %map = ( 'normal authorization' => 'EV',
\r
106 'authorization only' => 'AV',
\r
108 'post authorization' => 'DS',
\r
112 %map = ( 'normal authorization' => 'ES',
\r
113 'authorization only' => 'AS',
\r
115 'post authorization' => 'DS',
\r
119 } elsif ( $content{'type'} =~ /^check$/i ) {
\r
120 %map = ( 'normal authorization' => 'DD',
\r
121 'authorization only' => 'DV',
\r
123 'post authorization' => 'DH',
\r
127 croak 'Unknown type: '. $content{'type'};
\r
130 $content{'type'} = $map{lc($content{'action'})}
\r
131 or croak 'Unknown action: '. $content{'action'};
\r
133 $self->transaction_type($content{'type'});
\r
135 # stuff it back into %content
\r
136 $self->content(%content);
\r
143 $self->map_fields();
\r
144 $self->remap_fields(
\r
146 type => 'transaction_type',
\r
148 login => 'merchant_echo_id',
\r
149 password => 'merchant_pin',
\r
150 # => 'isp_echo_id',
\r
152 #transaction_key =>
\r
153 authorization => 'authorization', # auth_code => 'authorization',
\r
154 customer_ip => 'billing_ip_address',
\r
155 # 'billing_prefix',
\r
156 name => 'billing_name',
\r
157 first_name => 'billing_first_name',
\r
158 last_name => 'billing_last_name',
\r
159 company => 'billing_company_name',
\r
160 address => 'billing_address_1',
\r
161 # => 'billing_address_2',
\r
162 city => 'billing_city',
\r
163 state => 'billing_state',
\r
164 zip => 'billing_zip',
\r
165 country => 'billing_country',
\r
166 phone => 'billing_phone',
\r
167 fax => 'billing_fax',
\r
168 email => 'billing_email',
\r
169 card_number => 'cc_number',
\r
170 # => 'ccexp_month',
\r
177 'amount' => 'grand_total',
\r
178 # => 'merchant_email',
\r
180 customer_id => 'merchant_trace_nbr',
\r
181 # => 'original_amount',
\r
182 # => 'original_trandate_mm',
\r
183 # => 'original_trandate_dd',
\r
184 # => 'original_trandate_yyyy',
\r
185 # => 'original_reference',
\r
186 order_number => 'order_number',
\r
187 # => 'shipping_flag',
\r
193 #ship_first_name =>
\r
202 cvv2 => 'cnp_security',
\r
205 #account_name => 'ec_last_name' & 'ec_first_name',
\r
206 account_number => 'ec_account',
\r
208 bank_name => 'ec_bank_name',
\r
209 routing_code => 'ec_rt',
\r
212 license_num => 'ec_id_number',
\r
213 license_state => 'ec_id_state',
\r
216 #recurring_billing => 'cnp_recurring',
\r
219 #XXX hosted order_type?
\r
220 $self->{_content}{order_type} = 'S';
\r
222 #XXX counter field shouldn't be just a random integer (but it does need a
\r
223 #default this way i guess...
\r
224 $self->{_content}{counter} = int(rand(2**31));
\r
226 #ccexp_month & ccexp_year
\r
227 $self->{_content}{'expiration'} =~ /^(\d+)\D+\d*(\d{2})$/
\r
228 or croak "unparsable expiration ". $self->{_content}{expiration};
\r
229 my( $month, $year ) = ( $1, $2 );
\r
230 $month = '0'. $month if $month =~ /^\d$/;
\r
231 $self->{_content}{ccexp_month} = $month;
\r
232 $self->{_content}{ccexp_year} = $year;
\r
234 $self->{_content}{cnp_recurring} = 'Y'
\r
235 if exists($self->{_content}{recurring_billing})
\r
236 && $self->{_content}{recurring_billing} =~ /^y/i;
\r
238 #XXX echeck use customer_org and account_type to generate ec_account_type
\r
240 #XXX set required fields
\r
241 # https://wwws.echo-inc.com/ISPGuide-Fields2.asp
\r
242 $self->required_fields();
\r
244 my( $page, $response, %reply_headers) =
\r
245 $self->https_get( $self->get_fields( $self->fields ) );
\r
247 #XXX check $response and die if not 200?
\r
249 my $echotype1 = $self->GetEchoReturn($page, 1);
\r
250 my $echotype2 = $self->GetEchoReturn($page, 2);
\r
251 my $echotype3 = $self->GetEchoReturn($page, 3);
\r
252 my $openecho = $self->GetEchoReturn($page, 'OPEN');
\r
260 #md5 cvv2_response cavv_response ...?
\r
262 # Get all the metadata.
\r
263 $self->server_response($page);
\r
264 $self->authorization( $self->GetEchoProp($echotype3, 'auth_code') );
\r
265 $self->order_number( $self->GetEchoProp($echotype3, 'order_number') );
\r
268 #$self->reference( $this->GetEchoProp($echotype3, "echo_reference");
\r
270 $self->result_code( $self->GetEchoProp($echotype3, 'status') );
\r
271 $self->avs_code( $self->GetEchoProp($echotype3, 'avs_result') );
\r
274 #$self->security_result( $self->GetEchoProp($echotype3, 'security_result');
\r
275 #$self->mac( $self->GetEchoProp($echotype3, 'mac') );
\r
276 #$self->decline_code( $self->GetEchoProp($echotype3, 'decline_code') );
\r
278 if ($self->result_code =~ /^[GR]$/ ) { #success
\r
280 #XXX special case for AVS-only transactions we don't handle yet
\r
281 #if ($self->transaction_type eq "AD") {
\r
282 # if ($self->avs_code =~ /^[XYDM]$/ ) {
\r
283 # $self->is_success(1);
\r
285 # $self->is_success(0);
\r
288 $self->is_success(1);
\r
292 $self->is_success(0);
\r
294 my $decline_code = $self->GetEchoProp($echotype3, 'decline_code');
\r
295 my $error_message = $self->error($decline_code);
\r
296 if ( $decline_code =~ /^(00)?30$/ ) {
\r
297 $echotype2 =~ s/<br>/\n/ig;
\r
298 $echotype2 =~ s'</?(b|pre)>''ig;
\r
299 $error_message .= ": $echotype2";
\r
301 $self->error_message( $error_message );
\r
305 $self->is_success(0) if $page eq '';
\r
326 billing_company_name
\r
343 if ($self->transaction_type =~ /^D[DCVH]$/) {
\r
380 original_trandate_mm
\r
381 original_trandate_dd
\r
382 original_trandate_yyyy
\r
398 shipper_tracking_nbr
\r
409 my( $self, $raw, $prop ) = @_;
\r
413 ($data) = $raw =~ m"<$prop>(.*?)</$prop>"gsi;
\r
414 $data =~ s/<.*?>/ /gs;
\r
419 # Get's a given Echo return type and strips all HTML style tags from it.
\r
420 # It also strips any new line characters from the returned string.
\r
422 # This function based on Ben Reser's <breser@vecdev.com> Echo::Process
\r
424 sub GetEchoReturn {
\r
425 my( $self, $page, $type ) = @_;
\r
429 if ($type eq 'OPEN') {
\r
430 ($data) = $page =~ m"<OPENECHO>(.*?)</OPENECHO>"gsi;
\r
433 ($data) = $page =~ m"<ECHOTYPE$type>(.*?)</ECHOTYPE$type>"gsi;
\r
435 # $data =~ s"<.*?>" "g;
\r
437 #unless (length($data)) {
\r
438 # warn "$self $page $type";
\r
445 use vars qw(%error);
\r
447 "01" => [ "Refer to card issuer", "The merchant must call the issuer before the transaction can be approved." ],
\r
448 "02" => [ "Refer to card issuer, special condition", "The merchant must call the issuer before the transaction can be approved." ],
\r
449 "03" => [ "Invalid merchant number", "The merchant ID is not valid." ],
\r
450 "04" => [ "Pick-up card. Capture for reward", "The card is listed on the Warning Bulletin. Merchant may receive reward money by capturing the card." ],
\r
451 "05" => [ "Do not honor. The transaction was declined by the issuer without definition or reason", "The transaction was declined without explanation by the card issuer." ],
\r
452 "06" => [ "Error", "The card issuer returned an error without further explanation." ],
\r
453 "07" => [ "Pick-up card, special condition", "The card is listed on the Warning Bulletin. Merchant may receive reward money by capturing the card." ],
\r
454 "08" => [ "Honor with identification", "Honor with identification." ],
\r
455 "09" => [ "Request in progress", "Request in progress." ],
\r
456 "10" => [ "Approved for partial amount", "Approved for partial amount." ],
\r
457 "11" => [ "Approved, VIP", "Approved, VIP program." ],
\r
458 "12" => [ "Invalid transaction", "The requested transaction is not supported or is not valid for the card number presented." ],
\r
459 "13" => [ "Invalid amount", "The amount exceeds the limits established by the issuer for this type of transaction." ],
\r
460 "14" => [ "Invalid card #", "The issuer indicates that this card is not valid." ],
\r
461 "15" => [ "No such issuer", "The card issuer number is not valid." ],
\r
462 "16" => [ "Approved, update track 3", "Approved, update track 3." ],
\r
463 "17" => [ "Customer cancellation", "Customer cancellation." ],
\r
464 "18" => [ "Customer dispute", "Customer dispute." ],
\r
465 "19" => [ "Re enter transaction", "Customer should resubmit transaction." ],
\r
466 "20" => [ "Invalid response", "Invalid response." ],
\r
467 "21" => [ "No action taken", "No action taken. The issuer declined with no other explanation." ],
\r
468 "22" => [ "Suspected malfunction", "Suspected malfunction." ],
\r
469 "23" => [ "Unacceptable transaction fee", "Unacceptable transaction fee." ],
\r
470 "24" => [ "File update not supported", "File update not supported." ],
\r
471 "25" => [ "Unable to locate record", "Unable to locate record." ],
\r
472 "26" => [ "Duplicate record", "Duplicate record." ],
\r
473 "27" => [ "File update edit error", "File update edit error." ],
\r
474 "28" => [ "File update file locked", "File update file locked." ],
\r
475 "30" => [ "Format error, call ECHO", "The host reported that the transaction was not formatted properly." ],
\r
476 "31" => [ "Bank not supported", "Bank not supported by switch." ],
\r
477 "32" => [ "Completed partially", "Completed partially." ],
\r
478 "33" => [ "Expired card, pick-up", "The card is expired. Merchant may receive reward money by capturing the card." ],
\r
479 "34" => [ "Issuer suspects fraud, pick-up card", "The card issuer suspects fraud. Merchant may receive reward money by capturing the card." ],
\r
480 "35" => [ "Contact acquirer, pick-up", "Contact card issuer. Merchant may receive reward money by capturing the card." ],
\r
481 "36" => [ "Restricted card, pick-up", "The card is restricted by the issuer. Merchant may receive reward money by capturing the card." ],
\r
482 "37" => [ "Call ECHO security, pick-up", "Contact ECHO security. Merchant may receive reward money by capturing the card." ],
\r
483 "38" => [ "PIN tries exceeded, pick-up", "PIN attempts exceed issuer limits. Merchant may receive reward money by capturing the card." ],
\r
484 "39" => [ "No credit account", "No credit account." ],
\r
485 "40" => [ "Function not supported", "Requested function not supported." ],
\r
486 "41" => [ "Lost Card, capture for reward", "The card has been reported lost." ],
\r
487 "42" => [ "No universal account", "No universal account." ],
\r
488 "43" => [ "Stolen Card, capture for reward", "The card has been reported stolen." ],
\r
489 "44" => [ "No investment account", "No investment account." ],
\r
490 "51" => [ "Not sufficient funds", "The credit limit for this account has been exceeded." ],
\r
491 "54" => [ "Expired card", "The card is expired." ],
\r
492 "55" => [ "Incorrect PIN", "The cardholder PIN is incorrect." ],
\r
493 "56" => [ "No card record", "No card record." ],
\r
494 "57" => [ "Transaction not permitted to cardholder", "The card is not allowed the type of transaction requested." ],
\r
495 "58" => [ "Transaction not permitted on terminal", "The Merchant is not allowed this type of transaction." ],
\r
496 "59" => [ "Suspected fraud", "Suspected fraud." ],
\r
497 "60" => [ "Contact ECHO", "Contact ECHO." ],
\r
498 "61" => [ "Exceeds withdrawal limit", "The amount exceeds the allowed daily maximum." ],
\r
499 "62" => [ "Restricted card", "The card has been restricted." ],
\r
500 "63" => [ "Security violation.", "The card has been restricted." ],
\r
501 "64" => [ "Original amount incorrect", "Original amount incorrect." ],
\r
502 "65" => [ "Exceeds withdrawal frequency", "The allowable number of daily transactions has been exceeded." ],
\r
503 "66" => [ "Call acquirer security, call ECHO", "Call acquirer security, call ECHO." ],
\r
504 "68" => [ "Response received too late", "Response received too late." ],
\r
505 "75" => [ "PIN tries exceeded", "The allowed number of PIN retries has been exceeded." ],
\r
506 "76" => [ "Invalid \"to\" account", "The debit account does not exist." ],
\r
507 "77" => [ "Invalid \"from\" account", "The credit account does not exist." ],
\r
508 "78" => [ "Invalid account specified (general)", "The associated card number account is invalid or does not exist." ],
\r
509 "79" => [ "Already reversed", "Already reversed." ],
\r
510 "84" => [ "Invalid authorization life cycle", "The authorization life cycle is invalid." ],
\r
511 "86" => [ "Cannot verify PIN", "Cannot verify PIN." ],
\r
512 "87" => [ "Network Unavailable", "Network Unavailable." ],
\r
513 "89" => [ "Ineligible to receive financial position information", "Ineligible to receive financial position information." ],
\r
514 "90" => [ "Cut-off in progress", "Cut-off in progress." ],
\r
515 "91" => [ "Issuer or switch inoperative", "The bank is not available to authorize this transaction." ],
\r
516 "92" => [ "Routing error", "The transaction cannot be routed to the authorizing agency." ],
\r
517 "93" => [ "Violation of law", "Violation of law." ],
\r
518 "94" => [ "Duplicate transaction", "Duplicate transaction." ],
\r
519 "95" => [ "Reconcile error", "Reconcile error." ],
\r
520 "96" => [ "System malfunction", "A system error has occurred." ],
\r
521 "98" => [ "Exceeds cash limit", "Exceeds cash limit." ],
\r
522 "1000" => [ "Unrecoverable error.", "An unrecoverable error has occurred in the ECHONLINE processing." ],
\r
523 "1001" => [ "Account closed", "The merchant account has been closed." ],
\r
524 "1002" => [ "System closed", "Services for this system are not available. (Not used by ECHONLINE)" ],
\r
525 "1003" => [ "E-Mail Down", "The e-mail function is not available. (Not used by ECHONLINE)" ],
\r
526 "1012" => [ "Invalid trans code", "The host computer received an invalid transaction code." ],
\r
527 "1013" => [ "Invalid term id", "The ECHO-ID is invalid." ],
\r
528 "1015" => [ "Invalid card number", "The credit card number that was sent to the host computer was invalid" ],
\r
529 "1016" => [ "Invalid expiry date", "The card has expired or the expiration date was invalid." ],
\r
530 "1017" => [ "Invalid amount", "The dollar amount was less than 1.00 or greater than the maximum allowed for this card." ],
\r
531 "1019" => [ "Invalid state", "The state code was invalid. (Not used by ECHONLINE)" ],
\r
532 "1021" => [ "Invalid service", "The merchant or card holder is not allowed to perform that kind of transaction" ],
\r
533 "1024" => [ "Invalid auth code", "The authorization number presented with this transaction is incorrect. (deposit transactions only)" ],
\r
534 "1025" => [ "Invalid reference number", "The reference number presented with this transaction is incorrect or is not numeric." ],
\r
535 "1029" => [ "Invalid contract number", "The contract number presented with this transaction is incorrect or is not numeric. (Not used by ECHONLINE)" ],
\r
536 "1030" => [ "Invalid inventory data", "The inventory data presented with this transaction is not ASCII \"printable\". (Not used by ECHONLINE)" ],
\r
537 "1508" => [ " ", "Invalid or missing order_type." ],
\r
538 "1509" => [ " ", "The merchant is not approved to submit this order_type." ],
\r
539 "1510" => [ " ", "The merchant is not approved to submit this transaction_type." ],
\r
540 #"1511" => [ " ", "Duplicate transaction attempt (see counterin Part I of this Specification</EM>)." ],
\r
541 "1511" => [ " ", "Duplicate transaction attempt (set counter field?)." ],
\r
542 "1599" => [ " ", "An system error occurred while validating the transaction input." ],
\r
543 "1801" => [ "Return Code \"A\"", "Address matches; ZIP does not match." ],
\r
544 "1802" => [ "Return Code \"W\"", "9-digit ZIP matches; Address does not match." ],
\r
545 "1803" => [ "Return Code \"Z\"", "5-digit ZIP matches; Address does not match." ],
\r
546 "1804" => [ "Return Codes \"U\"", "Issuer unavailable; cannot verify." ],
\r
547 "1805" => [ "Return Code \"R\"", "Retry; system is currently unable to process." ],
\r
548 "1806" => [ "Return Code \"S\" or \"G\"", "Issuer does not support AVS." ],
\r
549 "1807" => [ "Return Code \"N\"", "Nothing matches." ],
\r
550 "1808" => [ "Return Code \"E\"", "Invalid AVS only response." ],
\r
551 "1809" => [ "Return Code \"B\"", "Street address match. Postal code not verified because of incompatible formats." ],
\r
552 "1810" => [ "Return Code \"C\"", "Street address and Postal code not verified because of incompatible formats." ],
\r
553 "1811" => [ "Return Code \"D\"", "Street address match and Postal code match." ],
\r
554 "1812" => [ "Return Code \"I\"", "Address information not verified for international transaction." ],
\r
555 "1813" => [ "Return Code \"M\"", "Street address match and Postal code match." ],
\r
556 "1814" => [ "Return Code \"P\"", "Postal code match. Street address not verified because of incompatible formats." ],
\r
557 "1897" => [ "invalid response", "The host returned an invalid response." ],
\r
558 "1898" => [ "disconnect", "The host unexpectedly disconnected." ],
\r
559 "1899" => [ "timeout", "Timeout waiting for host response." ],
\r
560 "2071" => [ "Call VISA", "An authorization number from the VISA Voice Center is required to approve this transaction." ],
\r
561 "2072" => [ "Call Master Card", "An authorization number from the Master Card Voice Center is required to approve this transaction." ],
\r
562 "2073" => [ "Call Carte Blanche", "An authorization number from the Carte Blanche Voice Center is required to approve this transaction." ],
\r
563 "2074" => [ "Call Diners Club", "An authorization number from the Diners' Club Voice Center is required to approve this transaction." ],
\r
564 "2075" => [ "Call AMEX", "An authorization number from the American Express Voice Center is required to approve this transaction." ],
\r
565 "2076" => [ "Call Discover", "An authorization number from the Discover Voice Center is required to approve this transaction." ],
\r
566 "2078" => [ "Call ECHO", "The merchant must call ECHOCustomer Support for approval.or because there is a problem with the merchant's account." ],
\r
567 "2079" => [ "Call XpresscheX", "The merchant must call ECHOCustomer Support for approval.or because there is a problem with the merchant's account." ],
\r
568 "3001" => [ "No ACK on Resp", "The host did not receive an ACK from the terminal after sending the transaction response." ],
\r
569 "3002" => [ "POS NAK'd 3 Times", "The host disconnected after the terminal replied 3 times to the host response with a NAK." ],
\r
570 "3003" => [ "Drop on Wait", "The line dropped before the host could send a response to the terminal." ],
\r
571 "3005" => [ "Drop on Resp", "The line dropped while the host was sending the response to the terminal." ],
\r
572 "3007" => [ "Drop Before EOT", "The host received an ACK from the terminal but the line dropped before the host could send the EOT." ],
\r
573 "3011" => [ "No Resp to ENQ", "The line was up and carrier detected, but the terminal did not respond to the ENQ." ],
\r
574 "3012" => [ "Drop on Input", "The line disconnected while the host was receiving data from the terminal." ],
\r
575 "3013" => [ "FEP NAK'd 3 Times", "The host disconnected after receiving 3 transmissions with incorrect LRC from the terminal." ],
\r
576 "3014" => [ "No Resp to ENQ", "The line disconnected during input data wait in Multi-Trans Mode." ],
\r
577 "3015" => [ "Drop on Input", "The host encountered a full queue and discarded the input data." ],
\r
579 for ( 9000..9999 ) {
\r
580 $error{$_} = [ "Host Error", "The host encountered an internal error and was not able to process the transaction." ];
\r
583 my( $self, $num ) = @_;
\r
584 $num =~ s/^00(\d\d)$/$1/;
\r
585 return $num. ': '. $error{$num}[0]. ': '. $error{$num}[1];
\r
594 Business::OnlinePayment::OpenECHO - ECHO backend module for Business::OnlinePayment
\r
598 use Business::OnlinePayment;
\r
601 # One step transaction, the simple case.
\r
604 my $tx = new Business::OnlinePayment("OpenECHO");
\r
607 login => '1234684752',
\r
608 password => '43400210',
\r
609 action => 'Normal Authorization',
\r
610 description => 'Business::OnlinePayment test',
\r
612 invoice_number => '100100',
\r
613 customer_id => 'jsk',
\r
614 first_name => 'Tofu',
\r
615 last_name => 'Beast',
\r
616 address => '123 Anystreet',
\r
617 city => 'Anywhere',
\r
620 card_number => '4005550000000019',
\r
621 expiration => '08/06',
\r
622 cvv2 => '1234', #optional
\r
623 referer => 'http://valid.referer.url/',
\r
627 if($tx->is_success()) {
\r
628 print "Card processed successfully: ".$tx->authorization."\n";
\r
630 print "Card was rejected: ".$tx->error_message."\n";
\r
633 =head1 SUPPORTED TRANSACTION TYPES
\r
635 =head2 CC, Visa, MasterCard, American Express, Discover
\r
637 Content required: type, login, password, action, amount, first_name, last_name, card_number, expiration.
\r
641 Not yet implemented...
\r
642 #Content required: type, login, password, action, amount, first_name, last_name, account_number, routing_code, bank_name.
\r
644 =head1 PREREQUISITES
\r
649 Net::SSLeay _or_ ( Crypt::SSLeay and LWP )
\r
653 For detailed information see L<Business::OnlinePayment>.
\r
658 Michael Lehmkuhl <michael@electricpulp.com>
\r
661 Jim Darden <jdarden@echo-inc.com>
\r
662 Dan Browning <db@kavod.com>
\r
664 Business::OnlinePayment Implementation
\r
665 Ivan Kohler <ivan-openecho@420.am>
\r
669 perl(1). L<Business::OnlinePayment>.
\r