Mangopay / mangopay2-php-sdk

PHP SDK for MANGOPAY
https://packagist.org/packages/mangopay/php-sdk-v2
MIT License
123 stars 134 forks source link

How to get new Transactions? #586

Closed kesavanselvakani closed 1 year ago

kesavanselvakani commented 1 year ago

Hi Team, How to get latest transaction details in Mango pay

                     $mangoPayApi = new \MangoPay\MangoPayApi();
            $mangoPayApi->Config->ClientId        = config('app.project.MangoPay.ClientId');
            $mangoPayApi->Config->ClientPassword  = config('app.project.MangoPay.ClientPassword');
            $mangoPayApi->Config->TemporaryFolder = config('app.project.MangoPay.TemporaryFolder');
            $mangoPayApi->Config->BaseUrl         = config('app.project.MangoPay.URL');
            $page_test = 100;
            $pagination  = new \MangoPay\Pagination($page,$page_test); // get 1st page, 10 items per page

            $wallet_transactions_details          = $mangoPayApi->Wallets->GetTransactions($wallet_id,$pagination,$sorting);

This code display only for past 100 transaction...Recent transaction how to get

iulian03 commented 1 year ago

Hi, @kesavanselvakani

You can adjust pagination to fetch data based on your needs. Also, you can add sorting to the request.

$sorting = new Sorting();
$sorting->AddField("CreationDate", SortDirection::DESC);