Skip to content

Instantly share code, notes, and snippets.

@basst85
Created November 20, 2020 13:25
Show Gist options
  • Select an option

  • Save basst85/e661f6d9ad3929138308080f1abb7e4e to your computer and use it in GitHub Desktop.

Select an option

Save basst85/e661f6d9ad3929138308080f1abb7e4e to your computer and use it in GitHub Desktop.
<?php
use bunq\Context\ApiContext;
use bunq\Context\BunqContext;
use bunq\Model\Generated\Endpoint\Insight;
use bunq\Util\BunqEnumApiEnvironmentType;
require_once(__DIR__ . '/vendor/autoload.php');
$environmentType = BunqEnumApiEnvironmentType::PRODUCTION();
$apiKey = 'YOUR_ARI_KEY'; // Replace with your APIk-key
$deviceDescription = 'TestDevice'; // Replace with your device description
$permittedIps = []; // List the real expected IPs of this device or leave empty to use the current IP
$apiContext = ApiContext::create(
$environmentType,
$apiKey,
$deviceDescription,
$permittedIps
);
BunqContext::loadApiContext($apiContext);
$user = BunqContext::getUserContext()->getUserPerson();
$primaryMonetaryAccount = BunqContext::getUserContext()->getPrimaryMonetaryAccount();
$time_start = '01-09-2020';
$time_end = '09-10-2020';
// List Insights
$paymentResponse = Insight::listing(['monetary_account_id' => $primaryMonetaryAccount, 'time_start' => $time_start, 'time_end' => $time_end]);
$allPayment = $paymentResponse->getValue();
print_r($allPayment);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment