本文整理汇总了PHP中Paypal::setLogFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Paypal::setLogFile方法的具体用法?PHP Paypal::setLogFile怎么用?PHP Paypal::setLogFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paypal
的用法示例。
在下文中一共展示了Paypal::setLogFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Config
<?php
// === Include the scripts to make this IPN works === //
include 'core/class.config.php';
include 'core/class.database.php';
include 'core/lib/class.paypal.php';
// =====================================//
// Initiate the classes, and establish a DB conection
$Config = new Config();
$Paypal = new Paypal();
$DB = new Database($Config->getDbInfo('db_host'), $Config->getDbInfo('db_port'), $Config->getDbInfo('db_username'), $Config->getDbInfo('db_password'), $Config->getDbInfo('db_name'));
// Set test mode features (TRUE or FALSE)
$Paypal->testMode(FALSE);
// Lets check to see if we are valid or not
$Paypal->setLogFile('core/logs/ipn_log.txt');
// Check the payment status
$check = $Paypal->checkPayment($_POST);
if ($check == TRUE) {
// We must break down all the fancy stuff to get the account ID
// Format: Item info --- Account: (Account name) (# (account number))
// ex: Item: 5 Shortswords --- Account: wilson212(#6)
$account = explode(" --- ", $_POST['item_name']);
$pre_accountid = $account['1'];
$pre_accountid = str_replace("Account: ", "", $pre_accountid);
$pre_accountid = explode("(#", $pre_accountid);
$accountid = str_replace(")", "", $pre_accountid['1']);
if (isset($_POST['pending_reason'])) {
$pending_reason = $_POST['pending_reason'];
} else {
$pending_reason = NULL;
}