Hide inactive payment methods

pull/4213/head
Nosolored SL 4 years ago committed by GitHub
parent d53915782c
commit e80a3302e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      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'),

Loading…
Cancel
Save