1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
|
package Business::OnlinePayment::TransFirsteLink;
use strict;
use vars qw($VERSION $DEBUG %error_messages);
use Carp qw(carp croak);
use Tie::IxHash;
use base qw(Business::OnlinePayment::HTTPS);
$VERSION = '0.04';
$VERSION = eval $VERSION;
$DEBUG = 0;
%error_messages = (
'000' => 'Approval',
'001' => 'Call Issuer',
'002' => 'Referral special',
'003' => 'Invalid merchant number',
'004' => 'Pick up',
'005' => 'Declined',
'006' => 'General error',
'007' => 'Pick up special',
'008' => 'Honor with ID',
'009' => 'General Decline',
'010' => 'Network Error',
'011' => 'Approval',
'012' => 'Invalid transaction type',
'013' => 'Invalid amount field',
'014' => 'Invalid card number',
'015' => 'Invalid issuer',
'016' => 'General Decline',
'017' => 'General Decline',
'018' => 'General Decline',
'019' => 'Re-enter',
'020' => 'General Decline',
'021' => 'No action taken',
'022' => 'General Decline',
'023' => 'General Decline',
'024' => 'General Decline',
'025' => 'Acct num miss',
'026' => 'General Decline',
'027' => 'General Decline',
'028' => 'File unavailable',
'029' => 'General Decline',
'030' => 'Format Error - Decline',
'031' => 'General Decline',
'032' => 'General Decline',
'033' => 'General Decline',
'034' => 'General Decline',
'036' => 'General Decline',
'037' => 'General Decline',
'038' => 'General Decline',
'039' => 'No card acct',
'040' => 'General Decline',
'041' => 'Lost card',
'042' => 'General Decline',
'043' => 'Stolen card',
'044' => 'General Decline',
'045' => 'General Decline',
'046' => 'General Decline',
'048' => 'General Decline',
'049' => 'General Decline',
'050' => 'General Decline',
'051' => 'Over limit',
'052' => 'No checking acct',
'053' => 'No saving acct',
'054' => 'Expired card',
'055' => 'Invalid pin',
'056' => 'General Decline',
'057' => 'TXN not allowed',
'058' => 'TXN not allowed term',
'059' => 'TXN not allowed - Merchant',
'060' => 'General Decline',
'061' => 'Over cash limit',
'062' => 'Restricted card',
'063' => 'Security violate',
'064' => 'General Decline',
'065' => 'Excessive authorizations',
'066' => 'General Decline',
'067' => 'General Decline',
'069' => 'General Decline',
'070' => 'General Decline',
'071' => 'General Decline',
'072' => 'General Decline',
'073' => 'General Decline',
'074' => 'General Decline',
'075' => 'Excessive pin entry tries',
'076' => 'Unable locate previous msg (ref# not found)',
'077' => 'Mismatched info',
'078' => 'No account',
'079' => 'Already reversed',
'080' => 'Invalid date',
'081' => 'Crypto error',
'082' => 'CVV failure',
'083' => 'Unable verify pin',
'084' => 'Duplicate trans',
'085' => 'No reason 2 decline',
'086' => 'Cannot verify pin',
'088' => 'General Decline',
'089' => 'General Decline',
'090' => 'General Decline',
'091' => 'Issuer unavailable',
'092' => 'Destination route not found',
'093' => 'Law violation',
'094' => 'Duplicate trans',
'096' => 'System malfunction',
'098' => 'General Decline',
'099' => 'General Decline',
'0B1' => 'Surcharge amount not permitted on Visa cards or EBT food stamps',
'0B2' => 'Surcharge amount not supported by debit network issuer',
'0EB' => 'Check digit error',
'0EC' => 'Cid format error',
'0N0' => 'FORCE STIP',
'0N3' => 'Service not available',
'0N4' => 'Exceeds limit issuer',
'0N5' => 'Ineligible for resubmission',
'0N7' => 'CVV2 failure',
'0N8' => 'Trans amount exceeds preauth amt',
'0P0' => 'Approved pvid miss',
'0P1' => 'Declined pvid miss',
'0P2' => 'Invalid bill info',
'0Q1' => 'Card auth failed',
'0R0' => 'Multipay stopped',
'0R1' => 'Multipay stopped merch',
'0R3' => 'Revocation of all authorizations order',
'0XA' => 'Forward to issue1',
'0XD' => 'Forward to issue2',
'0VD' => 'General Decline',
'0T0' => 'First Time Check',
'0T1' => 'Check is OK, but cannot be converted',
'0T2' => 'Invalid routing transit number or check belongs to a category that is not eligible for conversion',
'0T3' => 'Amount greater than established service limit',
'0T4' => 'Unpaid items, failed negative check',
'0T5' => 'Duplicate check number',
'0T6' => 'MICR Error',
'0T7' => 'Too many checks (over merchant or bank limit)',
'203' => 'Invalid merchant number',
'212' => 'Invalid transaction type',
'213' => 'Invalid amount field',
'214' => 'Invalid card number',
'254' => 'Expired card',
'257' => 'Txn not allowed',
'276' => 'Unable to locate prvious msg (ref # not found)',
'278' => 'No account',
'284' => 'General Decline',
'296' => 'System malfunction',
'2Q1' => 'Card authorization failed',
'300' => 'Invalid request format',
'301' => 'Missing file header',
'303' => 'Invalid sender ID',
'306' => 'Duplicate file number',
'307' => 'General Decline',
'309' => 'Comm link down',
'310' => 'Missing batch header',
'317' => 'Invalid MOTO ID',
'338' => 'General Decline',
'380' => 'Missing batch trailer',
'382' => 'Record count does not match number records in batch',
'383' => 'Net amount does not match file amount',
'384' => 'Duplicate transaction',
'385' => 'Invalid request format',
'394' => 'Record count does not match records in file',
'395' => 'Net amount does not match file amount',
'396' => 'Declined post - reauthorization attempt',
'318' => 'Invalid account data source',
'319' => 'Invalid POS entry mode',
'320' => 'Auth date invalid (transaction date)',
'321' => 'Invalid auth source code',
'322' => 'Invalid ACI code',
'REJ' => 'Rejected transaction that has been re-keyed',
'3AC' => 'Invalid authorization code (must be uppercase, no special chars)',
'3TI' => 'Invalid tax indicator',
'3VD' => 'Voided transaction',
'3AD' => 'AVS response code declined',
'3AR' => 'AVS required/address information not provided',
'3BD' => 'AVS and CVV2 response Code Declined',
'3BR' => 'AVS and CVV2 required/information not provided',
'3CD' => 'CVV2 response code declined',
'3CR' => 'CVV2 required/inrormation not provided',
'3L5' => 'No data sent',
'3L6' => 'Order number missing',
'3M1' => 'Auth date blank',
'3M2' => 'Auth amount blank',
'3MT' => 'Managed transaction',
'3RV' => 'Reversed transaction',
'3TO' => 'Timeout',
'600' => 'General Decline',
'990' => 'Voided',
'991' => 'Voided',
'992' => 'Voided',
'993' => 'Voided',
'994' => 'Voided',
'995' => 'Voided',
'996' => 'Voided',
'997' => 'Voided',
'998' => 'Voided',
'999' => 'Voided',
'XXX' => 'General Decline',
);
sub debug {
my $self = shift;
if (@_) {
my $level = shift || 0;
if ( ref($self) ) {
$self->{"__DEBUG"} = $level;
}
else {
$DEBUG = $level;
}
$Business::OnlinePayment::HTTPS::DEBUG = $level;
}
return ref($self) ? ( $self->{"__DEBUG"} || $DEBUG ) : $DEBUG;
}
sub set_defaults {
my $self = shift;
my %opts = @_;
# standard B::OP methods/data
$self->server("epaysecure1.transfirst.com");
$self->port("443");
$self->path("/");
$self->build_subs(qw(
merchantcustservnum
order_number avs_code cvv2_response
response_page response_code response_headers
junk
));
# module specific data
if ( $opts{debug} ) {
$self->debug( $opts{debug} );
delete $opts{debug};
}
if ( $opts{merchantcustservnum} ) {
$self->merchantcustservnum( $opts{merchantcustservnum} );
delete $opts{merchantcustservnum};
}
}
sub _map_fields {
my ($self) = @_;
my %content = $self->content();
#ACTION MAP
my %actions = (
'normal authorization' => 32, # Authorization/Settle transaction
'credit' => 20, # Credit (refund)
'authorization only' => 30, # Authorization only
'post authorization' => 40, # Settlement
'void' => 61, # Void
);
$content{'TransactionCode'} = $actions{ lc( $content{'action'} ) }
|| $content{'action'};
# TYPE MAP
my %types = (
'visa' => 'CC',
'mastercard' => 'CC',
'american express' => 'CC',
'discover' => 'CC',
'cc' => 'CC',
'check' => 'ECHECK',
);
$content{'type'} = $types{ lc( $content{'type'} ) } || $content{'type'};
$self->transaction_type( $content{'type'} );
# stuff it back into %content
$self->content(%content);
}
sub _revmap_fields {
my ( $self, %map ) = @_;
my %content = $self->content();
foreach ( keys %map ) {
$content{$_} =
ref( $map{$_} )
? ${ $map{$_} }
: $content{ $map{$_} };
}
$self->content(%content);
}
sub expdate_mmyy {
my $self = shift;
my $expiration = shift;
my $expdate_mmyy;
if ( defined($expiration) and $expiration =~ /^(\d+)\D+\d*(\d{2})$/ ) {
my ( $month, $year ) = ( $1, $2 );
$expdate_mmyy = sprintf( "%02d", $month ) . $year;
}
return defined($expdate_mmyy) ? $expdate_mmyy : $expiration;
}
sub required_fields {
my($self,@fields) = @_;
my @missing;
my %content = $self->content();
foreach(@fields) {
next
if (exists $content{$_} && defined $content{$_} && $content{$_}=~/\S+/);
push(@missing, $_);
}
Carp::croak("missing required field(s): " . join(", ", @missing) . "\n")
if(@missing);
}
sub submit {
my ($self) = @_;
$self->_map_fields();
my %content = $self->content;
my %required;
$required{CC_20} = [ qw( ePayAccountNum Password OrderNum
TransactionAmount CardAccountNum ExpirationDate
MerchantCustServNum ) ];
$required{CC_30} = [ qw( ePayAccountNum Password TransactionCode OrderNum
TransactionAmount CardAccountNum ExpirationDate
CardHolderZip MerchantCustServNum ) ];
$required{CC_32} = $required{CC_30};
$required{CC_61} = [ qw( ePayAccountNum Password TransactionCode
ReferenceNum ) ];
$required{ECHECK_20} = [ qw( ePayAccountNum Password AccountNumber
RoutingNumber DollarAmount OrderNumber
CustomerNumber CustomerName ) ];
$required{ECHECK_32} = [ qw( ePayAccountNum Password OrderNumber
AccountNumber RoutingNumber CheckNumber
DollarAmount CustomerName CustomerAddress
CustomerCity CustomerState CustomerZip
CustomerPhone ) ];
my %optional;
$optional{CC_20} = [ qw( CardHolderName CardHolderAddress CardHolderCity
CardHolderState CardHolderZip CardHolderEmail
CardHolderPhone CustomerNum Misc1 Misc2 CVV2
Ecommerce DuplicateChecking AuthorizedAmount
AutorizedDate AuthorizedTime FulfillmentDate
CardHolderCountry POSEntryMode MerchantStoreNum
CardHolderIDSource SICCATCode MerchantZipCode
AccountDataSource AuthResponseCode AuthSourceCode
AuthACICode AuthValidationCode AuthAVSResponse
MerchantCustServNum CrossReferenceNum
PaymentDescription ReferenceNum ) ];
$optional{CC_32} = $optional{CC_30};
$optional{CC_30} = [ qw( CardHolderName CardHolderAddress CardHolderCity
CardHolderState CardHolderEmail CardHolderPhone
CustomerNum Misc1 Misc2 CVV2 Ecommerce
DuplicateChecking MessageSequenceNum
CardHolderCountry POSEntryMode MerchantStoreNum
CardHolderIDSource SICCATCode MerchantZipCode
PaymenntDiscriptor CAVVCode ECIValue XID
TaxIndicator TotalTaxAmount ) ];
$optional{CC_32} = $optional{CC_30};
$optional{CC_61} = [ qw( MessageSequenceNum CrossReferenceNum OrderNum
CustomerNum ) ];
$optional{ECHECK_20} = ();
$optional{ECHECK_32} = [ qw( CustomerNumber Misc1 Misc2 CustomerEmail
DriversLicense DriversLicenseState
BirthDate SocSecNum ) ];
my $type_action = $self->transaction_type(). '_'. $content{TransactionCode};
unless ( exists($required{$type_action}) ) {
# croak( "TransFirst eLink can't (yet?) handle transaction type: ".
# "$content{action} on " . $self->transaction_type() );
$self->error_message("TransFirst eLink can't handle transaction type: ".
"$content{action} on " . $self->transaction_type() );
$self->is_success(0);
return;
}
my $expdate_mmyy = $self->expdate_mmyy( $content{"expiration"} );
my $zip = $content{'zip'};
$zip =~ s/[^[:alnum:]]//g;
my $merchantcustservnum = $self->merchantcustservnum;
my $account_number = $self->transaction_type() eq 'CC'
? $content{card_number}
: $content{account_number} ;
my $invoice_number = $content{invoice_number} || "PAYMENT"; # make one up
my $check_number = $content{check_number} || "100"; # make one up
$self->_revmap_fields(
ePayAccountNum => 'login',
Password => 'password',
OrderNum => \$invoice_number,
OrderNumber => \$invoice_number,
MerchantCustServNum => \$merchantcustservnum,
TransactionAmount => 'amount',
DollarAmount => 'amount',
CardAccountNum => 'card_number',
ExpirationDate => \$expdate_mmyy, # MMYY from 'expiration'
CVV2 => 'cvv2',
RoutingNumber => 'routing_code',
AccountNumber => \$account_number,
AccountNum => \$account_number,
CheckNumber => \$check_number,
CardHolderName => 'name',
CustomerName => 'account_name',
CardHolderAddress => 'address',
CustomerAddress => 'address',
CardHolderCity => 'city',
CustomerCity => 'city',
CardHolderState => 'state',
CustomerState => 'state',
CardHolderZip => \$zip, # 'zip' with non-alnums removed
CustomerZip => \$zip, # 'zip' with non-alnums removed
CardHolderEmail => 'email',
CustomerEmail => 'email',
CardHolderPhone => 'phone',
CustomerPhone => 'phone',
CustomerNum => 'customer_id',
CustomerNumber => 'customer_id',
CardHolderCountry => 'country',
PaymentDescriptor => 'description',
ReferenceNum => 'order_number'
);
tie my %params, 'Tie::IxHash',
$self->get_fields( @{$required{$type_action}},
@{$optional{$type_action}},
);
$params{TestTransaction}='Y' if $self->test_transaction;
$params{InstallmentNum} = $params{InstallmentOf} = '01'
unless ($params{InstallmentNum} && $params{InstallmentOf});
if ($self->transaction_type() eq 'ECHECK') {
delete $params{InstallmentNum};
delete $params{InstallmentOf};
}
if ( $type_action eq "CC_30" || $type_action eq "CC_32" ) {
$self->path($self->path."elink/authpd.asp");
} elsif ( $type_action eq "CC_61" ) {
$self->path($self->path."eLink/voidpd.asp");
} elsif ( $type_action eq "CC_20" ) {
$self->path($self->path."eLink/creditpd.asp");
} elsif ( $type_action eq "ECHECK_32" ) {
$self->path($self->path."eLink/checkPD.asp");
} elsif ( $type_action eq "ECHECK_20" ) {
$self->path($self->path."eLink/checkcreditPD.asp");
} else {
croak "don't know path for unexpected type and action $type_action";
}
warn join("\n", map{ "$_ => $params{$_}" } keys(%params)) if $DEBUG > 1;
my ( $page, $resp, %resp_headers ) =
$self->https_post( %params );
$self->response_code( $resp );
$self->response_page( $page );
$self->response_headers( \%resp_headers );
warn "$page\n" if $DEBUG > 1;
# $page should contain | separated values
$self->required_fields(@{$required{$type_action}});
my $status ='';
my @rarray = ();
if ( $type_action eq "CC_30" || $type_action eq "CC_32" ) {
my ($format,$account,$tcode,$seq,$moi,$cardnum,$exp,$authamt,$authdate,
$authtime,$tstat,$custnum,$ordernum,$refnum,$rcode,$authsrc,$achar,
$transid,$vcode,$sic,$country,$avscode,$storenum,$cvv2resp,$cavvcode,
$crossrefnum,$etstat,$cavvresponse,$xid,$eci,@junk)
= split '\|', $page;
# AVS and CVS values may be set on success or failure
$self->avs_code($avscode);
$self->cvv2_response( $cvv2resp );
$self->result_code( $status = $etstat );
$self->order_number( $refnum );
$self->authorization( $rcode );
$self->junk( \@junk );
$self->error_message($error_messages{$status});
} elsif ( $type_action eq "CC_61" ) {
$self->avs_code('');
$self->cvv2_response('');
my ($format,$account,$tcode,$seq,$voiddate,$voidtime,$tstat, # flaky docs
$refnum,$filler1,$filler2,$filler3,$etstat,@junk)
= split '\|', $page;
$self->result_code( $status = $etstat );
$self->order_number( $refnum );
$self->authorization('');
$self->junk( \@junk );
$self->error_message($error_messages{$status});
} elsif ( $type_action eq "CC_20" ) {
$self->avs_code('');
$self->cvv2_response('');
my ($format,$account,$tcode,$seq,$moi,$authamt,$authdate,$authtime,
$tstat,$refnum,$crossrefnum,$custnum,$ordernum,$etstat,@junk)
= split '\|', $page;
$self->result_code( $status = $etstat );
$self->order_number( $refnum );
$self->authorization('');
$self->junk( \@junk );
$self->error_message($error_messages{$status});
} elsif ( $type_action eq "ECHECK_32" ) {
my ($responsecode,$response,$transactionid,$note,$errors,@junk)
= split '\|', $page;
$self->avs_code('');
$self->cvv2_response('');
$self->result_code( $status = $responsecode );
$self->order_number( $transactionid );
$self->authorization('');
$errors = $errors ? $errors : '';
$self->error_message("$response $errors");
$self->junk( \@junk );
} elsif ( $type_action eq "ECHECK_20" ) {
my ($response,$transactionid,$note,$errors,@junk) # very flaky docs
= split '\|', $page;
$self->avs_code('');
$self->cvv2_response('');
$self->result_code( $status = $response );
$self->order_number( $transactionid );
$self->authorization('');
$errors = $errors ? $errors : '';
$self->error_message("$response $errors");
$self->junk( \@junk );
} else {
croak "can't interpret response for unexpected type and action $type_action";
}
if ( $resp =~ /^(HTTP\S+ )?200/ && ($status eq "000" || $status eq "011" || $status eq "085" || $status eq "0P0" || $status eq "P00" || $status eq 'ACCEPTED') ) {
$self->is_success(1);
}
else {
$self->is_success(0);
}
}
1;
__END__
=head1 NAME
Business::OnlinePayment::TransFirsteLink - Transfirst eLink backend for Business::OnlinePayment
=head1 SYNOPSIS
use Business::OnlinePayment;
my $tx = new Business::OnlinePayment(
'TransFirsteLink',
'merchantcustservnum' => "8005551212",
);
# See the module documentation for details of content()
$tx->content(
type => 'CC',
action => 'Normal Authorization',
description => 'Business::OnlinePayment::TransFirsteLink test',
amount => '49.95',
invoice_number => '100100',
customer_id => 'jef',
name => 'Jeff Finucane',
address => '123 Anystreet',
city => 'Anywhere',
state => 'GA',
zip => '30004',
email => 'transfirst@weasellips.com',
card_number => '4111111111111111',
expiration => '12/09',
cvv2 => '123',
order_number => 'string',
);
$tx->submit();
if ( $tx->is_success() ) {
print(
"Card processed successfully: ", $tx->authorization, "\n",
"order number: ", $tx->order_number, "\n",
"CVV2 response: ", $tx->cvv2_response, "\n",
"AVS code: ", $tx->avs_code, "\n",
);
}
else {
my $info = "";
$info = " (CVV2 mismatch)" if ( $tx->result_code == 114 );
print(
"Card was rejected: ", $tx->error_message, $info, "\n",
"order number: ", $tx->order_number, "\n",
);
}
=head1 DESCRIPTION
This module is a back end driver that implements the interface
specified by L<Business::OnlinePayment> to support payment handling
via TransFirst's eLink Internet payment solution.
See L<Business::OnlinePayment> for details on the interface this
modules supports.
=head1 Standard methods
=over 4
=item set_defaults()
This method sets the 'server' attribute to 'epaysecure1.transfirst.com' and
the port attribute to '443'. This method also sets up the
L</Module specific methods> described below.
=item submit()
=back
=head1 Unofficial methods
This module provides the following methods which are not officially part of the
standard Business::OnlinePayment interface (as of 3.00_06) but are nevertheless
supported by multiple gateways modules and expected to be standardized soon:
=over 4
=item L<order_number()|/order_number()>
=item L<avs_code()|/avs_code()>
=item L<cvv2_response()|/cvv2_response()>
=back
=head1 Module specific methods
This module provides the following methods which are not currently
part of the standard Business::OnlinePayment interface:
=over 4
=item L<expdate_mmyy()|/expdate_mmyy()>
=item L<debug()|/debug()>
=back
=head1 Settings
The following default settings exist:
=over 4
=item server
epaysecure1.transfirst.com
=item port
443
=back
=head1 Handling of content(%content)
The following rules apply to content(%content) data:
=head2 type
If 'type' matches one of the following keys it is replaced by the
right hand side value:
'visa' => 'CC',
'mastercard' => 'CC',
'american express' => 'CC',
'discover' => 'CC',
'check' => 'ECHECK',
The value of 'type' is used to set transaction_type(). Currently this
module only supports the above values.
=head1 Setting TransFirst eLink parameters from content(%content)
The following rules are applied to map data to TransFirst eLink parameters
from content(%content):
# eLink param => $content{<key>}
ePayAccountNum => 'login',
Password => 'password',
OrderNum => 'invoice_number',
OrderNumber => 'invoice_number',
TransactionAmount => 'amount',
DollarAmount => 'amount',
CardAccountNum => 'card_number',
ExpirationDate => \( $month.$year ), # MM/YY from 'expiration'
CVV2 => 'cvv2',
RoutingNumber => 'routing_code',
AccountNumber => \( $type eq 'CC' ? $card_number : $account_number ),
CheckNumber => 'check_number',
CardHolderName => 'name',
CardHolderAddress => 'address',
CardHolderCity => 'city',
CardHolderState => 'state',
CardHolderZip => \$zip, # 'zip' with non-alphanumerics removed
CardHolderEmail => 'email',
CardHolderPhone => 'phone',
CardHolderCountry => 'country',
CustomerName => 'name',
CustomerAddress => 'address',
CustomerCity => 'city',
CustomerState => 'state',
CustomerZip => \$zip, # 'zip' with non-alphanumerics removed
CustomerEmail => 'email',
CustomerPhone => 'phone',
PaymentDescriptor => 'description',
=head1 Mapping TransFirst eLink transaction responses to object methods
The following methods provides access to the transaction response data
resulting from a Payflow Pro request (after submit()) is called:
=head2 order_number()
This order_number() method returns the ReferenceNum field for card transactions
and TransactionId for check transactions to uniquely identify the transaction.
=head2 result_code()
The result_code() method returns the Extended Transaction Status field for
card transactions and the Result Code field for check transactions. It is the
numeric return code indicating the outcome of the attempted
transaction.
=head2 error_message()
The error_message() method returns the Errors field for check
transactions. This provides more details about the transaction result.
=head2 authorization()
The authorization() method returns the Authorization Response Code field,
which is the approval code obtained from the card processing network.
=head2 avs_code()
The avs_code() method returns the AVS Response Code field from the
transaction result.
=head2 cvv2_response()
The cvv2_response() method returns the CVV2 Response Code field, which is a
response message returned with the transaction result.
=head2 expdate_mmyy()
The expdate_mmyy() method takes a single scalar argument (typically
the value in $content{expiration}) and attempts to parse and format
and put the date in MMYY format as required by PayflowPro
specification. If unable to parse the expiration date simply leave it
as is and let the PayflowPro system attempt to handle it as-is.
=head2 debug()
Enable or disble debugging. The value specified here will also set
$Business::OnlinePayment::HTTPS::DEBUG in submit() to aid in
troubleshooting problems.
=head1 COMPATIBILITY
This module implements an interface to the TransFirst eLink API version
3.4
=head1 AUTHORS
Jeff Finucane <transfirst@weasellips.com>
Based on Business::OnlinePayment::PayflowPro written by Ivan Kohler
and Phil Lobbes.
=head1 SEE ALSO
perl(1), L<Business::OnlinePayment>, L<Carp>, and the TransFirst
e Payment Services Card Not Present eLink User Guide.
=cut
|