EMS Checkout code
This commit is contained in:
parent
84d43b8d19
commit
8288cfaa6b
4 changed files with 76 additions and 13 deletions
|
|
@ -37,6 +37,23 @@ sub description {
|
|||
return $_[0]->{_event}->{description};
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub handler {
|
||||
my $self = shift;
|
||||
my $transactionId = shift;
|
||||
#mark all purchaseIds as paid
|
||||
my $counter = 0;
|
||||
while (1) {
|
||||
my $purchaseId;
|
||||
if ($purchaseId = $self->session->scratch->get("purchaseId".$counter)) {
|
||||
$self->session->db->setRow('EventManagementSystem_purchases', 'purchaseId', {'purchaseId'=>$purchaseId, 'transactionId'=>$transactionId}, $purchaseId);
|
||||
$self->session->scratch->delete("purchaseId".$counter);
|
||||
$counter++;
|
||||
}
|
||||
else { last; }
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub id {
|
||||
return $_[0]->{_event}->{productId};
|
||||
|
|
@ -83,6 +100,12 @@ sub price {
|
|||
return $_[0]->{_event}->{price};
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub session {
|
||||
my $self = shift;
|
||||
return $self->{_session};
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub type {
|
||||
return 'Event';
|
||||
|
|
|
|||
|
|
@ -103,7 +103,8 @@ sub completeTransaction {
|
|||
|
||||
foreach (@{$self->getItems}) {
|
||||
$item = WebGUI::Commerce::Item->new($self->session,$_->{itemId}, $_->{itemType});
|
||||
$item->handler;
|
||||
$item->handler($_->{transactionId});
|
||||
#$item->handler;
|
||||
}
|
||||
|
||||
$self->status('Completed');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue