Updating samples to use fluent setters + doc fixes

This commit is contained in:
aydiv
2013-08-22 17:24:04 +05:30
parent 14b9a13f8a
commit f4d687b52b
27 changed files with 422 additions and 893 deletions

View File

@@ -9,6 +9,8 @@ if(!file_exists(__DIR__ .'/vendor/autoload.php')) {
exit(1);
}
require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/common.php';
define("PP_CONFIG_PATH", __DIR__);
use PayPal\Rest\ApiContext;
@@ -36,24 +38,3 @@ $apiContext->setConfig(array(
*/
/**
* ### getBaseUrl function
* // utility function that returns base url for
* // determining return/cancel urls
* @return string
*/
function getBaseUrl() {
$protocol = 'http';
if ($_SERVER['SERVER_PORT'] == 443 || (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on')) {
$protocol .= 's';
$protocol_port = $_SERVER['SERVER_PORT'];
} else {
$protocol_port = 80;
}
$host = $_SERVER['HTTP_HOST'];
$port = $_SERVER['SERVER_PORT'];
$request = $_SERVER['PHP_SELF'];
return dirname($protocol . '://' . $host . ($port == $protocol_port ? '' : ':' . $port) . $request);
}