• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getBaseUrl函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getBaseUrl函数的典型用法代码示例。如果您正苦于以下问题:PHP getBaseUrl函数的具体用法?PHP getBaseUrl怎么用?PHP getBaseUrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getBaseUrl函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: ea_email_sent_shortcode

function ea_email_sent_shortcode()
{
    ob_start();
    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    // Reading from superglobals
    $tCallerSkypeNameSg = esc_sql($_POST["skype_name"]);
    // ..verifying that the skype name exists
    if (verifyUserNameExists($tCallerSkypeNameSg) === false) {
        echo "<h3><i><b>Incorrect Skype name</b> - email not sent. Please go back and try again.</i></h3>";
        exit;
    }
    $tLengthNr = $_POST["length"];
    if (is_numeric($tLengthNr) === false) {
        handleError("Length variable was not numeric - possible SQL injection attempt");
    }
    // Setting up variables based on the superglobals
    $tCallerIdNr = getIdByUserName($tCallerSkypeNameSg);
    $tUniqueDbIdentifierSg = uniqid("id-", true);
    // http://php.net/manual/en/function.uniqid.php
    $tCallerDisplayNameSg = getDisplayNameById($tCallerIdNr);
    $tCallerEmailSg = getEmailById($tCallerIdNr);
    $tEmpathizerDisplayNameSg = getDisplayNameById(get_current_user_id());
    // If this is the first call: reduce the donation amount.
    $tAdjustedLengthNr = $tLengthNr;
    if (isFirstCall($tCallerIdNr) == true) {
        $tAdjustedLengthNr = $tAdjustedLengthNr - Constants::initial_call_minute_reduction;
    }
    $tRecDonationNr = (int) round(get_donation_multiplier() * $tAdjustedLengthNr);
    // Create the contents of the email message.
    $tMessageSg = "Hi " . $tCallerDisplayNameSg . ",\n\nThank you so much for your recent empathy call! Congratulations on contributing to a more empathic world. :)\n\nYou talked with: {$tEmpathizerDisplayNameSg}\nYour Skype session duration was: {$tLengthNr} minutes\nYour recommended contribution is: \${$tRecDonationNr}\n\nPlease follow this link to complete payment within 24 hours: " . getBaseUrl() . pages::donation_form . "?recamount={$tRecDonationNr}&dbToken={$tUniqueDbIdentifierSg}\n\nSee you next time!\n\nThe Empathy Team\n\nPS\nIf you have any feedback please feel free to reply to this email and tell us your ideas or just your experience!\n";
    // If the donation is greater than 0: send an email to the caller.
    if ($tRecDonationNr > 0) {
        ea_send_email($tCallerEmailSg, "Empathy App Payment", $tMessageSg);
        echo "<h3>Email successfully sent to caller.</h3>";
    } else {
        echo "<h4>No email sent: first time caller and call length was five minutes or less.</h4>";
    }
    // Add a new row to the db CallRecords table.
    db_insert(array(DatabaseAttributes::date_and_time => current_time('mysql', 1), DatabaseAttributes::recommended_donation => $tRecDonationNr, DatabaseAttributes::call_length => $tLengthNr, DatabaseAttributes::database_token => $tUniqueDbIdentifierSg, DatabaseAttributes::caller_id => $tCallerIdNr, DatabaseAttributes::empathizer_id => get_current_user_id()));
    $ob_content = ob_get_contents();
    //+++++++++++++++++++++++++++++++++++++++++
    ob_end_clean();
    return $ob_content;
}
开发者ID:Wizek,项目名称:EmpathyApp,代码行数:44,代码来源:email-sent_sc.php


示例2: performLogout

function performLogout()
{
    $expire = time() - 60 * 60 * 24 * 365;
    $domainName = getDomainName();
    setcookie(COOKIE_SESSION_ID, "", $expire, "/", $domainName);
    header("Location: " . getBaseUrl() . "/");
}
开发者ID:jan-berge-ommedal,项目名称:Thin-PHP-Backend,代码行数:7,代码来源:auth.php


示例3: startPayment

 /**
  * @return Payment
  * @throws CheckoutException
  */
 public function startPayment()
 {
     $total_amount = ($this->request->amount + $this->request->tax_amount - $this->request->discount_amount) * 100;
     $apiContext->setConfig(array('service.EndPoint' => "https://test-api.sandbox.paypal.com"));
     $payer = new Payer();
     $payer->setPaymentMethod('paypal');
     $item1 = new Item();
     $item1->setName('Product1')->setCurrency('EUR')->setPrice(10.0)->setQuantity(2)->setTax(3.0);
     $itemList = new ItemList();
     $itemList->setItems(array($item1));
     $details = new Details();
     $details->setShipping(1.2)->setTax(1.3)->setSubtotal(17.5);
     $amount = new Amount();
     $amount->setCurrency('EUR')->setTotal(20)->setDetails($details);
     $transaction = new Transaction();
     $transaction->setAmount($amount)->setItemList($itemList)->setDescription('Payment')->setInvoiceNumber('transactionid');
     $baseUrl = getBaseUrl();
     $redir = new RedirectUrls();
     $redir->setReturnUrl($baseUrl . '/');
     $redir->setCancelUrl($baseUrl . '/');
     $payment = new Payment();
     $payment->setIntent('sale')->setPayer($payer)->setRedirectUrls($redir)->setTransactions(array($transaction));
     $request = clone $payment;
     try {
         $payment->create($apiContext);
     } catch (\Exception $e) {
         throw new CheckoutException('Paypal error', 500, $e);
     }
     $approvalUrl = $payment->getApprovalLink();
     ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='{$approvalUrl}' >{$approvalUrl}</a>", $request, $payment);
     return $payment;
 }
开发者ID:kiberzauras,项目名称:laravel.checkout,代码行数:36,代码来源:PayPalGateway.php


示例4: __construct

 function __construct()
 {
     $this->settings['notify_url'] = getBaseUrl() . '/paypal_ipn/process';
     $this->settings['return'] = getBaseUrl() . '/payment-done';
     $this->testSettings['notify_url'] = getBaseUrl() . '/paypal_ipn/process';
     $this->testSettings['return'] = getBaseUrl() . '/payment-done';
 }
开发者ID:aaronesteban,项目名称:hostings,代码行数:7,代码来源:paypal_ipn_config.php


示例5: renderHeader

function renderHeader()
{
    global $base;
    echo $base[0];
    echo getBaseUrl();
    echo $base[1];
}
开发者ID:stoeffn,项目名称:abizeitung,代码行数:7,代码来源:render.php


示例6: test

function test()
{
    global $apiContext;
    // IncludeConfig('paypal/bootstrap.php');
    $payer = new Payer();
    $payer->setPaymentMethod("paypal");
    $item1 = new Item();
    $item1->setName('Ground Coffee 40 oz')->setCurrency('USD')->setQuantity(1)->setPrice(7.5);
    $item2 = new Item();
    $item2->setName('Granola bars')->setCurrency('USD')->setQuantity(5)->setPrice(2);
    $itemList = new ItemList();
    $itemList->setItems(array($item1, $item2));
    $details = new Details();
    $details->setShipping(1.2)->setTax(1.3)->setSubtotal(17.5);
    $amount = new Amount();
    $amount->setCurrency("USD")->setTotal(20)->setDetails($details);
    $transaction = new Transaction();
    $transaction->setAmount($amount)->setItemList($itemList)->setDescription("Payment description")->setInvoiceNumber(uniqid());
    $baseUrl = getBaseUrl();
    $redirectUrls = new RedirectUrls();
    $redirectUrls->setReturnUrl("{$baseUrl}/donate.php/execute_payment_test?success=true")->setCancelUrl("{$baseUrl}/donate.php/execute_payment_test?success=false");
    $payment = new Payment();
    $payment->setIntent("sale")->setPayer($payer)->setRedirectUrls($redirectUrls)->setTransactions(array($transaction));
    $request = clone $payment;
    try {
        $payment->create($apiContext);
    } catch (Exception $ex) {
        ResultPrinter::printError("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $ex);
        exit(1);
    }
    $approvalUrl = $payment->getApprovalLink();
    ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='{$approvalUrl}' >{$approvalUrl}</a>", $request, $payment);
    return $payment;
}
开发者ID:kayecandy,项目名称:secudev,代码行数:34,代码来源:donate.php


示例7: client_pydioAuth

/**
 * Pydio authentication
 *
 * @param  int $userId ftp username
 * @return bool FALSE on failure
 */
function client_pydioAuth($userId)
{
    if (file_exists(GUI_ROOT_DIR . '/data/tmp/failedAJXP.log')) {
        @unlink(GUI_ROOT_DIR . '/data/tmp/failedAJXP.log');
    }
    $credentials = _client_pydioGetLoginCredentials($userId);
    if (!$credentials) {
        set_page_message(tr('Unknown FTP user.'), 'error');
        return false;
    }
    $contextOptions = array();
    // Prepares Pydio absolute Uri to use
    if (isSecureRequest()) {
        $contextOptions = array('ssl' => array('verify_peer' => false, 'allow_self_signed' => true));
    }
    $pydioBaseUrl = getBaseUrl() . '/ftp/';
    $port = getUriPort();
    // Pydio authentication
    $context = stream_context_create(array_merge($contextOptions, array('http' => array('method' => 'GET', 'protocol_version' => '1.1', 'header' => array('Host: ' . $_SERVER['SERVER_NAME'] . ($port ? ':' . $port : ''), 'User-Agent: i-MSCP', 'Connection: close')))));
    # Getting secure token
    $secureToken = file_get_contents("{$pydioBaseUrl}/index.php?action=get_secure_token", false, $context);
    $postData = http_build_query(array('get_action' => 'login', 'userid' => $credentials[0], 'login_seed' => '-1', "remember_me" => 'false', 'password' => stripcslashes($credentials[1]), '_method' => 'put'));
    $contextOptions = array_merge($contextOptions, array('http' => array('method' => 'POST', 'protocol_version' => '1.1', 'header' => array('Host: ' . $_SERVER['SERVER_NAME'] . ($port ? ':' . $port : ''), 'Content-Type: application/x-www-form-urlencoded', 'X-Requested-With: XMLHttpRequest', 'Content-Length: ' . strlen($postData), 'User-Agent: i-MSCP', 'Connection: close'), 'content' => $postData)));
    stream_context_set_default($contextOptions);
    # TODO Parse the full response and display error message on authentication failure
    $headers = get_headers("{$pydioBaseUrl}?secure_token={$secureToken}", true);
    _client_pydioCreateCookies($headers['Set-Cookie']);
    redirectTo($pydioBaseUrl);
    exit;
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:36,代码来源:ftp_auth.php


示例8: commons_def

function commons_def($registry)
{
    $config = $registry->get('config');
    $urls = $config->get('config_ssl');
    $url = $config->get('config_url');
    $ssl = isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == '1');
    if (empty($url) && !$ssl) {
        $config->set('config_url', getBaseUrl());
    } else {
        if (empty($urls) && $ssl) {
            $config->set('config_ssl', getBaseUrl());
        }
    }
    if (!defined('HTTP_SERVER')) {
        define('HTTP_SERVER', $config->get('config_url'));
        if ($config->get('config_ssl')) {
            define('HTTPS_SERVER', 'https://' . substr($config->get('config_url'), 7));
        } else {
            define('HTTPS_SERVER', HTTP_SERVER);
        }
    }
    if (!defined('HTTP_IMAGE')) {
        define('HTTP_IMAGE', HTTP_SERVER . 'image/');
        if ($config->get('config_ssl')) {
            define('HTTPS_IMAGE', HTTPS_SERVER . 'image/');
        } else {
            define('HTTPS_IMAGE', HTTP_IMAGE);
        }
    }
    $version = get_project_version();
    define('KC_CART_VERSION', $version);
}
开发者ID:jemmy655,项目名称:OpenCart-API-service-by-Kancart.com-Mobile,代码行数:32,代码来源:common-functions.php


示例9: fillToWholePath

 public function fillToWholePath($path)
 {
     if (stristr($path, "http") < 0) {
         $filname = $path;
         $path = getBaseUrl() . "photo/" . $filname;
     }
     return $path;
 }
开发者ID:dreamingodd,项目名称:casarover,代码行数:8,代码来源:PicCache.php


示例10: createDefaultCache

 /**
  * While cache file not exists, create cache and file.
  * @param String $file_path
  * @return array of huge pics
  */
 private function createDefaultCache($file_path)
 {
     $json_str = '[{"area_id":8,"path":"' . getBaseUrl() . 'casarover/website/image/lbt/01.jpg"},' . '{"area_id":9,"path":"' . getBaseUrl() . 'casarover/website/image/lbt/02.jpg"}]';
     $cacheFile = fopen($this->filepath, 'w') or die('File: ' . $this->filepath . ' open failed!');
     fwrite($cacheFile, $json_str);
     fclose($cacheFile);
     return json_decode($json_str);
 }
开发者ID:dreamingodd,项目名称:casarover,代码行数:13,代码来源:HugePicsCache.php


示例11: __construct

 public function __construct($realm = null, $return_to = null)
 {
     global $SCOPES;
     global $CONSUMER_KEY;
     $this->openIdParams['openid.ext2.consumer'] = $CONSUMER_KEY;
     $this->openIdParams['openid.ext2.scope'] = implode('+', $SCOPES);
     $this->openIdParams['openid.return_to'] = $return_to ? $return_to : constructPageUrl();
     $this->openIdParams['openid.realm'] = $realm ? $realm : getBaseUrl();
 }
开发者ID:NareshPS,项目名称:LifeParserWeb,代码行数:9,代码来源:openIdAuth.php


示例12: getXnatViewOptions

/**
 * Gets the xnatview configuration options.  
 * 
 * Intended to be serialized to the client-side scripts, but may also be 
 * used for server-side options.  Session handling must be started 
 * for authentication info to be included.
 * 
 * @return array nested associative arrays
 */
function getXnatViewOptions()
{
    static $xnatview = null;
    if ($xnatview === null) {
        $base_url = getBaseUrl();
        $auth = $_SESSION['xnatview.authinfo'];
        if (!is_array($auth)) {
            $auth = array_fill_keys(array('user', 'pass', 'server'), '');
        }
        $xnatview_path = $base_url . '../python/xnatview_backend.py';
        // pass server options to included javascript
        $xnatview = array('config' => array('projectUrl' => "{$xnatview_path}/get_projects", 'subjectUrl' => "{$xnatview_path}/get_subjects", 'experimentUrl' => "{$xnatview_path}/get_experiments", 'scanUrl' => "{$xnatview_path}/get_scans", 'dicomUrl' => "{$xnatview_path}/get_dicom_scans", 'authUrl' => "{$xnatview_path}/authenticate", 'scanGalleryUrl' => $base_url . 'scan_gallery.php'));
    }
    return $xnatview;
}
开发者ID:dragonlet,项目名称:ZeroFootPrintImageViewer_XnatView,代码行数:24,代码来源:common.php


示例13: js_out

function js_out()
{
    $edit = (bool) $_REQUEST['edit'];
    $files = array(DOKU_INC . '/includes/scripts/events.js', DOKU_INC . '/includes/scripts/script.js', DOKU_INC . '/includes/scripts/domLib.js', DOKU_INC . '/includes/scripts/domTT.js');
    if ($edit) {
        $files[] = DOKU_INC . 'includes/scripts/edit.js';
    }
    ob_start();
    print "var DOKU_BASE   = '" . getBaseUrl() . "../admin/" . "';";
    foreach ($files as $file) {
        @readfile($file);
    }
    if ($edit) {
        require_once DOKU_INC . 'includes/toolbar.php';
        toolbar_JSdefines('toolbar');
    }
    $js = ob_get_contents();
    ob_end_clean();
    print $js;
}
开发者ID:BackupTheBerlios,项目名称:sitebe-svn,代码行数:20,代码来源:js.php


示例14: run

/**
 * Runs this installation script
 * @return null
 */
function run()
{
    $action = null;
    if (array_key_exists('action', $_GET)) {
        $action = $_GET['action'];
    }
    try {
        $baseUrl = getBaseUrl();
        $url = getBaseUrl() . str_replace(__DIR__, '', __FILE__);
        $content = '<p>This script will help you download and launch the latest Zibo installation.</p>';
        $requirements = checkRequirements();
        if ($requirements) {
            $content .= '<div class="error">';
            $content .= '<p>Not all requirements are met, please solve the following issues:</p>';
            $content .= '<ul>';
            foreach ($requirements as $requirement) {
                $content .= '<li>' . $requirement . '</li>';
            }
            $content .= '</ul>';
            $content .= '</div>';
            $content .= '<form action="' . $url . '"><input type="submit" value="Check again" /></form>';
        } else {
            if (!$action) {
                $content .= '<p class="success">All the requirements are met.</p>';
                $content .= '<p>The script is ready to download Zibo.</p>';
                $content .= '<p>Zibo download:<br /><code><a href="' . PACKAGE . '">' . PACKAGE . '</a></code></p>';
                $content .= '<p>Installation directory:<br /><code>' . getInstallationDirectory() . '</code></p>';
                $content .= '<form action="' . $url . '?action=download" method="post"><input type="submit" value="Proceed" /></form>';
            } elseif ($action == 'download') {
                downloadAndUnpack();
                header('Location: ' . $baseUrl);
            }
        }
    } catch (Exception $exception) {
        $content = '<div class="error"><pre>';
        $content .= $exception->getMessage() . "\n" . $exception->getTraceAsString();
        $content .= '</pre></div>';
    }
    echo renderOutput($content);
}
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:44,代码来源:install.php


示例15: ea_email_form_shortcode

function ea_email_form_shortcode()
{
    ob_start();
    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    // Check user access level.
    $tContributorBl = hasCurrentUserRole(array(WPUserRoles::contributor));
    if ($tContributorBl == false) {
        // Exit if not empathizer or admin.
        echo "<strong>Oops! This page is only for our empathizers</strong>";
        exit;
    }
    $tMaxLengthNr = floor(get_max_donation() / get_donation_multiplier());
    ?>


    <form
        id="empathizerForm"
        action=<?php 
    echo getBaseUrl() . pages::email_sent;
    ?>
        type="hidden"
        method="POST"
    >
        <label for="skype_name">Skype Name</label>
        <input name="skype_name" id="skype_name" type="text" style="display:block">
        <label for="length">Call Duration</label>
        <input name="length" id="length" type="number" pattern="\d*" min="1" max="<?php 
    echo $tMaxLengthNr;
    ?>
" style="display:block">
        <input type="submit" value="Send donation email to caller" id="submit" style="display:block">
    </form>


    <?php 
    $ob_content = ob_get_contents();
    //+++++++++++++++++++++++++++++++++++++++++
    ob_end_clean();
    return $ob_content;
}
开发者ID:Wizek,项目名称:EmpathyApp,代码行数:40,代码来源:email-form_sc.php


示例16: insertKey

    $_SESSION['orderinfo']['price'] = $amount;
    $_SESSION['orderinfo']['daylimit'] = (int) $prices['MonthNumber'] * 30;
    // Figure out what funding instruments are available for this buyer
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        try {
            $order = $_POST["order"];
            $id = $orderInfo['id'];
            /*  try {
                    $recoderId = insertKey($orderInfo["email"], $orderInfo["ime"], $orderInfo["deviceid"], $orderInfo["devicetype"]);
                } catch (Exception $ex) {
                    $message = $ex->getMessage();
                    $messageType = "error";
                }*/
            // Create the payment and redirect buyer to paypal for payment approval.
            if (isset($id)) {
                $baseUrl = getBaseUrl() . "/order_completion.php?orderid={$id}";
                $payment = makePaymentUsingPayPal($order['amount'], 'USD', sprintf("Payment license %s Months - \$%s ", $prices["MonthNumber"], $order['amount']), "{$baseUrl}&success=true", "{$baseUrl}&success=false");
                $_SESSION['orderinfo']['payment_id'] = $payment->getId();
                header("Location: " . getLink($payment->getLinks(), "approval_url"));
                exit;
            }
        } catch (\PayPal\Exception\PPConnectionException $ex) {
            $message = parseApiError($ex->getData());
            $messageType = "error";
        }
    }
}
?>
<!DOCTYPE html>
<html lang='en'>
    <head>
开发者ID:kenpi04,项目名称:apidemo,代码行数:31,代码来源:order_confirmation.php


示例17: dispPaypalForm

 /**
  * @brief epay.getPaymentForm 에서 호출됨
  */
 function dispPaypalForm()
 {
     $oEpayController = getController('epay');
     $oNcartModel = getModel('ncart');
     $oModuleModel = getModel('module');
     $oPaypalModuleConfig = $oModuleModel->getModuleConfig('paypal');
     $oPaypalModel = getModel('paypal');
     $paypalhome = sprintf(_XE_PATH_ . "files/epay/%s", $this->module_info->module_srl);
     $logged_info = Context::get('logged_info');
     if ($logged_info) {
         $oEpayModel = getModel('epay');
         $transaction_count = $oEpayModel->getTransactionCountByMemberSrl($logged_info->member_srl);
         if ($transaction_count < $oPaypalModuleConfig->minimum_transactions) {
             Context::set('error_code', '3');
             Context::set('minimum_transactions_count', $oPaypalModuleConfig->minimum_transactions);
             $this->setTemplateFile('error');
             return;
         }
     }
     // get products info using cartnos
     $output = $oEpayController->reviewOrder();
     if (!$output->toBool()) {
         return $output;
     }
     Context::set('review_form', $output->review_form);
     //$cart_info = $output->cart_info;
     $transaction_srl = $output->transaction_srl;
     $order_srl = $output->order_srl;
     //Context::set('cart_info', $cart_info);
     Context::set('price', $output->price);
     Context::set('transaction_srl', $transaction_srl);
     Context::set('order_srl', $order_srl);
     require __DIR__ . '/bootstrap.php';
     // Paypal account - 'paypal' / Credit card - 'credit_card'
     $payer = new Payer();
     $payer->setPaymentMethod("paypal");
     $item = new Item();
     $item_name = $output->item_name;
     $item->setName($item_name)->setCurrency($oPaypalModuleConfig->currency_code)->setQuantity(1)->setPrice($oPaypalModel->getConvertedPrice($output->price, $oPaypalModuleConfig->conversion_rate));
     $itemList = new ItemList();
     $itemList->setItems(array($item));
     /*
     		$details = new Details();
     		$details->setShipping(number_format($cart_info->delivery_fee, 2))
     				->setTax(number_format($cart_info->vat, 2))
     				->setSubtotal(number_format($cart_info->supply_amount, 2));
     */
     $amount = new Amount();
     $amount->setCurrency($oPaypalModuleConfig->currency_code)->setTotal($oPaypalModel->getConvertedPrice($output->price, $oPaypalModuleConfig->conversion_rate));
     //			   ->setDetails($details);
     $transaction = new Transaction();
     $transaction->setAmount($amount)->setItemList($itemList)->setDescription("Payment description");
     $baseUrl = getBaseUrl();
     $redirectUrls = new RedirectUrls();
     $returnURL = getNotEncodedFullUrl('', 'module', $this->module_info->module, 'act', 'procPaypalExecutePayment', 'success', 'true', 'order_srl', $order_srl, 'transaction_srl', $transaction_srl);
     $cancelURL = getNotEncodedFullUrl('', 'module', $this->module_info->module, 'act', 'procPaypalExecutePayment', 'success', 'false', 'order_srl', $order_srl, 'transaction_srl', $transaction_srl);
     $redirectUrls->setReturnUrl($returnURL)->setCancelUrl($cancelURL);
     $payment = new Payment();
     $payment->setIntent("sale")->setPayer($payer)->setRedirectUrls($redirectUrls)->setTransactions(array($transaction));
     try {
         $output = $payment->create($apiContext);
     } catch (PayPal\Exception\PPConnectionException $ex) {
         echo "Exception: " . $ex->getMessage() . PHP_EOL;
         var_dump($ex->getData());
         exit(1);
     }
     foreach ($payment->getLinks() as $link) {
         if ($link->getRel() == 'approval_url') {
             $redirectUrl = $link->getHref();
             break;
         }
     }
     $_SESSION['paymentId'] = $payment->getId();
     Context::set('redirectUrl', $redirectUrl);
     Context::set('payment_method', $payment_method);
     $this->setTemplateFile('formdata');
 }
开发者ID:bjrambo,项目名称:nurigo,代码行数:80,代码来源:paypal.view.php


示例18: displaySetup

if (empty($config['api_root'])) {
    displaySetup();
}
$message = '';
$action = !empty($_REQUEST['action']) ? $_REQUEST['action'] : '';
$accessToken = !empty($_REQUEST['access_token']) ? $_REQUEST['access_token'] : '';
switch ($action) {
    case 'callback':
        // step 3
        if (empty($_REQUEST['code'])) {
            $message = 'Callback request must have `code` query parameter!';
            break;
        }
        $tokenUrl = sprintf('%s/index.php?oauth/token', $config['api_root']);
        $postFields = array('grant_type' => 'authorization_code', 'client_id' => $config['api_key'], 'client_secret' => $config['api_secret'], 'code' => $_REQUEST['code'], 'redirect_uri' => getCallbackUrl());
        if (isLocal($config['api_root']) && !isLocal(getBaseUrl())) {
            $message = renderMessageForPostRequest($tokenUrl, $postFields);
            $message .= '<br />Afterwards, you can test JavaScript by clicking the link below.';
            break;
        }
        // step 4
        $json = makeCurlPost($tokenUrl, $postFields);
        $message = renderAccessTokenMessage($tokenUrl, $json);
        break;
    case 'refresh':
        // this is the refresh token flow
        if (empty($_REQUEST['refresh_token'])) {
            $message = 'Refresh request must have `refresh_token` query parameter!';
            break;
        }
        $tokenUrl = sprintf('%s/index.php?oauth/token', $config['api_root']);
开发者ID:billyprice1,项目名称:bdApi,代码行数:31,代码来源:index.php


示例19: session_start

/*
 * Store user is redirected here once he has chosen
 * a payment method. 
 */
require_once __DIR__ . '/../bootstrap.php';
session_start();
if (!isOrdered()) {
    header('Location: ../index.php');
    exit;
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $order = $_POST["order"];
    try {
        $orderInfo = getOrderInfo();
        //$recoderId = insertKey($orderInfo["email"],$orderInfo["ime"],$orderInfo["deviceid"],$orderInfo["devicetype"]);
        // Create the payment and redirect buyer to paypal for payment approval.
        $recoderId = 0;
        $baseUrl = getBaseUrl() . "/order_completion.php?paymentId={$recoderId}";
        $payment = makePaymentUsingPayPal($order['amount'], 'USD', $order['description'], "{$baseUrl}&success=true", "{$baseUrl}&success=false");
        header("Location: " . getLink($payment->getLinks(), "approval_url"));
        exit;
    } catch (\PayPal\Exception\PPConnectionException $ex) {
        $message = parseApiError($ex->getData());
        $messageType = "error";
    } catch (Exception $ex) {
        $message = $ex->getMessage();
        $messageType = "error";
    }
}
require_once 'index.php';
开发者ID:kenpi04,项目名称:apidemo,代码行数:30,代码来源:order_place.php


示例20: jsUrl

function jsUrl($url)
{
    return getBaseUrl() . '/js/' . $url;
}
开发者ID:qhyabdoel,项目名称:hris_mujigae,代码行数:4,代码来源:global.php



注:本文中的getBaseUrl函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getBasicMemberData函数代码示例发布时间:2022-05-15
下一篇:
PHP getBaseURL函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap