diff --git a/plugin/buycourses/src/service_process.php b/plugin/buycourses/src/service_process.php index 6787091352..e13421b670 100644 --- a/plugin/buycourses/src/service_process.php +++ b/plugin/buycourses/src/service_process.php @@ -35,6 +35,8 @@ $includeServices = $plugin->get('include_services'); $paypalEnabled = $plugin->get('paypal_enable') === 'true'; $transferEnabled = $plugin->get('transfer_enable') === 'true'; $culqiEnabled = $plugin->get('culqi_enable') === 'true'; +$tpvRedsysEnable = $plugin->get('tpv_redsys_enable') === 'true'; +$stripeEnable = $plugin->get('stripe_enable') === 'true'; $additionalQueryString = ''; if ($includeServices !== 'true') { api_not_allowed(true); @@ -68,7 +70,13 @@ if (!$transferEnabled) { if (!$culqiEnabled) { unset($paymentTypesOptions[BuyCoursesPlugin::PAYMENT_TYPE_CULQI]); } +if (!$tpvRedsysEnable || !file_exists(api_get_path(SYS_PLUGIN_PATH).'buycourses/resources/apiRedsys.php')) { + unset($paymentTypesOptions[BuyCoursesPlugin::PAYMENT_TYPE_TPV_REDSYS]); +} +if (!$stripeEnable) { + unset($paymentTypesOptions[BuyCoursesPlugin::PAYMENT_TYPE_STRIPE]); +} $form->addHtml( Display::return_message( $plugin->get_lang('PleaseSelectThePaymentMethodBeforeConfirmYourOrder'),