Put transactioon handling in the wrong place.
This commit is contained in:
parent
fb77b80603
commit
4b62a0d7c8
1 changed files with 8 additions and 8 deletions
|
|
@ -175,14 +175,6 @@ sub www_pay {
|
||||||
|
|
||||||
my $billingAddress = $self->getBillingAddress( $session->scratch->get( 'ShopPayDriverCash_billingAddressId' ) );
|
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.
|
# Generate a receipt and send it if enabled.
|
||||||
if ( $self->get('sendReceipt') ) {
|
if ( $self->get('sendReceipt') ) {
|
||||||
# Setup receipt tmpl_vars
|
# 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');
|
return $session->style->userStyle('Thank you for ordering');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue