From 9ecb69ac94c52cf632f49ec8849662b31f97d69c Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Sat, 9 Aug 2008 03:25:55 +0000 Subject: [PATCH] fixed issue with ITransact gateway throwing error if user does not explicitly set a billing address --- docs/changelog/7.x.x.txt | 2 ++ lib/WebGUI/Shop/PayDriver/ITransact.pm | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index f034349e3..781be057b 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -6,6 +6,8 @@ Tests were updated, but need are still lacking and need a major overhaul. - fixed: ITransact error message now shows a link to go back to checkout - fixed: Gallery image information now does not overlap the snapshot. Changed css .wgSnapshot to be 25% vs 20%. + - fixed: ITransact now defaults to using shipping address for billing address. This prevents an + issue when users neglect to select a proper billing address. 7.5.19 - fixed: paginator doesn't show correct number of page links with a limit applied diff --git a/lib/WebGUI/Shop/PayDriver/ITransact.pm b/lib/WebGUI/Shop/PayDriver/ITransact.pm index e22e74e6a..d53917f7b 100644 --- a/lib/WebGUI/Shop/PayDriver/ITransact.pm +++ b/lib/WebGUI/Shop/PayDriver/ITransact.pm @@ -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;