Pass Cf1/Cf2 for voids and refunds as well
[Business-OnlinePayment-vSecureProcessing.git] / lib / Business / OnlinePayment / vSecureProcessing.pm
index 696da87..f7d8b9d 100644 (file)
@@ -11,7 +11,7 @@ use Business::OnlinePayment::HTTPS;
 
 @ISA = qw(Business::OnlinePayment::HTTPS);
 $DEBUG = 0;
-$VERSION = '0.07';
+$VERSION = '0.09';
 
 sub _info {
   'info_compat'       => '0.01',
@@ -39,7 +39,7 @@ my %payment_actions = (
         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
@@ -49,7 +49,8 @@ my %payment_actions = (
         path      => '/vsg2/processvoid',
         process   => 'ProcessVoid',
         fields    => [qw(
-          Amount AccountNumber ExpirationMonth ExpirationYear ReferenceNumber
+          Amount Cf1 Cf2 Cf3 AccountNumber
+          ExpirationMonth ExpirationYear ReferenceNumber
           TransactionDate IndustryType ApplicationId
         )],
     },
@@ -57,7 +58,8 @@ my %payment_actions = (
         path      => '/vsg2/processrefund',
         process   => 'ProcessRefund',
         fields    => [qw(
-          Amount AccountNumber ExpirationMonth ExpirationYear ApplicationId
+          Amount Cf1 Cf2 Cf3 AccountNumber
+          ExpirationMonth ExpirationYear ApplicationId
         )],
     },
     'authorize' => {
@@ -117,7 +119,7 @@ sub set_defaults {
     $self->build_subs(qw/
             platform tid appid
             action reference_number cvv2_response avs_code response_code
-            risk_score txn_amount txn_date partial_auth partial_auth_amount
+            risk_score txn_amount txn_date partial_auth_amount
     /);
     
     $DEBUG = exists($options{debug}) ? $options{debug} : $DEBUG;
@@ -228,8 +230,8 @@ sub submit {
             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'},
@@ -336,7 +338,7 @@ sub submit {
 
     if ( $self->is_success && $self->response_code == 10 ) { #partial auth
 
-      if ( $self->partial_auth ) {
+      if ( $content{'partial_auth'} ) {
 
         $self->partial_auth_amount( $self->txn_amount );
 
@@ -521,8 +523,8 @@ from content(%content):
       Amount              => 'amount'
       AvsStreet           => 'address',
       AvsZip              => 'zip',
-      Cf1                 => 'UDField1',
-      Cf2                 => 'UDField2',
+      Cf1                 => 'invoice_number',
+      Cf2                 => 'customer_id',
       IndustryType        => 'IndustryInfo',
 
 =head1 NOTE
@@ -553,8 +555,9 @@ the same terms as Perl itself.
 
 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/