- # clean and process the $self->content info
- $self->process_content();
- my %content = $self->content;
- my $action = $self->action();
-
- my @acceptable_actions = ('charge', 'refund', 'void');
-
- unless ( grep { $action eq $_ } @acceptable_actions ) {
- croak "'$action' is not supported at this time.";
- }
-
- # fill out the template vars
- my $template_vars = {
-
- auth => {
- platform => $self->platform,
- userid => $self->userid,
- gid => $self->gid,
- tid => $self->tid
- },
-
- payment => {
- amount => $content{'amount'},
- track1 => ($content{'track1'}) ? $content{'track1'} : '',
- track2 => ($content{'track2'}) ? $content{'track2'} : '',
- type => ($content{'description'}) ? $content{'description'} : '',
- cf1 => ($content{'UDField1'}) ? $content{'UDField1'} : '',
- cf2 => ($content{'UDField2'}) ? $content{'UDField2'} : '',
- cf3 => '',
- account_number => ($content{'card_number'}) ? $content{'card_number'} : '',
- exp_month => $content{'exp_month'},
- exp_year => $content{'exp_year'},
- cvv => ($content{'cvv'}) ? $content{'cvv'} : ($content{'cvv2'}) ? $content{'cvv2'} : '',
- first_name => ($content{'first_name'}) ? $content{'first_name'} : '',
- last_name => ($content{'last_name'}) ? $content{'last_name'} : '',
- postal_code => ($content{'zip'}) ? $content{'zip'} : '',
- street_address => ($content{'street_number'}) ? $content{'street_number'} : '',
- industry_type => ($content{'IndustryInfo'} && lc($content{'IndustryInfo'}) eq 'ecommerce') ? 'ecom_3' : '',
- invoice_num => ($content{'invoice_number'}) ? $content{'invoice_number'} : '',
- appid => $self->appid(),
- recurring => ($content{'recurring_billing'} && $content{'recurring_billing'} eq 'YES' ) ? 1 : 0,
- response_code => ($content{'response_code'}) ? $content{'response_code'} : '',
- reference_number=> ($content{'ref_num'}) ? $content{'ref_num'} : '',
- token => ($content{'token'}) ? $content{'token'} : '',
- receipt => ($content{'receipt'}) ? $content{'receipt'} : '',
- transaction_date=> ($content{'txn_date'}) ? $content{'txn_date'} : '',
- merchant_data => ($content{'merchant_data'}) ? $content{'merchant_data'} : '',
- },
-
- # we won't be using level2 nor level3. So I'm leaving them blank for now.
+ # clean and process the $self->content info
+ $self->process_content();
+ my %content = $self->content;
+ my $action = $self->action();
+
+ my @acceptable_actions = ('charge', 'refund', 'void');
+
+ unless ( grep { $action eq $_ } @acceptable_actions ) {
+ croak "'$action' is not supported at this time.";
+ }
+
+ # fill out the template vars
+ my $template_vars = {
+
+ auth => {
+ platform => $self->platform,
+ userid => $self->userid,
+ gid => $self->gid,
+ tid => $self->tid
+ },
+
+ payment => {
+ amount => $content{'amount'},
+ track1 => ($content{'track1'}) ? $content{'track1'} : '',
+ track2 => ($content{'track2'}) ? $content{'track2'} : '',
+ type => ($content{'description'}) ? $content{'description'} : '',
+ cf1 => ($content{'UDField1'}) ? $content{'UDField1'} : '',
+ cf2 => ($content{'UDField2'}) ? $content{'UDField2'} : '',
+ cf3 => '',
+ account_number => ($content{'card_number'}) ? $content{'card_number'} : '',
+ exp_month => $content{'exp_month'},
+ exp_year => $content{'exp_year'},
+ cvv => ($content{'cvv'}) ? $content{'cvv'} : ($content{'cvv2'}) ? $content{'cvv2'} : '',
+ first_name => ($content{'first_name'}) ? $content{'first_name'} : '',
+ last_name => ($content{'last_name'}) ? $content{'last_name'} : '',
+ postal_code => ($content{'zip'}) ? $content{'zip'} : '',
+ street_address => ($content{'street_number'}) ? $content{'street_number'} : '',
+ industry_type => ($content{'IndustryInfo'} && lc($content{'IndustryInfo'}) eq 'ecommerce') ? 'ecom_3' : '',
+ invoice_num => ($content{'invoice_number'}) ? $content{'invoice_number'} : '',
+ appid => $self->appid(),
+ recurring => ($content{'recurring_billing'} && $content{'recurring_billing'} eq 'YES' ) ? 1 : 0,
+ response_code => ($content{'response_code'}) ? $content{'response_code'} : '',
+ reference_number=> ($content{'ref_num'}) ? $content{'ref_num'} : '',
+ token => ($content{'token'}) ? $content{'token'} : '',
+ receipt => ($content{'receipt'}) ? $content{'receipt'} : '',
+ transaction_date=> ($content{'txn_date'}) ? $content{'txn_date'} : '',
+ merchant_data => ($content{'merchant_data'}) ? $content{'merchant_data'} : '',
+ },
+
+ # we won't be using level2 nor level3. So I'm leaving them blank for now.