Revision history for Perl extension Business::OnlinePayment::eSelectPlus
+0.07 Wed Aug 21 11:53:36 PDT 2013
+ - eSelectPlus cust_id: Use customer number instead of invoice number
+ - eSelectPlus order_id: Append "-invoice_num" per documentation
+
0.06 Mon Nov 12 14:28:16 PST 2012
- Fix voids even if an amount is passed (now ignored)
- Add missing t/void_{ca,us}.t tests
t/capture_us.t
t/void_us.t
t/void_ca.t
+t/order_num_ca.t
use vars qw($VERSION $DEBUG @ISA);
@ISA = qw(Business::OnlinePayment::HTTPS);
-$VERSION = '0.06';
+$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
$self->generate_order_id;
+ $self->{_content}{order_id} .= '-'. ($invoice_number || 0);
+
$self->{_content}{amount} = sprintf('%.2f', $self->{_content}{amount} );
} elsif ( $action =~ /^(completion|purchasecorrection|refund)$/ ) {
--- /dev/null
+BEGIN { $| = 1; print "1..1\n"; }
+
+eval "use Net::SSLeay;";
+if ( $@ ) {
+ print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit;
+}
+
+use Business::OnlinePayment;
+
+my $tx = new Business::OnlinePayment("eSelectPlus");
+
+#$Business::OnlinePayment::HTTPS::DEBUG = 1;
+#$Business::OnlinePayment::HTTPS::DEBUG = 1;
+$Business::OnlinePayment::eSelectPlus::DEBUG = 1;
+$Business::OnlinePayment::eSelectPlus::DEBUG = 1;
+
+$tx->content(
+ type => 'VISA',
+ login => 'moot',
+ password => 'moot',
+ action => 'Normal Authorization',
+ amount => '0.80',
+ currency => 'CAD',
+ card_number => '4242424242424242',
+ expiration => '01/12',
+ invoice_number => '540',
+);
+$tx->test_transaction(1); # test, dont really charge
+$tx->submit();
+ warn $tx->order_number."\n";
+
+if ( $tx->order_number =~ /-540$/ ) {
+ print "ok 1\n";
+} else {
+ warn $tx->order_number."\n";
+ print "not ok 1\n";
+}
+