You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So my logic to handle the API context and keep it up-to-date is as follows:
publicstaticfunctionloadApiContext()
{
$filePath = BUNQ_API_CONTEXT_PATH;
if (!static::validateExistingContext($filePath))
{
$apiContext = ApiContext::createForPsd2(
BunqEnumApiEnvironmentType::PRODUCTION(),
SecurityUtil::getCertificateFromFile(PSD2_SIGNING_CERTIFICATE_PATH),
newPrivateKey(static::getPrivateKey()),
[SecurityUtil::getCertificateFromFile(PSD2_CA_CHAIN_PATH)],
DESCRIPTION
);
$apiContextJson = $apiContext->toJson();
Storage::put($filePath, $apiContextJson); // Laravel storage (verified to be working).
BunqContext::loadApiContext($apiContext);
}
}
protectedstaticfunctionvalidateExistingContext($filePath)
{
if (Storage::exists($filePath))
{
$apiContextJson = Storage::get($filePath); // Retrieve existing context from storage.$apiContext = ApiContext::fromJson($apiContextJson);
try
{
$currentContext = BunqContext::getApiContext();
if ($currentContext->getApiKey() === $apiContext->getApiKey())
returntrue;
}
catch (BunqException$e) { }
if ($apiContext->ensureSessionActive())
{
$apiContextJson = $apiContext->toJson();
Storage::put($filePath, $apiContextJson);
}
BunqContext::loadApiContext($apiContext); // Source of error.returntrue;
}
returnfalse;
}
This occasionally leads to a TooManyRequestsException on the final BunqContext::loadApiContext in validateExistingContext. This is due to the User::listing call in UserContext.
Now I'm wondering if there are any flaws in the methods I'm using. This seems to happen sometimes when the context doesn't even need to be refreshed.
We're using the bunq API as an AISP under PSD2. My question on bunq together didn't get any answers from bunq. Please make sure my question gets addressed.
I work at bunq and am currently reviewing the bunq API docs, open issues and SDK’s and came across your issue. I know it’s been open for a while, and I’d love to understand how it’s impacting you. Beyond the obvious -fixing this issue-, what else could we do to improve your experience with our API?
If you want to share your thoughts on how we can improve on our public API:
📅 I'd love to schedule a 15 minute interview to understand your needs through: Calendly
💬 Or if you don't have time for a call, you can give us some general feedback through this form
Your feedback will go straight to our product team! 🚀
So my logic to handle the API context and keep it up-to-date is as follows:
This occasionally leads to a TooManyRequestsException on the final BunqContext::loadApiContext in validateExistingContext. This is due to the User::listing call in UserContext.
Now I'm wondering if there are any flaws in the methods I'm using. This seems to happen sometimes when the context doesn't even need to be refreshed.
We're using the bunq API as an AISP under PSD2. My question on bunq together didn't get any answers from bunq. Please make sure my question gets addressed.
Traceback
SDK version and environment
Response id
The text was updated successfully, but these errors were encountered: