当前位置: 首页>>代码示例>>PHP>>正文


PHP MP::search_payment方法代码示例

本文整理汇总了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;
}
开发者ID:NAITUSEIRL,项目名称:wc-ctala-mercadopago,代码行数:36,代码来源:WcMercadoPago.php

示例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"];
    ?>
开发者ID:basekit,项目名称:mercadopago-sdk-php,代码行数:31,代码来源:search-approved-payments.php

示例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);
开发者ID:jrivera294,项目名称:code-examples,代码行数:7,代码来源:basic.php

示例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>
开发者ID:vvasconcellos,项目名称:mp2,代码行数:31,代码来源:search_payment.php


注:本文中的MP::search_payment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。