Handle $0 checkouts. Still requires that ANY payment plugin be selected.
This commit is contained in:
parent
e9313959eb
commit
674b299069
1 changed files with 8 additions and 0 deletions
|
|
@ -913,6 +913,14 @@ sub www_update {
|
||||||
$self->update({shippingAddressId => $self->get('billingAddressId')});
|
$self->update({shippingAddressId => $self->get('billingAddressId')});
|
||||||
}
|
}
|
||||||
if ($self->readyForCheckout()) {
|
if ($self->readyForCheckout()) {
|
||||||
|
my $total = $self->calculateTotal;
|
||||||
|
if (sprintf('%.2f', $total + $self->calculateShopCreditDeduction($total)) eq '0.00') {
|
||||||
|
my $transaction = WebGUI::Shop::Transaction->create($session, {self => $self});
|
||||||
|
$transaction->completePurchase('zero', 'success', 'success');
|
||||||
|
$self->onCompletePurchase;
|
||||||
|
$transaction->sendNotifications();
|
||||||
|
return $transaction->thankYou();
|
||||||
|
}
|
||||||
my $gateway = WebGUI::Shop::Pay->new($session)->getPaymentGateway($self->get('gatewayId'));
|
my $gateway = WebGUI::Shop::Pay->new($session)->getPaymentGateway($self->get('gatewayId'));
|
||||||
return $gateway->www_getCredentials;
|
return $gateway->www_getCredentials;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue