diff --git a/sample/bootstrap.php b/sample/bootstrap.php index eb9fed9..f73e2a6 100644 --- a/sample/bootstrap.php +++ b/sample/bootstrap.php @@ -1,40 +1,51 @@ setConfig(array( - 'mode' => 'sandbox', - 'http.ConnectionTimeOut' => 30, - 'log.LogEnabled' => true, - 'log.FileName' => '../PayPal.log', - 'log.LogLevel' => 'FINE' -)); -*/ - + +// ### Api context +// Pass in a `PayPal\Rest\ApiContext` object to authenticate +// API calls. The clientId and clientSecret for the +// OAuthTokenCredential class can be retrieved from +// developer.paypal.com + +$apiContext = new ApiContext( + new OAuthTokenCredential( + 'EBWKjlELKMYqRNQ6sYvFo64FtaRLRR5BdHEESmha49TM', + 'EO422dn3gQLgDbuwqTjzrFgFtaRLRR5BdHEESmha49TM' + ) +); + + + +// #### SDK configuration +// Comment this line out and uncomment the PP_CONFIG_PATH +// 'define' if you want to use a static file based configuration + +$apiContext->setConfig( + array( + 'mode' => 'sandbox', + 'http.ConnectionTimeOut' => 30, + 'log.LogEnabled' => true, + 'log.FileName' => '../PayPal.log', + 'log.LogLevel' => 'FINE' + ) +); +// Register the sdk_config.ini file in current directory +// as the configuration source. +// define("PP_CONFIG_PATH", __DIR__); diff --git a/sample/sdk_config.ini b/sample/sdk_config.ini index 4906f19..22de6fb 100644 --- a/sample/sdk_config.ini +++ b/sample/sdk_config.ini @@ -1,9 +1,16 @@ + + +## This is an example configuration file for the SDK. +## The sample scripts configure the SDK dynamically +## but you can choose to go for file based configuration +## in simpler apps (See bootstrap.php for more). + + ;Connection Information [Http] http.ConnectionTimeOut = 30 http.Retry = 1 -;http.Proxy=http://[username:password]@hostname[:port][/path] - +;http.Proxy=http://[username:password]@hostname[:port] ;Service Configuration [Service] @@ -23,4 +30,4 @@ log.FileName=../PayPal.log # Logging level can be one of FINE, INFO, WARN or ERROR # Logging is most verbose in the 'FINE' level and # decreases as you proceed towards ERROR -log.LogLevel=FINE \ No newline at end of file +log.LogLevel=FINE