Fix bug #10914.
Move email notifications about of PayDriver and into Transaction. Send a notification when the cart value is 0 due to shop credit.
This commit is contained in:
parent
e46ad0d8fd
commit
b3858ef250
12 changed files with 206 additions and 150 deletions
|
|
@ -22,7 +22,8 @@ use Getopt::Long;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::Asset;
|
||||
|
||||
use WebGUI::Shop::Pay;
|
||||
use WebGUI::Shop::PayDriver;
|
||||
|
||||
my $toVersion = '7.8.2';
|
||||
my $quiet; # this line required
|
||||
|
|
@ -32,6 +33,7 @@ my $session = start(); # this line required
|
|||
|
||||
fixTableDefaultCharsets($session);
|
||||
correctWikiAttachmentPermissions( $session );
|
||||
transactionsNotifications( $session );
|
||||
|
||||
finish($session); # this line required
|
||||
|
||||
|
|
@ -99,6 +101,31 @@ sub correctWikiAttachmentPermissions {
|
|||
print "Done.\n" unless $quiet;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Describe what our function does
|
||||
sub transactionsNotifications {
|
||||
my $session = shift;
|
||||
print "\tMove Shop notifications from PayDriver to Transactions... " unless $quiet;
|
||||
my $pay = WebGUI::Shop::Pay->new($session);
|
||||
my $gateways = $pay->getPaymentGateways;
|
||||
my $defaultNotificationGroup = '3';
|
||||
my $defaultTemplate = 'bPz1yk6Y9uwMDMBcmMsSCg';
|
||||
if (@{ $gateways }) {
|
||||
my $firstGateway = $gateways->[0];
|
||||
$defaultNotificationGroup = $firstGateway->get('saleNotificationGroupId');
|
||||
$defaultTemplate = $firstGateway->get('receiptEmailTemplateId' );
|
||||
foreach my $gateway (@{ $gateways }) {
|
||||
my $properties = $gateway->get();
|
||||
delete $properties->{ saleNotificationGroupId };
|
||||
delete $properties->{ receiptEmailTemplateId };
|
||||
$gateway->update($properties);
|
||||
}
|
||||
}
|
||||
$session->setting->add('shopSaleNotificationGroupId', $defaultNotificationGroup);
|
||||
$session->setting->add('shopReceiptEmailTemplateId', $defaultTemplate);
|
||||
print "Done.\n" unless $quiet;
|
||||
}
|
||||
|
||||
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue