Fix a bug where the ITransact credentials template was not defined for plugins.
This prevented any credit card transactions from taking place.
This commit is contained in:
parent
c9dda0412c
commit
eeef2fb330
5 changed files with 37 additions and 5 deletions
Binary file not shown.
|
|
@ -20,6 +20,8 @@ use Getopt::Long;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::Shop::Pay;
|
||||
use WebGUI::Shop::PayDriver;
|
||||
|
||||
|
||||
my $toVersion = '7.6.8';
|
||||
|
|
@ -29,10 +31,31 @@ my $quiet; # this line required
|
|||
my $session = start(); # this line required
|
||||
|
||||
# upgrade functions go here
|
||||
|
||||
setDefaultItransactCredentialTemplate($session);
|
||||
finish($session); # this line required
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Describe what our function does
|
||||
sub setDefaultItransactCredentialTemplate {
|
||||
my $session = shift;
|
||||
print "\tSet default ITransact Credentials template if it is not set... " unless $quiet;
|
||||
# and here's our code
|
||||
my $pay = WebGUI::Shop::Pay->new($session);
|
||||
my $drivers = $pay->getPaymentGateways($session);
|
||||
DRIVER: foreach my $driver (@{ $drivers }) {
|
||||
##Only work on ITransact drivers
|
||||
next DRIVER unless $driver->className eq "WebGUI::Shop::PayDriver::ITransact";
|
||||
my $properties = $driver->get();
|
||||
##And only ones that don't already have a template set
|
||||
next DRIVER if $properties->{credentialsTemplateId};
|
||||
$properties->{credentialsTemplateId} = 'itransact_credentials1';
|
||||
$driver->update($properties);
|
||||
}
|
||||
|
||||
print "DONE!\n" unless $quiet;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Describe what our function does
|
||||
#sub exampleFunction {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue