本文整理匯總了PHP中Braintree_TransparentRedirect::init方法的典型用法代碼示例。如果您正苦於以下問題:PHP Braintree_TransparentRedirect::init方法的具體用法?PHP Braintree_TransparentRedirect::init怎麽用?PHP Braintree_TransparentRedirect::init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Braintree_TransparentRedirect
的用法示例。
在下文中一共展示了Braintree_TransparentRedirect::init方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DateTime
$params = self::_underscoreKeys($params);
$now = new DateTime('now', new DateTimeZone('UTC'));
$trDataParams = array_merge($params, array('api_version' => Braintree_Configuration::API_VERSION, 'public_key' => Braintree_Configuration::publicKey(), 'time' => $now->format('YmdHis')));
ksort($trDataParams);
$trDataSegment = http_build_query($trDataParams, null, '&');
$trDataHash = self::_hash($trDataSegment);
return "{$trDataHash}|{$trDataSegment}";
}
private static function _underscoreKeys($array)
{
foreach ($array as $key => $value) {
$newKey = Braintree_Util::camelCaseToDelimiter($key, '_');
unset($array[$key]);
if (is_array($value)) {
$array[$newKey] = self::_underscoreKeys($value);
} else {
$array[$newKey] = $value;
}
}
return $array;
}
/**
* @ignore
*/
private static function _hash($string)
{
return Braintree_Digest::hexDigest($string);
}
}
Braintree_TransparentRedirect::init();