un-b0rk3d the commerce system
This commit is contained in:
parent
0ee2d2ad66
commit
84d43b8d19
4 changed files with 10 additions and 9 deletions
|
|
@ -128,7 +128,7 @@ sub checkoutForm {
|
|||
|
||||
$i18n = WebGUI::International->new($self->session, 'CommercePaymentITransact');
|
||||
|
||||
$u = WebGUI::User->new($self->session->user->userId);
|
||||
$u = WebGUI::User->new($self->session,$self->session->user->userId);
|
||||
|
||||
$f = WebGUI::HTMLForm->new($self->session);
|
||||
$f->text(
|
||||
|
|
@ -622,7 +622,7 @@ sub normalTransaction {
|
|||
$self->{_recurring} = 0;
|
||||
$self->{_transactionParams} = {
|
||||
AMT => sprintf('%.2f', $normal->{amount}),
|
||||
DESCRIPTION => WebGUI::URL::escape($normal->{description}) || $i18n->get('no description'),
|
||||
DESCRIPTION => $self->session->url->escape($normal->{description}) || $i18n->get('no description'),
|
||||
INVOICENUMBER => $normal->{invoiceNumber},
|
||||
ORGID => $normal->{id},
|
||||
};
|
||||
|
|
@ -650,7 +650,7 @@ sub recurringTransaction {
|
|||
INITIALAMT => sprintf('%.2f', $initialAmount),
|
||||
TERM => $recurring->{term} || 9999,
|
||||
RECIPE => _resolveRecipe($recurring->{payPeriod}),
|
||||
DESCRIPTION => WebGUI::URL::escape($recurring->{description}) || $i18n->get('no description'),
|
||||
DESCRIPTION => $self->session->url->escape($recurring->{description}) || $i18n->get('no description'),
|
||||
INVOICENUMBER => $recurring->{invoiceNumber},
|
||||
ORGID => $recurring->{id},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ Returns the cached, local session variable.
|
|||
=cut
|
||||
|
||||
sub session {
|
||||
my ($self) = @_;
|
||||
my $self = shift;
|
||||
return $self->{_session};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -383,8 +383,9 @@ sub www_checkoutSubmit {
|
|||
|
||||
# Write transaction to the log with status pending
|
||||
$transaction = WebGUI::Commerce::Transaction->new($session, 'new');
|
||||
|
||||
foreach (@{$currentPurchase->{items}}) {
|
||||
$transaction->addItem($_->{item}, $_->{quantity});
|
||||
$transaction->addItem($_->{item}, $_->{quantity});
|
||||
$amount += ($_->{item}->price * $_->{quantity});
|
||||
$var->{purchaseDescription} .= $_->{quantity}.' x '.$_->{item}->name.'<br />';
|
||||
}
|
||||
|
|
@ -451,10 +452,10 @@ sub www_checkoutSubmit {
|
|||
_clearCheckoutScratch($session);
|
||||
|
||||
# If everythings ok show the purchase history
|
||||
return WebGUI::Operation::execute($session,'viewPurchaseHistory') unless ($checkoutError);
|
||||
|
||||
return WebGUI::Operation::TransactionLog::www_viewPurchaseHistory($session) unless ($checkoutError);
|
||||
|
||||
# If an error has occurred show the template errorlog
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session,$session->setting->get("commerceTransactionErrorTemplateId"))->process(\%param));
|
||||
return $session->style->userStyle(WebGUI::Asset->newByDynamicClass($session,$session->setting->get("commerceTransactionErrorTemplateId"))->process(\%param));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ sub www_viewPurchaseHistory {
|
|||
|
||||
$var{errorMessage} = shift;
|
||||
|
||||
@history = @{WebGUI::Commerce::Transaction->transactionsByUser($session->user->userId)};
|
||||
@history = @{WebGUI::Commerce::Transaction->new($session)->transactionsByUser($session->user->userId)};
|
||||
foreach (@history) {
|
||||
%properties = %{$_->get};
|
||||
$properties{initDate} = $session->datetime->epochToHuman($properties{initDate});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue