Created
August 6, 2020 20:29
-
-
Save basst85/af0e876aae0c35421730fbd752f810bf to your computer and use it in GitHub Desktop.
Create new callback filter for bunq sub-account
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use bunq\Context\ApiContext; | |
use bunq\Context\BunqContext; | |
use bunq\Model\Generated\Endpoint\User; | |
use bunq\Model\Generated\Endpoint\UserPerson; | |
use bunq\Model\Generated\Endpoint\NotificationFilterUrlMonetaryAccount; | |
use bunq\Model\Generated\Object\NotificationFilterUrl; | |
use bunq\Model\Core\NotificationFilterUrlMonetaryAccountInternal; | |
use bunq\Util\BunqEnumApiEnvironmentType; | |
require_once(__DIR__ . '/vendor/autoload.php'); | |
$environmentType = BunqEnumApiEnvironmentType::PRODUCTION(); //SANDBOX or PRODUCTION | |
$apiKey = 'YOUR API-KEY'; // Replace with your API-key | |
$deviceDescription = 'YOUR_DEVICE'; // 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(); | |
$notificationFilter = new NotificationFilterUrl('MUTATION', 'https://www.your-domain.com/callback'); | |
$createdNotificationFilter = NotificationFilterUrlMonetaryAccountInternal::createWithListResponse($primaryMonetaryAccount->getId(), [$notificationFilter])->getValue(); | |
print_r($createdNotificationFilter); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @basst85, I finally got this working. I would also like to delete an existing Callback, do you have an example with the bunq SDK?