From c01d4e89c451208b01db2854395b5b459e73cd57 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 6 Aug 2008 01:01:59 +0000 Subject: [PATCH] add default values to existing, default Payment drivers --- docs/changelog/7.x.x.txt | 1 + docs/upgrades/upgrade_7.5.18-7.5.19.pl | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index fe665c332..7d76c2d8a 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -27,6 +27,7 @@ - fixed: Thingy fields list on view screen tab - fixed: Importing data into Thingy that has newlines embedded in fields - fixed: Keywords field is not available in collaboration system post template + - fixed: Payment Gateway creation bug 7.5.18 - fixed: Collateral Image Manager broken in Firefox 3 diff --git a/docs/upgrades/upgrade_7.5.18-7.5.19.pl b/docs/upgrades/upgrade_7.5.18-7.5.19.pl index 417f638ee..68340a7a2 100644 --- a/docs/upgrades/upgrade_7.5.18-7.5.19.pl +++ b/docs/upgrades/upgrade_7.5.18-7.5.19.pl @@ -33,7 +33,7 @@ addNewInboxIndexes( $session ); updateAddressTable( $session ); addProductShipping( $session ); addGalleryImageDensity( $session ); -correctPayDriverReceiptTemplate( $session ); +updatePaymentDrivers( $session ); finish($session); # this line required @@ -61,7 +61,7 @@ sub addGalleryImageDensity { #---------------------------------------------------------------------------- # Corrects the asset id of the default receipt email template for the PayDriver -sub correctPayDriverReceiptTemplate{ +sub updatePaymentDrivers{ my $session = shift; #Grab all PaymentDriver id's. @@ -69,8 +69,24 @@ sub correctPayDriverReceiptTemplate{ for my $id(@ids){ my $paymentGateway = WebGUI::Shop::PayDriver->new($session,$id); my $options = $paymentGateway->get(); + my $needsUpdated = 0; if($options->{'receiptEmailTemplateId'} eq 'BMzuE91-XB8E-XGll1zpvA'){ $options->{'receiptEmailTemplateId'} = 'bPz1yk6Y9uwMDMBcmMsSCg'; + $needsUpdated = 1; + } + if ( exists $options->{'groupToUse'} and !defined $options->{'groupToUse'}) { + $options->{'groupToUse'} = 7; #Everyone + $needsUpdated = 1; + } + if ( !exists $options->{'saleNotificationGroupId'} ) { + $options->{'saleNotificationGroupId'} = 3; #Admins + $needsUpdated = 1; + } + if ( !exists $options->{'enabled'} ) { + $options->{'enabled'} = 1; #on + $needsUpdated = 1; + } + if ($needsUpdated) { $paymentGateway->update($options); } }