use vars qw($VERSION $DEBUG @ISA);
@ISA = qw(Business::OnlinePayment::HTTPS);
-$VERSION = '0.05';
+$VERSION = '0.07';
$DEBUG = 0;
sub set_defaults {
}
}
+ my %cust_id = ( 'invoice_number' => 'cust_id' );
+
+ my $invoice_number = $self->{_content}{invoice_number};
+
# BOP field => eSelectPlus field
#$self->map_fields();
$self->remap_fields(
# => 'expdate',
'amount' => 'amount',
- invoice_number => 'cust_id',
- #customer_id => 'cust_id',
+ customer_id => 'cust_id',
order_number => 'order_id', # must be unique number
authorization => 'txn_number' # reference to previous trans
if ( $action =~ /^(purchase|preauth|ind_refund)$/ ) {
- $self->required_fields(
- qw( login password amount card_number expiration )
- );
+ $self->required_fields(qw(
+ login password amount card_number expiration
+ ));
#cardexpiremonth & cardexpireyear
$self->{_content}{'expiration'} =~ /^(\d+)\D+\d*(\d{2})$/
$self->generate_order_id;
- $self->{_content}{amount} = sprintf('%.2f', $self->{_content}{amount} );
+ $self->{_content}{order_id} .= '-'. ($invoice_number || 0);
- } elsif ( $action eq 'completion' || $action eq 'purchasecorrection' ) {
-
- $self->{_content}{comp_amount} = delete $self->{_content}{amount}
- if $action eq 'completion';
+ $self->{_content}{amount} = sprintf('%.2f', $self->{_content}{amount} );
- $self->required_fields( qw( login password order_number authorization ) );
+ } elsif ( $action =~ /^(completion|purchasecorrection|refund)$/ ) {
- } elsif ( $action eq 'refund' ) {
+ $self->required_fields(qw(
+ login password order_number authorization
+ ));
- $self->required_fields(
- qw( login password order_number authorization )
- );
+ if ( $action eq 'completion' ) {
+ $self->{_content}{comp_amount} = delete $self->{_content}{amount};
+ } elsif ( $action eq 'purchasecorrection' ) {
+ delete $self->{_content}{amount};
+ #} elsif ( $action eq 'refund' ) {
+ }
}