From 4b62a0d7c8a8f22d95a795e9b6e18faa7eb8f7a4 Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Mon, 24 Mar 2008 16:43:50 +0000 Subject: [PATCH] Put transactioon handling in the wrong place. --- lib/WebGUI/Shop/PayDriver/Cash.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/WebGUI/Shop/PayDriver/Cash.pm b/lib/WebGUI/Shop/PayDriver/Cash.pm index fd24194a4..5f3d2a53e 100644 --- a/lib/WebGUI/Shop/PayDriver/Cash.pm +++ b/lib/WebGUI/Shop/PayDriver/Cash.pm @@ -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'); }