本文整理汇总了PHP中Braintree_Configuration::merchantUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Braintree_Configuration::merchantUrl方法的具体用法?PHP Braintree_Configuration::merchantUrl怎么用?PHP Braintree_Configuration::merchantUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Braintree_Configuration
的用法示例。
在下文中一共展示了Braintree_Configuration::merchantUrl方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _doRequest
private static function _doRequest($httpVerb, $path, $requestBody = null)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_TIMEOUT, 60);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $httpVerb);
curl_setopt($curl, CURLOPT_URL, Braintree_Configuration::merchantUrl() . $path);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/xml', 'Content-Type: application/xml', 'User-Agent: Braintree PHP Library ' . Braintree_Version::get(), 'X-ApiVersion: ' . Braintree_Configuration::API_VERSION));
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, Braintree_Configuration::publicKey() . ':' . Braintree_Configuration::privateKey());
// curl_setopt($curl, CURLOPT_VERBOSE, true);
if (Braintree_Configuration::sslOn()) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($curl, CURLOPT_CAINFO, Braintree_Configuration::caFile());
}
if (!empty($requestBody)) {
curl_setopt($curl, CURLOPT_POSTFIELDS, $requestBody);
}
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
$httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if (Braintree_Configuration::sslOn()) {
if ($httpStatus == 0) {
throw new Braintree_Exception_SSLCertificate();
}
}
return array('status' => $httpStatus, 'body' => $response);
}
示例2: testParseAndValidateQueryString_throwsDownForMaintenanceErrorIfDownForMaintenance
function testParseAndValidateQueryString_throwsDownForMaintenanceErrorIfDownForMaintenance()
{
Braintree_TestHelper::suppressDeprecationWarnings();
$trData = Braintree_TransparentRedirect::createCustomerData(array("redirectUrl" => "http://www.example.com"));
$queryString = Braintree_TestHelper::submitTrRequest(Braintree_Configuration::merchantUrl() . '/test/maintenance', array(), $trData);
$this->setExpectedException('Braintree_Exception_DownForMaintenance');
Braintree_Customer::createFromTransparentRedirect($queryString);
}
示例3: createTransactionUrl
/**
*
* @access public
* @param none
* @return string
*/
public static function createTransactionUrl()
{
trigger_error("DEPRECATED: Please use Braintree_TransparentRedirectRequest::url", E_USER_NOTICE);
return Braintree_Configuration::merchantUrl() . '/transactions/all/create_via_transparent_redirect_request';
}
示例4: _doRequest
private static function _doRequest($httpVerb, $path, $requestBody = null)
{
return self::_doUrlRequest($httpVerb, Braintree_Configuration::merchantUrl() . $path, $requestBody);
}
示例5: updateCreditCardUrl
/**
*
* @access public
* @param none
* @return string
*/
public static function updateCreditCardUrl()
{
trigger_error("DEPRECATED: Please use Braintree_TransparentRedirectRequest::url", E_USER_NOTICE);
return Braintree_Configuration::merchantUrl() . '/payment_methods/all/update_via_transparent_redirect_request';
}
示例6: testmerchantUrl
function testmerchantUrl()
{
Braintree_Configuration::merchantId('abc123');
Braintree_Configuration::environment('sandbox');
$mu = Braintree_Configuration::merchantUrl();
$this->assertEquals('https://sandbox.braintreegateway.com:443/merchants/abc123', $mu);
Braintree_Configuration::reset();
}
示例7: url
public static function url()
{
return Braintree_Configuration::merchantUrl() . "/transparent_redirect_requests";
}