projects
/
Business-OnlinePayment-Jettis.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
0.05!
[Business-OnlinePayment-Jettis.git]
/
Jettis.pm
diff --git
a/Jettis.pm
b/Jettis.pm
index
3da3b45
..
8201be9
100644
(file)
--- a/
Jettis.pm
+++ b/
Jettis.pm
@@
-13,7
+13,7
@@
require Exporter;
@ISA = qw(Exporter AutoLoader Business::OnlinePayment);
@EXPORT = qw();
@EXPORT_OK = qw();
@ISA = qw(Exporter AutoLoader Business::OnlinePayment);
@EXPORT = qw();
@EXPORT_OK = qw();
-$VERSION = '0.0
1
';
+$VERSION = '0.0
5
';
$DEBUG = 0;
$DEBUG = 0;
@@
-161,6
+161,10
@@
my %error = (
407 => "Missing Check Number",
408 => "Unsupported Transaction Type",
409 => "Invalid Bank Name",
407 => "Missing Check Number",
408 => "Unsupported Transaction Type",
409 => "Invalid Bank Name",
+ 410 => "ACH Verification Declined",
+ 435 => "Missing Drivers License",
+ 436 => "Missing Drivers License State",
+ 437 => "Invalid Drivers License",
999 => "Unknown Error",
);
999 => "Unknown Error",
);
@@
-169,12
+173,25
@@
sub set_defaults {
$self->server('join.billingservices.com');
$self->port('443');
$self->path('/psys/txnUrl');
$self->server('join.billingservices.com');
$self->port('443');
$self->path('/psys/txnUrl');
- $self->build_subs(qw( product_id merchant_id ));
+ $self->build_subs(qw( product_id merchant_id
order_number
));
}
sub revmap_fields {
my($self, %map) = @_;
my %content = $self->content();
}
sub revmap_fields {
my($self, %map) = @_;
my %content = $self->content();
+
+ # ACTION MAP
+ my %actions = ('normal authorization' => 'PURCHASE',
+ 'credit' => 'CREDIT',
+ );
+ $content{'action'} = $actions{lc($content{'action'})}
+ if exists( $actions{lc($content{'action'})} );
+
+ if ($content{'customer_ssn'} =~ /^(\d{3})-(\d{2})-(\d{4})$/)
+ {
+ $content{'ssn4'} = $3;
+ }
+
foreach(keys %map) {
$content{$_} = ref($map{$_})
? ${ $map{$_} }
foreach(keys %map) {
$content{$_} = ref($map{$_})
? ${ $map{$_} }
@@
-187,24
+204,23
@@
sub submit {
my $self = shift;
my %content = $self->content();
my $self = shift;
my %content = $self->content();
- my $action = lc($content{'action'});
- if ( $action eq 'normal authorization' ) {
- } else {
- croak "$action not (yet) supported";
- }
-
my $type = lc($content{'type'});
my $type = lc($content{'type'});
- if ( $type
eq 'echeck'
) {
+ if ( $type
=~ /^e?check$/
) {
} else {
croak "$type not (yet) supported";
}
} else {
croak "$type not (yet) supported";
}
+ my $action = $content{'action'};
+ croak "$action not currently supported"
+ unless $action =~ /^(PURCHASE|CREDIT)$/;
+
$self->revmap_fields(
SUCCESS_URL => \'https://secure.suicidegirls.com/',
$self->revmap_fields(
SUCCESS_URL => \'https://secure.suicidegirls.com/',
+ PS_TXN_TYPE => 'action',
PRODUCT_ID => \($self->product_id()),
MERCHANT_ID => 'login',
VERSION => \'1.0',
PRODUCT_ID => \($self->product_id()),
MERCHANT_ID => 'login',
VERSION => \'1.0',
- SOR => \'
Y
',
+ SOR => \'
N
',
REMOTE_ADDR => \'10.0.0.1',
TERMS_AGREE => \'Y',
CHECK_AGE => \'Y',
REMOTE_ADDR => \'10.0.0.1',
TERMS_AGREE => \'Y',
CHECK_AGE => \'Y',
@@
-218,19
+234,24
@@
sub submit {
EMAIL => 'email',
FIRST_NAME => 'first_name',
LAST_NAME => 'last_name',
EMAIL => 'email',
FIRST_NAME => 'first_name',
LAST_NAME => 'last_name',
+ SSN4 => 'ssn4',
ADDR_STREET_1 => 'address',
ADDR_CITY => 'city',
ADDR_STATE => 'state',
ADDR_ZIP => 'zip',
ADDR_COUNTRY => \'840', # US
MERCH_TEXT_AREA => 'description',
ADDR_STREET_1 => 'address',
ADDR_CITY => 'city',
ADDR_STATE => 'state',
ADDR_ZIP => 'zip',
ADDR_COUNTRY => \'840', # US
MERCH_TEXT_AREA => 'description',
+ BILL_ITEM_ID => 'order_number',
+ DL_NUM => \'B01111111111', #XXX state_id (license_num?)
+ DL_STATE => 'state', #XXX state_id_state
);
my %post_data = $self->get_fields(qw(
);
my %post_data = $self->get_fields(qw(
- SUCCESS_URL PRODUCT_ID MERCHANT_ID VERSION SOR REMOTE_ADDR
+ SUCCESS_URL P
S_TXN_TYPE P
RODUCT_ID MERCHANT_ID VERSION SOR REMOTE_ADDR
TERMS_AGREE CHECK_AGE PAY_METHOD_ID PRICE QTY CHECK_NUM BANK_ACCT_NUM
TERMS_AGREE CHECK_AGE PAY_METHOD_ID PRICE QTY CHECK_NUM BANK_ACCT_NUM
- BANK_ROUT_NUM BANK_NAME EMAIL FIRST_NAME LAST_NAME ADDR_STREET_1
- ADDR_CITY ADDR_STATE ADDR_ZIP ADDR_COUNTRY MERCH_TEXT_AREA
+ BANK_ROUT_NUM BANK_NAME EMAIL FIRST_NAME LAST_NAME SSN4 ADDR_STREET_1
+ ADDR_CITY ADDR_STATE ADDR_ZIP ADDR_COUNTRY MERCH_TEXT_AREA BILL_ITEM_ID
+ DL_NUM DL_STATE
));
my $pd = make_form(%post_data);
));
my $pd = make_form(%post_data);
@@
-249,6
+270,7
@@
sub submit {
$self->is_success(1);
$self->result_code('0');
$self->authorization($response{'AUTHORIZATION_CODE'});
$self->is_success(1);
$self->result_code('0');
$self->authorization($response{'AUTHORIZATION_CODE'});
+ $self->order_number($response{'BILL_ITEM_ID'});
} else {
$self->is_success(0);
$self->result_code($response{'RESULT_MAIN'});
} else {
$self->is_success(0);
$self->result_code($response{'RESULT_MAIN'});
@@
-258,6
+280,7
@@
sub submit {
}
1;
}
1;
+
__END__
=head1 NAME
__END__
=head1 NAME
@@
-277,8
+300,9
@@
Business::OnlinePayment::Jettis - Jettis backend for Business::OnlinePayment
amount => '49.95',
invoice_number => '100100',
name => 'Tofu Beast',
amount => '49.95',
invoice_number => '100100',
name => 'Tofu Beast',
- card_number => '4007000000027',
- expiration => '09/02',
+ account_number => '12345',
+ routing_code => '123456789',
+ bank_name => 'First National Test Bank',
);
$tx->submit();
);
$tx->submit();