Use a default, in case the source payment plugin is misconfigured.

This commit is contained in:
Colin Kuskie 2009-11-05 12:32:45 -08:00
parent ad2376fe4e
commit 2c5c2ea5ee

View file

@ -132,8 +132,8 @@ sub transactionsNotifications {
my $defaultTemplate = 'bPz1yk6Y9uwMDMBcmMsSCg';
if (@{ $gateways }) {
my $firstGateway = $gateways->[0];
$defaultNotificationGroup = $firstGateway->get('saleNotificationGroupId');
$defaultTemplate = $firstGateway->get('receiptEmailTemplateId' );
$defaultNotificationGroup ||= $firstGateway->get('saleNotificationGroupId');
$defaultTemplate ||= $firstGateway->get('receiptEmailTemplateId' );
foreach my $gateway (@{ $gateways }) {
my $properties = $gateway->get();
delete $properties->{ saleNotificationGroupId };