Put transactioon handling in the wrong place.

This commit is contained in:
Martin Kamerbeek 2008-03-24 16:43:50 +00:00
parent fb77b80603
commit 4b62a0d7c8

View file

@ -175,14 +175,6 @@ sub www_pay {
my $billingAddress = $self->getBillingAddress( $session->scratch->get( 'ShopPayDriverCash_billingAddressId' ) );
# Create a transaction and complete the purchase
my $transaction = WebGUI::Shop::Transaction->create( $session, {
cart => $cart,
paymentAddress => $billingAddress,
paymentMethod => $self,
});
$transaction->completePurchase( $cart, 'CASH', 'OK', 'Cash payment' );
# Generate a receipt and send it if enabled.
if ( $self->get('sendReceipt') ) {
# Setup receipt tmpl_vars
@ -205,6 +197,14 @@ sub www_pay {
}
# Create a transaction and complete the purchase
my $transaction = WebGUI::Shop::Transaction->create( $session, {
cart => $cart,
paymentAddress => $billingAddress,
paymentMethod => $self,
});
$transaction->completePurchase( $cart, 'CASH', 'OK', 'Cash payment' );
return $session->style->userStyle('Thank you for ordering');
}