本文整理汇总了PHP中BOL_BillingService::getGatewayConfigValue方法的典型用法代码示例。如果您正苦于以下问题:PHP BOL_BillingService::getGatewayConfigValue方法的具体用法?PHP BOL_BillingService::getGatewayConfigValue怎么用?PHP BOL_BillingService::getGatewayConfigValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BOL_BillingService
的用法示例。
在下文中一共展示了BOL_BillingService::getGatewayConfigValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isVerified
/**
* Posts data back to PayPal for order verification
*
* @param array $post
* @return boolean
*/
public function isVerified($post)
{
$sandboxMode = $this->billingService->getGatewayConfigValue(self::GATEWAY_KEY, 'sandboxMode');
$hostname = $sandboxMode ? 'www.sandbox.paypal.com' : 'www.paypal.com';
$nvpStr = '';
foreach ($post as $key => $value) {
$value = urlencode(stripslashes($value));
$nvpStr .= "{$key}={$value}&";
}
$nvpStr .= 'cmd=_notify-validate';
// post back to PayPal for validation
$headers = "POST /cgi-bin/webscr HTTP/1.1\r\n";
$headers .= "Content-Type: application/x-www-form-urlencoded\r\n";
$headers .= "Content-Length: " . strlen($nvpStr) . "\r\n";
$headers .= "Host: " . $hostname . "\r\n";
$headers .= "Connection: close\r\n\r\n";
$fp = fsockopen($hostname, 80, $errno, $errstr, 30);
if (!$fp) {
return false;
}
fputs($fp, $headers . $nvpStr);
$str = '';
while (!feof($fp)) {
$str .= trim(fgets($fp, 2048));
}
fclose($fp);
return $sandboxMode ? true : mb_strstr($str, 'VERIFIED') !== false;
}
示例2: isVerified
/**
* Posts data back to PayPal for order verification
*
* @param array $post
* @return boolean
*/
public function isVerified($post)
{
$sandboxMode = $this->billingService->getGatewayConfigValue(self::GATEWAY_KEY, 'sandboxMode');
$hostname = $sandboxMode ? 'www.sandbox.paypal.com' : 'www.paypal.com';
$nvpStr = '';
foreach ($post as $key => $value) {
$value = urlencode(stripslashes($value));
$nvpStr .= "{$key}={$value}&";
}
$nvpStr .= 'cmd=_notify-validate';
$str = file_get_contents('https://' . $hostname . '/cgi-bin/webscr?' . $nvpStr);
return mb_strstr($str, 'VERIFIED') !== false;
}
示例3: getDataLinkServiceResponse
/**
* Sends request to DataLink Service
*
* @param array $transactionTypes
* @param boolean $testMode
* @return array
*/
public function getDataLinkServiceResponse(array $transactionTypes, $testMode = false)
{
$requestStr = self::DATALINK_URL . '?startTime=' . $this->getDateFormat(time() - 24 * 60 * 60) . '&endTime=' . $this->getDateFormat(time()) . '&transactionTypes=' . implode(',', $transactionTypes) . '&clientAccnum=' . $this->billingService->getGatewayConfigValue(self::GATEWAY_KEY, 'clientAccnum') . '&clientSubacc=' . $this->billingService->getGatewayConfigValue(self::GATEWAY_KEY, 'clientSubacc') . '&username=' . $this->billingService->getGatewayConfigValue(self::GATEWAY_KEY, 'datalinkUsername') . '&password=' . $this->billingService->getGatewayConfigValue(self::GATEWAY_KEY, 'datalinkPassword') . ($testMode ? '&testMode=1' : '');
$logger = OW::getLogger('billingccbill');
$logger->addEntry($requestStr, 'datalink.request-string');
$handle = curl_init($requestStr);
ob_start();
curl_exec($handle);
$string = ob_get_contents();
ob_end_clean();
$logger->addEntry($string, 'datalink.response-string');
$responseArr = array();
if (!curl_errno($handle)) {
$responseArr = $this->parseDatalinkResponse($string);
$logger->addEntry(print_r($responseArr, true), 'datalink.response-array');
}
curl_close($handle);
$logger->writeLog();
return $responseArr;
}
示例4: getOrderFormActionUrl
/**
* Returns Moneybookers gateway script url (sandbox or live)
*
* @return string
*/
private function getOrderFormActionUrl()
{
$sandboxMode = $this->billingService->getGatewayConfigValue(self::GATEWAY_KEY, 'sandboxMode');
return $sandboxMode ? 'http://www.moneybookers.com/app/test_payment.pl' : 'https://www.moneybookers.com/app/payment.pl';
}
示例5: isVerified
public function isVerified()
{
$arHash = array($_POST['m_operation_id'], $_POST['m_operation_ps'], $_POST['m_operation_date'], $_POST['m_operation_pay_date'], $_POST['m_shop'], $_POST['m_orderid'], $_POST['m_amount'], $_POST['m_curr'], $_POST['m_desc'], $_POST['m_status'], $this->billingService->getGatewayConfigValue(self::GATEWAY_KEY, 'm_key'));
$sign_hash = strtoupper(hash('sha256', implode(":", $arHash)));
return $_POST["m_sign"] == $sign_hash && $_POST['m_status'] == "success";
}