本文整理汇总了PHP中MP::search_payment方法的典型用法代码示例。如果您正苦于以下问题:PHP MP::search_payment方法的具体用法?PHP MP::search_payment怎么用?PHP MP::search_payment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MP
的用法示例。
在下文中一共展示了MP::search_payment方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: probandoMP
function probandoMP()
{
$sessionid = "1234567890";
$payer = array("name" => "Cristian ", "surname" => "Tala S.", "email" => "naito.neko@gmail.com", "date_created" => "", "phone" => array("area_code" => "-", "number" => "+56991629602"), "address" => array("zip_code" => "00000", "street_name" => "Presidente Kennedy", "street_number" => "5933"), "identification" => array("number" => "null", "type" => "null"));
$shipments = array("receiver_address" => array("floor" => "-", "zip_code" => "000000", "street_name" => "DESTINO", "apartment" => "-", "street_number" => "-"));
$items = array(array("id" => $sessionid, "title" => "Producto", "description" => "x", "quantity" => 1, "unit_price" => 10, "currency_id" => "CLP", "picture_url" => "", "category_id" => ""));
//set back url
$back_urls = array("pending" => "URLPENDING", "success" => "URLSUCCESS");
//mount array pref
$pref = array();
$pref['external_reference'] = $sessionid;
$pref['payer'] = $payer;
$pref['shipments'] = $shipments;
$pref['items'] = $items;
$pref['back_urls'] = $back_urls;
$pref['payment_methods'] = $payment_methods;
$mp = new MP(CTALA_MP_CLIENTID, CTALA_MP_CLIENTSCRETET);
$preferenceResult = $mp->create_preference($pref);
$result = "";
$result .= "<pre>";
if ($preferenceResult['status'] == 201) {
if (true) {
$link = $preferenceResult['response']['sandbox_init_point'];
} else {
$link = $preferenceResult['response']['init_point'];
}
} else {
$result .= "Error: " . $preferenceResult['status'];
}
$result .= print_r($preferenceResult, true);
$filters = array("id" => null, "site_id" => null, "external_reference" => null);
$searchResult = $mp->search_payment($filters);
$result .= print_r($searchResult, true);
$result .= "</pre>";
return $result;
}
示例2: MP
* Search approved payments in last month
* @date 2012/03/29
* @author hcasatti
*/
// Include Mercadopago library
require_once "../../lib/mercadopago.php";
// Create an instance with your MercadoPago credentials (CLIENT_ID and CLIENT_SECRET):
// Argentina: https://www.mercadopago.com/mla/herramientas/aplicaciones
// Brasil: https://www.mercadopago.com/mlb/ferramentas/aplicacoes
// Mexico: https://www.mercadopago.com/mlm/herramientas/aplicaciones
// Venezuela: https://www.mercadopago.com/mlv/herramientas/aplicaciones
$mp = new MP("CLIENT_ID", "CLIENT_SECRET");
// Sets the filters you want
$filters = array("range" => "date_created", "begin_date" => "NOW-1MONTH", "end_date" => "NOW", "status" => "approved", "operation_type" => "regular_payment");
// Search payment data according to filters
$searchResult = $mp->search_payment($filters);
// Show payment information
?>
<table border='1'>
<tr><th>id</th><th>site_id</th><th>date_created</th><th>operation_type</th><th>external_reference</th></tr>
<?php
foreach ($searchResult["response"]["results"] as $payment) {
?>
<tr>
<td><?php
echo $payment["collection"]["id"];
?>
</td>
<td><?php
echo $payment["collection"]["site_id"];
?>
示例3: MP
<?php
require_once 'mercadopago.php';
$mp = new MP("CLIENT_ID", "CLIENT_SECRET");
$filters = array("status" => "approved");
$search_result = $mp->search_payment($filters, 0, 10);
print_r($search_result);
示例4: MP
<?php
if (isset($_POST["_eventId_confirmation"])) {
require_once "lib/mercadopago.php";
$clientid = $_SESSION['user'];
$clientsecret = $_SESSION['pass'];
$mp = new MP($clientid, $clientsecret);
$date1 = implode("-", array_reverse(explode("/", $_POST['date1'])));
$date2 = implode("-", array_reverse(explode("/", $_POST['date2'])));
$filters = array("range" => "date_created", "begin_date" => $date1 . "T00:00:00.00Z", "end_date" => $date2 . "T23:59:00.00Z", "sort" => "date_created", "criteria" => "desc");
// Search payment data according to filters
$searchResult = $mp->search_payment($filters, 0, 10);
$rowslimit = (int) $searchResult["response"]["paging"]["total"];
echo "<h5> Total - rows: " . $rowslimit . " </h5><br><br>";
/*
echo "<pre>";
print_r($searchResult);
echo "</pre>";
exit(0);
*/
// Show payment information
?>
<a href="#" class="export">Export Table</a>
<table class="ch-datagrid-controls" id="table_collections" >
<tr style="background-color: lightgrey;" >
<td scope="col">Payment Id</td>
<td scope="col">Order</td>
<td scope="col">Date created</td>