douyingtai6662 2017-06-21 04:18
浏览 39

什么是分页光标以及如何使用它

I am trying to retrieve a list of customers using the square PHP SDK. If I leave the $cursor blank, I can see a list of all of my customer information. How do I use the pagination cursor to receive a customer by their name? Sample code below:

<?php
    require_once(__DIR__ . '/vendor/autoload.php');

    // Configure OAuth2 access token for authorization: oauth2
    SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

    $api_instance = new SquareConnect\Api\CustomersApi();
    // string | A pagination cursor returned by a previous call to this endpoint. 
    //Provide this to retrieve the next set of results for your original query.  
    //See [Paginating results](#paginatingresults) for more information.
    $cursor = "cursor_example"; 
    try {
        $result = $api_instance->listCustomers($cursor);
        print_r($result);
    } catch (Exception $e) {
        echo 'Exception when calling CustomersApi->listCustomers: '
                 , $e->getMessage(), PHP_EOL;
    }
 ?>
  • 写回答

1条回答 默认 最新

  • dongzhi5587 2017-06-21 05:28
    关注

    The pagination cursor does not allow you to query for customers by name. If you have more than one "page" of customer, then it allows for you to get more customers by providing a token representing the next page.

    If you have enough customers to fill multiple pages, a cursor would be returned in the response.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度