@ISA = qw(Business::OnlinePayment::HTTPS);
$DEBUG = 0;
-$VERSION = '0.06';
+$VERSION = '0.09';
+
+sub _info {
+ 'info_compat' => '0.01',
+ 'gateway_name' => 'vSecure Processing',
+ 'gateway_url' => 'http://www.vsecureprocessing.com/',
+ 'module_version' => $VERSION,
+ 'supported_types' => [qw( CC )],
+ 'token_support' => 0,
+ 'test_transaction' => 1,
+ 'partial_auth' => 1,
+ 'supported_actions' => [
+ 'Normal Authorization',
+ #'Authorization Only',
+ #'Post Authorization',
+ 'Reverse Authorization',
+ 'Void',
+ 'Credit',
+ ],
+}
# mapping out all possible endpoints
# but this version will only be building out "charge", "void", & "credit"
path => '/vsg2/processpayment',
process => 'ProcessPayment',
fields => [qw/
- Amount Trk1 Trk2 TypeOfSale Cf1 Cf2 Cf AccountNumber
+ Amount Trk1 Trk2 TypeOfSale Cf1 Cf2 Cf3 AccountNumber
ExpirationMonth ExpirationYear Cvv
CardHolderFirstName CardHolderLastName AvsZip AvsStreet
IndustryType ApplicationId Recurring
path => '/vsg2/processvoid',
process => 'ProcessVoid',
fields => [qw(
- Amount AccountNumber ExpirationMonth ExpirationYear ReferenceNumber
+ Amount Cf1 Cf2 Cf3 AccountNumber
+ ExpirationMonth ExpirationYear ReferenceNumber
TransactionDate IndustryType ApplicationId
)],
},
path => '/vsg2/processrefund',
process => 'ProcessRefund',
fields => [qw(
- Amount AccountNumber ExpirationMonth ExpirationYear ApplicationId
+ Amount Cf1 Cf2 Cf3 AccountNumber
+ ExpirationMonth ExpirationYear ApplicationId
)],
},
'authorize' => {
$self->build_subs(qw/
platform tid appid
action reference_number cvv2_response avs_code response_code
- risk_score txn_amount txn_date
+ risk_score txn_amount txn_date partial_auth_amount
/);
$DEBUG = exists($options{debug}) ? $options{debug} : $DEBUG;
Trk1 => ($content{'track1'}) ? $content{'track1'} : '',
Trk2 => ($content{'track2'}) ? $content{'track2'} : '',
TypeOfSale => ($content{'description'}) ? $content{'description'} : '',
- Cf1 => ($content{'UDField1'}) ? $content{'UDField1'} : '',
- Cf2 => ($content{'UDField2'}) ? $content{'UDField2'} : '',
+ Cf1 => ($content{'invoice_number'}) ? $content{'invoice_number'} : '',
+ Cf2 => ($content{'customer_id'}) ? $content{'customer_id'} : '',
Cf3 => '',
AccountNumber => ($content{'card_number'}) ? $content{'card_number'} : '',
ExpirationMonth => $content{'exp_month'},
$self->server_response($server_response);
# parse the result page.
$self->parse_response($page);
+
+ if ( $self->is_success && $self->response_code == 10 ) { #partial auth
+
+ if ( $content{'partial_auth'} ) {
+
+ $self->partial_auth_amount( $self->txn_amount );
+
+ } else {
+
+ #XXX reverse auth if i was an auth only...
+ my $void = new Business::OnlinePayment(
+ 'vSecureProcessing',
+ map { $_ -> $self->$_() } qw( platform appid tid )
+ );
+
+ $void->content(
+ 'action' => 'Void',
+ 'amount' => $self->txn_amount,
+ 'test_transaction' => $self->test_transaction,
+ 'authorization' => $self->authorization,
+ map { $_ => $content{$_} } qw( login password card_number expiration )
+ );
+
+ $void->submit;
+
+ if ( !$void->is_success ) {
+ #XXX now what??? at least this is better than return is_success 0 or 1
+ die "Couldn't void partial auth";
+ } else {
+ $self->is_success(0);
+ }
+
+ }
+
+ }
if (!$self->is_success() && !$self->error_message() ) {
if ( $DEBUG ) {
Amount => 'amount'
AvsStreet => 'address',
AvsZip => 'zip',
- Cf1 => 'UDField1',
- Cf2 => 'UDField2',
+ Cf1 => 'invoice_number',
+ Cf2 => 'customer_id',
IndustryType => 'IndustryInfo',
=head1 NOTE
Need a complete, open-source back-office and customer self-service solution?
The Freeside software includes support for credit card and electronic check
-processing with vSecureProcessing and over 50 other gateways, invoicing, integrated
-trouble ticketing, and customer signup and self-service web interfaces.
+processing with vSecureProcessing and over 60 other gateways, invoicing,
+integrated trouble ticketing, and customer signup and self-service web
+interfaces.
http://freeside.biz/freeside/