fixed issue with ITransact gateway throwing error if user does not explicitly set a billing address

This commit is contained in:
Doug Bell 2008-08-09 03:25:55 +00:00
parent 27cd075753
commit 9ecb69ac94
2 changed files with 14 additions and 5 deletions

View file

@ -608,11 +608,14 @@ sub www_getCredentials {
my $u = WebGUI::User->new($self->session,$self->session->user->userId);
# Process address from address book if passed
my $addressId = $session->form->process('addressId');
my $addressData = {};
my $addressId = $session->form->process( 'addressId' );
my $addressData;
if ( $addressId ) {
$addressData = eval{ $self->getAddress( $addressId )->get() } || {};
}
else {
$addressData = $self->getCart->getShippingAddress;
}
my $output;
@ -704,9 +707,13 @@ sub www_getCredentials {
#-------------------------------------------------------------------
sub www_pay {
my $self = shift;
my $session = $self->session;
my $address = $self->getAddress( $session->form->process( 'addressId' ) );
my $self = shift;
my $session = $self->session;
my $addressId = $session->form->process( 'addressId' )
my $address = $addressId
? $self->getAddress( $addressId )
: $self->getCart->getShippingAddress
;
# Check whether the user filled in the checkout form and process those.
my $credentialsErrors = $self->processCredentials;