Refactor out a default www_getCredentials all the way back to PayDriver, to be used by Cash and the PayPal brothers.
This commit is contained in:
parent
006d1efffc
commit
921f03c107
3 changed files with 68 additions and 75 deletions
|
|
@ -365,6 +365,19 @@ sub getAddress {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getButton ( )
|
||||
|
||||
Used for the generic, vanilla checkout form. Must be overridden by any methods that
|
||||
use the default www_getCredentials.
|
||||
|
||||
=cut
|
||||
|
||||
sub getButton {
|
||||
return '';
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getCart ( )
|
||||
|
||||
Returns the WebGUI::Shop::Cart object for the current session.
|
||||
|
|
@ -373,9 +386,7 @@ Returns the WebGUI::Shop::Cart object for the current session.
|
|||
|
||||
sub getCart {
|
||||
my $self = shift;
|
||||
|
||||
my $cart = WebGUI::Shop::Cart->newBySession( $self->session );
|
||||
|
||||
return $cart;
|
||||
}
|
||||
|
||||
|
|
@ -722,6 +733,40 @@ a GUID.
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_getCredentials ( )
|
||||
|
||||
Displays a summary of the cart, and a button to checkout. Plugins that need to get additional
|
||||
information, or perform additional checks, should override this method. Uses the getButton
|
||||
method to create the checkout button.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_getCredentials {
|
||||
my ($self) = @_;
|
||||
my $session = $self->session;
|
||||
|
||||
# Generate 'Proceed' button
|
||||
my $i18n = WebGUI::International->new($session, 'PayDriver_Cash');
|
||||
my $var = {
|
||||
proceedButton => $self->getButton,
|
||||
};
|
||||
$self->appendCartVariables($var);
|
||||
|
||||
my $template = WebGUI::Asset::Template->new($session, $self->get("summaryTemplateId"));
|
||||
my $output;
|
||||
if (defined $template) {
|
||||
$template->prepare;
|
||||
$output = $template->process($var);
|
||||
}
|
||||
else {
|
||||
$output = $i18n->get('template gone', 'PayDriver_ITransact');
|
||||
}
|
||||
|
||||
return $session->style->userStyle($output);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_edit ( )
|
||||
|
||||
Generates an edit form.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue