remove www_selectPaymentGateway, and www_checkout which are now dead code
This commit is contained in:
parent
674b299069
commit
6fe302774c
2 changed files with 0 additions and 82 deletions
|
|
@ -784,24 +784,6 @@ sub updateFromForm {
|
|||
$self->update( $cartProperties );
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
#
|
||||
#=head2 www_checkout ( )
|
||||
#
|
||||
#Update the cart and then redirect the user to the payment gateway screen.
|
||||
#
|
||||
#=cut
|
||||
#
|
||||
#sub www_checkout {
|
||||
# my $self = shift;
|
||||
# $self->updateFromForm;
|
||||
# if ($error{id $self} ne "") {
|
||||
# return $self->www_view;
|
||||
# }
|
||||
# $self->session->http->setRedirect($self->session->url->page('shop=pay;method=selectPaymentGateway'));
|
||||
# return undef;
|
||||
#}
|
||||
#
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_continueShopping ( )
|
||||
|
|
|
|||
|
|
@ -366,68 +366,4 @@ sub www_manage {
|
|||
return $console->render($output, $i18n->get("payment methods"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_selectPaymentGateway ( )
|
||||
|
||||
The screen in which a customer chooses a payment gateway.
|
||||
|
||||
TODO: Template this screen.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_selectPaymentGateway {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
||||
my $cart = WebGUI::Shop::Cart->newBySession( $session );
|
||||
my $i18n = WebGUI::International->new( $session, 'Shop' );
|
||||
|
||||
# Make sure the user is logged in.
|
||||
if ($session->user->isVisitor) {
|
||||
$session->scratch->set( 'redirectAfterLogin', $session->url->page('shop=pay;method=selectPaymentGateway') );
|
||||
|
||||
# We cannot use WebGUI::Operation::execute( $session, 'auth'); because the method form param used by the
|
||||
# Shop contenthandler overrides the method param used by WG::Op::Auth
|
||||
$session->http->setRedirect( $session->url->page('op=auth;method=init') );
|
||||
|
||||
# If the redirect fails make sure people can still go to the login screen by giving them a link
|
||||
return $session->style->userStyle(
|
||||
sprintf $i18n->get('login message'), $session->url->page('op=auth;method=init')
|
||||
);
|
||||
}
|
||||
|
||||
# Check if the cart is ready for checkout
|
||||
unless ($cart->readyForCheckout) {
|
||||
$session->http->setRedirect( $session->url->page('shop=cart;method=view') );
|
||||
return '';
|
||||
}
|
||||
|
||||
# Complete Transaction if it's a $0 transaction.
|
||||
my $total = $cart->calculateTotal;
|
||||
if (sprintf('%.2f', $total + $cart->calculateShopCreditDeduction($total)) eq '0.00') {
|
||||
my $transaction = WebGUI::Shop::Transaction->create($session, {cart => $cart});
|
||||
$transaction->completePurchase('zero', 'success', 'success');
|
||||
$cart->onCompletePurchase;
|
||||
$transaction->sendNotifications();
|
||||
return $transaction->thankYou();
|
||||
}
|
||||
|
||||
# All the output stuff below is just a placeholder until it's templated.
|
||||
my $payOptions = $self->getOptions( $cart );
|
||||
|
||||
# TODO: If only one payOption exists, just send us there
|
||||
# In order to do this, the PayDriver must give us a direct URL to go to
|
||||
|
||||
my $var;
|
||||
my @paymentGateways;
|
||||
foreach my $payOption ( values %{$payOptions} ) {
|
||||
push @paymentGateways, $payOption;
|
||||
}
|
||||
$var->{ paymentGateways } = \@paymentGateways;
|
||||
$var->{ choose } = $i18n->get('choose payment gateway message');
|
||||
my $template = WebGUI::Asset::Template->new($session, $session->setting->get("selectGatewayTemplateId"));
|
||||
return $session->style->userStyle($template->process($var));
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue