use warnings;
use strict;
#use vars qw( $DEBUG $me );
+use File::Slurp;
use MIME::Base64;
use Crypt::OpenSSL::RSA;
'Credit',
],
},
- 'token_support' => 'challenge/response',
+ 'token_support' => 1,
#need to figure out how to pass through for gateways that do... an option?
#'CC_void_requires_card' => 1,
};
#handle the challenge/response handshake
if ( $self->error_message eq '_challenge' ) { #XXX infinite loop protection?
- die "no private key available" unless $self->private_key;
+ my $private_key = $self->private_key
+ or die "no private key available";
+
+ $private_key = read_file($private_key)
+ if $private_key !~ /-----BEGIN/ && -r $private_key;
#decrypt the challenge with the private key
my $challenge = decode_base64($response{'card_challenge'});
use Business::OnlinePayment;
- my $tx = new Business::OnlinePayment( 'CardFortress',
- 'gateway' => 'ProcessingGateway',
- 'gateway_login' => 'gwlogin',
- 'gateway_password' => 'gwpass',
- #private_key not necessary
- );
+ my $tx = new Business::OnlinePayment(
+ 'CardFortress',
+ 'gateway' => 'ProcessingGateway',
+ 'gateway_login' => 'gwlogin',
+ 'gateway_password' => 'gwpass',
+ #private_key not necessary
+ );
$tx->content(
type => 'VISA',
# ... time slips by ...
- my $rx = new Business::OnlinePayment( 'CardFortress',
- 'gateway' => 'ProcessingGateway',
- 'gateway_login' => 'gwlogin',
- 'gateway_password' => 'gwpass',
- 'private_key' => $private_key_string,
- );
+ my $rx = new Business::OnlinePayment(
+ 'CardFortress',
+ 'gateway' => 'ProcessingGateway',
+ 'gateway_login' => 'gwlogin',
+ 'gateway_password' => 'gwpass',
+ 'private_key' => $private_key_string, #or filename
+ );
$rx->content(
type => 'VISA',