X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=OpenECHO.pm;h=7fca7b0f2bf0c4a800f6ba2f7f9c824e43f28908;hb=e91f3ad5f7416debd2f32917e0b6cb96e5616565;hp=a9eed3ad99c511e9db50004d0f1252851b28c51a;hpb=32073e637db2c5c91b726072f891c36ebd8b3d10;p=Business-OnlinePayment-OpenECHO.git diff --git a/OpenECHO.pm b/OpenECHO.pm index a9eed3a..7fca7b0 100644 --- a/OpenECHO.pm +++ b/OpenECHO.pm @@ -28,10 +28,10 @@ # -------- # + v0.1 08/26/2004 Business::OnlinePayment implementation # + v0.2 09/13/2004 -# + v0.3 unreleased +# + v0.3 03/25/2006 # # Copyright (C) 2002 Electric Pulp. -# Copyright (C) 2004 Ivan Kohler +# Copyright (C) 2004-2006 Ivan Kohler # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -127,7 +127,7 @@ sub map_fields { #'void' => 'VOID', ); } - } elsif ( $content{'type'} =~ /^check$/i ) { + } elsif ( $content{'type'} =~ /^e?check$/i ) { %map = ( 'normal authorization' => 'DD', 'authorization only' => 'DV', 'credit' => 'DC', @@ -223,7 +223,7 @@ sub submit { license_num => 'ec_id_number', license_state => 'ec_id_state', #license_dob => - payee => 'ec_payee', + #get from new() args instead# payee => 'ec_payee', check_number => 'ec_serial_number', #recurring_billing => 'cnp_recurring', @@ -235,7 +235,7 @@ sub submit { #XXX counter field shouldn't be just a random integer (but it does need a #default this way i guess... $self->{_content}{counter} = int(rand(2**31)); - + if ( $self->transaction_type =~ /^[EA][VS]$/ ) { #ccexp_month & ccexp_year $self->{_content}{'expiration'} =~ /^(\d+)\D+\d*(\d{2})$/ @@ -246,6 +246,19 @@ sub submit { $self->{_content}{ccexp_year} = $year; } + if ( $self->transaction_type =~ /^D[DVCH]$/ ) { #echeck + + #check number kludge... "periodic bill payments" don't have check #s! + #$self->{_content}{ec_serial_number} = 'RECURRIN' + $self->{_content}{ec_serial_number} = '00000000' + if ! length($self->{_content}{ec_serial_number}) + && $self->{_content}{ec_payment_type} =~ /^(PPD)?$/i; + + ( $self->{_content}{ec_payee} = $self->payee ) + or croak "'payee' option required when instantiating new ". + "Business::OnlinePayment::OpenECHO object\n"; + } + $self->{_content}{cnp_recurring} = 'Y' if exists($self->{_content}{recurring_billing}) && $self->{_content}{recurring_billing} =~ /^y/i; @@ -655,8 +668,7 @@ Content required: type, login, password, action, amount, first_name, last_name, =head2 Check -Not yet implemented... -#Content required: type, login, password, action, amount, first_name, last_name, account_number, routing_code, bank_name. +Content required: type, login, password, action, amount, first_name, last_name, account_number, routing_code, bank_name. (...more) =head1 PREREQUISITES