猿问

如何从 Stripe Api 获取和存储最近两个月的余额交易

我正在尝试从条带 API 中获取过去 2 个月的事务列表,其中包含 2000 多条记录。


我使用了以下代码,它只获取 3 天的记录。


    $balance = $this->stripelib->getBalanceTransaction()->all(

        array(

                'limit'   => 100,

                'created' => array(

                    'gte' => strtotime('-2 month'), 

                    'lte' => strtotime('1 day') 

                )

            )

        );



    foreach ($balance->data as $bl){}

    $this->addStripeRecord($balance->data);


    while ($balance->has_more){


        $balance = $this->stripelib->getBalanceTransaction()->all(

        array(

            "limit" => 100,

            "created" => array(

                "gte" => strtotime('-2 month'),

                'lte' => strtotime('1 day')

                ), 

            "starting_after" => $bl->id)

        );


        foreach ($balance->data as $bl){}

请帮我解决这个问题


慕工程0101907
浏览 158回答 1
1回答
随时随地看视频慕课网APP
我要回答