public function saveConfigurationAction(): void
{ $clientId =
$this->
Request()->
getParam('clientId'
);
$clientSecret =
$this->
Request()->
getParam('clientSecret'
);
$sandbox =
(bool) $this->
Request()->
getParam('sandbox'
);
$payPalPlusEnabled =
(bool) $this->
Request()->
getParam('payPalPlus'
);
if (!
class_exists('\SwagPaymentPayPalUnified\Setup\FirstRunWizardInstaller'
)) { throw new Exception(sprintf('Class %s does not exist.', '\SwagPaymentPayPalUnified\Setup\FirstRunWizardInstaller'
));
} $payPalInstaller =
new FirstRunWizardInstaller();
$payPalInstaller->
saveConfiguration($this->
get('dbal_connection'
),
[ 'clientId' =>
$clientId,
'clientSecret' =>
$clientSecret,
'sandbox' =>
$sandbox,
'payPalPlusEnabled' =>
$payPalPlusEnabled,
]);
$this->
View()->
assign([ 'success' => true,
]);
}