Put back a www_checkout method, to be used by the Payment plugin when displaying upstream errors. Fixes bug #11584.
This commit is contained in:
parent
16927cd916
commit
760abafd9c
2 changed files with 35 additions and 18 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
- added #9774: More owner information in the gallery
|
- added #9774: More owner information in the gallery
|
||||||
- fixed #11581: Calendar problems
|
- fixed #11581: Calendar problems
|
||||||
- fixed #11583: EMS: Tokens do not follow their permissions
|
- fixed #11583: EMS: Tokens do not follow their permissions
|
||||||
|
- fixed #11584: Errors on checkout when payment problems occur
|
||||||
|
|
||||||
7.9.5
|
7.9.5
|
||||||
- Asset->www_copy now has a progress bar
|
- Asset->www_copy now has a progress bar
|
||||||
|
|
|
||||||
|
|
@ -905,6 +905,38 @@ sub www_ajaxSetCartItemShippingId {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_checkout ( )
|
||||||
|
|
||||||
|
All checks and work for checking out are contained in here.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub www_checkout {
|
||||||
|
my $self = shift;
|
||||||
|
my $session = $self->session;
|
||||||
|
##Setting a shipping address greatly simplifies the Transaction
|
||||||
|
if (! $self->requiresShipping && ! $self->get('shippingAddressId')) {
|
||||||
|
$self->update({shippingAddressId => $self->get('billingAddressId')});
|
||||||
|
}
|
||||||
|
if ($self->readyForCheckout()) {
|
||||||
|
my $total = $self->calculateTotal;
|
||||||
|
##Handle rounding errors, and checkout immediately if the amount is 0 since
|
||||||
|
##at least the ITransact driver won't accept $0 checkout.
|
||||||
|
if (sprintf('%.2f', $total + $self->calculateShopCreditDeduction($total)) eq '0.00') {
|
||||||
|
my $transaction = WebGUI::Shop::Transaction->create($session, {cart => $self});
|
||||||
|
$transaction->completePurchase('zero', 'success', 'success');
|
||||||
|
$self->onCompletePurchase;
|
||||||
|
$transaction->sendNotifications();
|
||||||
|
return $transaction->thankYou();
|
||||||
|
}
|
||||||
|
my $gateway = $self->getPaymentGateway;
|
||||||
|
return $gateway->www_getCredentials;
|
||||||
|
}
|
||||||
|
return $self->www_view;
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 www_lookupPosUser ( )
|
=head2 www_lookupPosUser ( )
|
||||||
|
|
||||||
Adds a Point of Sale user to the cart.
|
Adds a Point of Sale user to the cart.
|
||||||
|
|
@ -950,24 +982,8 @@ sub www_update {
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
elsif ($session->form->get('checkout')) {
|
elsif ($session->form->get('checkout')) {
|
||||||
##Setting a shipping address greatly simplifies the Transaction
|
##Shortcut method for checkout, so that the cart form contents don't get lost.
|
||||||
if (! $self->requiresShipping && ! $self->get('shippingAddressId')) {
|
return $self->www_checkout();
|
||||||
$self->update({shippingAddressId => $self->get('billingAddressId')});
|
|
||||||
}
|
|
||||||
if ($self->readyForCheckout()) {
|
|
||||||
my $total = $self->calculateTotal;
|
|
||||||
##Handle rounding errors, and checkout immediately if the amount is 0 since
|
|
||||||
##at least the ITransact driver won't accept $0 checkout.
|
|
||||||
if (sprintf('%.2f', $total + $self->calculateShopCreditDeduction($total)) eq '0.00') {
|
|
||||||
my $transaction = WebGUI::Shop::Transaction->create($session, {cart => $self});
|
|
||||||
$transaction->completePurchase('zero', 'success', 'success');
|
|
||||||
$self->onCompletePurchase;
|
|
||||||
$transaction->sendNotifications();
|
|
||||||
return $transaction->thankYou();
|
|
||||||
}
|
|
||||||
my $gateway = $self->getPaymentGateway;
|
|
||||||
return $gateway->www_getCredentials;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $self->www_view;
|
return $self->www_view;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue