Required arguments in the hashref are I<method>, and I<amount>
-Available methods are: I<CC>, I<ECHECK> and I<LEC>
+Available methods are: I<CC>, I<ECHECK>, I<LEC>, and I<PAYPAL>
Available optional arguments are: I<description>, I<invnum>, I<apply>, I<quiet>, I<paynum_ref>, I<payunique>, I<session_id>
? $options->{country}
: $self->country;
- #3.0 is a good a time as any to get rid of this... add a config to pass it
- # if anyone still needs it
- #$content{referer} = 'http://cleanwhisker.420.am/';
-
$content{phone} = $self->daytime || $self->night;
my $currency = $conf->exists('business-onlinepayment-currency')
'CC' => 'CARD',
'ECHECK' => 'CHEK',
'LEC' => 'LECB',
+ 'PAYPAL' => 'PPAL',
);
sub realtime_bop {
(exists($options{'paytype'}) && $options{'paytype'})
? uc($options{'paytype'})
: uc($self->getfield('paytype')) || 'PERSONAL CHECKING';
- $content{account_name} = $self->getfield('first'). ' '.
- $self->getfield('last');
+
+ if ( $content{account_type} =~ /BUSINESS/i && $self->company ) {
+ $content{account_name} = $self->company;
+ } else {
+ $content{account_name} = $self->getfield('first'). ' '.
+ $self->getfield('last');
+ }
$content{customer_org} = $self->company ? 'B' : 'I';
$content{state_id} = exists($options{'stateid'})
%$bop_content,
'reference' => $cust_pay_pending->paypendingnum, #for now
'callback_url' => $payment_gateway->gateway_callback_url,
+ 'cancel_url' => $payment_gateway->gateway_cancel_url,
'email' => $email,
%content, #after
);
} else {
- my $perror = $payment_gateway->gateway_module. " error: ".
- $transaction->error_message;
+ my $perror = $transaction->error_message;
+ #$payment_gateway->gateway_module. " error: ".
+ # removed for conciseness
my $jobnum = $cust_pay_pending->jobnum;
if ( $jobnum ) {
}
$cust_pay_pending->status('done');
- $cust_pay_pending->statustext("declined: $perror");
+ $cust_pay_pending->statustext($perror);
+ #'declined:': no, that's failure_status
+ if ( $transaction->can('failure_status') ) {
+ $cust_pay_pending->failure_status( $transaction->failure_status );
+ }
my $cpp_done_err = $cust_pay_pending->replace;
if ( $cpp_done_err ) {
my $e = "WARNING: $options{method} declined but pending payment not ".
'amount' => $cust_pay_pending->paid,
#'invoice_number' => $options{'invnum'},
'customer_id' => $self->custnum,
-
- #3.0 is a good a time as any to get rid of this... add a config to pass it
- # if anyone still needs it
- #'referer' => 'http://cleanwhisker.420.am/',
-
'reference' => $cust_pay_pending->paypendingnum,
'email' => $email,
'phone' => $self->daytime || $self->night,
'password' => $password,
'order_number' => $order_number,
'amount' => $amount,
-
- #3.0 is a good a time as any to get rid of this... add a config to pass it
- # if anyone still needs it
- #'referer' => 'http://cleanwhisker.420.am/',
);
$content{authorization} = $auth
if length($auth); #echeck/ACH transactions have an order # but no auth