get('culqi_enable'); $action = isset($_GET['a']) ? $_GET['a'] : null; $em = Database::getManager(); switch ($action) { case 'verifyPaypal': if (api_is_anonymous()) { break; } $userId = isset($_POST['id']) ? (int) $_POST['id'] : ''; $isUserHavePaypalAccount = $plugin->verifyPaypalAccountByBeneficiary($userId); if ($isUserHavePaypalAccount) { echo ''; } else { echo '* '.$plugin->get_lang('NoPayPalAccountDetected').''; } break; case 'saleInfo': if (api_is_anonymous()) { break; } $saleId = isset($_POST['id']) ? (int) $_POST['id'] : ''; $sale = $plugin->getSale($saleId); $productType = $sale['product_type'] == 1 ? get_lang('Course') : get_lang('Session'); $paymentType = $sale['payment_type'] == 1 ? 'Paypal' : $plugin->get_lang('BankTransfer'); $productInfo = $sale['product_type'] == 1 ? api_get_course_info_by_id($sale['product_id']) : api_get_session_info($sale['product_id']); $currency = $plugin->getSelectedCurrency(); if ($sale['product_type'] == 1) { $productImage = $productInfo['course_image_large']; } else { $productImage = ($productInfo['image']) ? $productInfo['image'] : Template::get_icon_path('session_default.png'); } $userInfo = api_get_user_info($sale['user_id']); $html = '
' .'
'.get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin").'
'; $html .= '' .'' .'
'.get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin").'
'; $html .= '