transaction manager working

This commit is contained in:
JT Smith 2008-05-20 21:00:00 +00:00
parent 6139073807
commit 75c44c110f
4 changed files with 125 additions and 65 deletions

View file

@ -147,7 +147,7 @@ Returns the money from this item to the user in the form of in-store credit.
sub issueCredit {
my $self = shift;
my $credit = WebGUI::Shop::Credit->new($self->transaction->session, $self->transaction->get('userId'));
$credit->adjust($self->get('price'), "Issued credit on sku ".$self->get('assetId')." for transaction item ".$self->getId." on transaction ".$self->transaction->getId);
$credit->adjust(($self->get('price') * $self->get('quantity')), "Issued credit on sku ".$self->get('assetId')." for transaction item ".$self->getId." on transaction ".$self->transaction->getId);
$self->getSku->onRefund($self);
$self->update({orderStatus=>'Cancelled'});
}