bunq / tinker_php Goto Github PK
View Code? Open in Web Editor NEWInstall Tinker by just running this command: bash <(curl -s https://tinker.bunq.com/php/setup.sh)
License: MIT License
Install Tinker by just running this command: bash <(curl -s https://tinker.bunq.com/php/setup.sh)
License: MIT License
$ bash <(curl -s https://tinker.bunq.com/php/setup.sh)
[Output omitted]
$ tinker/user-overview.php
A new sandbox account is created and an overview is shown.
████████╗██╗███╗ ██╗██╗ ██╗███████╗██████╗ ██╗███╗ ██╗ ██████╗
╚══██╔══╝██║████╗ ██║██║ ██╔╝██╔════╝██╔══██╗██║████╗ ██║██╔════╝
██║ ██║██╔██╗ ██║█████╔╝ █████╗ ██████╔╝██║██╔██╗ ██║██║ ███╗
██║ ██║██║╚██╗██║██╔═██╗ ██╔══╝ ██╔══██╗██║██║╚██╗██║██║ ██║
██║ ██║██║ ╚████║██║ ██╗███████╗██║ ██║██║██║ ╚████║╚██████╔╝
╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═════╝
PHP Fatal error: Uncaught bunq\Exception\NotFoundException: HTTP Response Code: 404
The response id to help bunq debug: 9395f5a3-bf74-4507-b74a-e8fad476200d
Error message: Route not found. in $PWD/vendor/bunq/sdk_php/src/Exception/ExceptionFactory.php:58
Stack trace:
#0 $PWD/vendor/bunq/sdk_php/src/Http/Handler/ResponseHandlerError.php(54): bunq\Exception\ExceptionFactory::createExceptionForResponse()
#1 $PWD/vendor/bunq/sdk_php/src/Http/Handler/HandlerUtil.php(42): bunq\Http\Handler\ResponseHandlerError->execute()
#2 $PWD/vendor/guzzlehttp/promises/src/FulfilledPromise.php(39): bunq\Http\Handler\HandlerUtil::bunq\Http\Handler\{closure}()
#3 $PWD/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\FulfilledPromise::GuzzleHttp\Promise\{closure}()
#4 $PWD/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\Promise\TaskQueue->run()
#5 $PWD/vendor in $PWD/vendor/bunq/sdk_php/src/Exception/ExceptionFactory.php on line 58
$ uname -r
5.9.6-arch1-1
$ php --version
PHP 7.4.12 (cli) (built: Oct 29 2020 18:50:11) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
kthxbye
Seems like the minimal to do to get developers up and running. It is quite a big puzzle now...
Also the link to the "Android Emulator" section is broken.
For some reason https://doc.bunq.com/#android-emulator redirects to https://doc.bunq.com/#/android-emulator
Dear,
I have a problem that I cannot solve. This concerns the error message below. I tried reinstalling with brew but this didn't seems to work
Your PHP seems to be linked to the MacOS provided curl binary. This is incompatible with our SDK, please reinstall by running: "brew reinstall --with-homebrew-curl".
System details:
OS: MacOS Mojave
PHP version: 7.1
Hello,
This is more of a question rather than an issue. I am looking to get an API Key in BUNQ sandbox env which is wildcard API Key, so that I can create an Installation Context and proceed to use the API's.
I was doing a POST to https://public-api.sandbox.bunq.com/v1/sandbox-user, but this key gives me an error when trying to create an API context.
Thanks in Advance.
Instaled Tinker but get the following errors?
Not sure why or what todo?
I run from Ubuntu?
`Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for bunq/sdk_php 0.13.2 -> satisfiable by bunq/sdk_php[0.13.2].
- bunq/sdk_php 0.13.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.2/cli/php.ini
- /etc/php/7.2/cli/conf.d/10-opcache.ini
- /etc/php/7.2/cli/conf.d/10-pdo.ini
- /etc/php/7.2/cli/conf.d/20-calendar.ini
- /etc/php/7.2/cli/conf.d/20-ctype.ini
- /etc/php/7.2/cli/conf.d/20-curl.ini
- /etc/php/7.2/cli/conf.d/20-exif.ini
- /etc/php/7.2/cli/conf.d/20-fileinfo.ini
- /etc/php/7.2/cli/conf.d/20-ftp.ini
- /etc/php/7.2/cli/conf.d/20-gettext.ini
- /etc/php/7.2/cli/conf.d/20-iconv.ini
- /etc/php/7.2/cli/conf.d/20-json.ini
- /etc/php/7.2/cli/conf.d/20-phar.ini
- /etc/php/7.2/cli/conf.d/20-posix.ini
- /etc/php/7.2/cli/conf.d/20-readline.ini
- /etc/php/7.2/cli/conf.d/20-shmop.ini
- /etc/php/7.2/cli/conf.d/20-sockets.ini
- /etc/php/7.2/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.2/cli/conf.d/20-sysvsem.ini
- /etc/php/7.2/cli/conf.d/20-sysvshm.ini
- /etc/php/7.2/cli/conf.d/20-tokenizer.ini
You can also run php --ini
inside terminal to see which files are used by PHP in CLI mode.
`
Currently when making a payment or request, an email Pointer will always be created (you cannot send money to an IBAN for example).
Would be nice to be able to send money to phone numbers and IBANs as well, besides emails :)
Hi!
As I'm creating an API to sync payments with a bookkeeping system, I'd like to get notified about payments. That's why I need to add a callback url.
My test looks like this:
/** @test */
public function it_adds_a_callback_url()
{
// given
$user = $this->bunq->getCurrentUser();
$callbackUrl = "https://example.org";
// when
$this->bunq->addCallbackUrl($callbackUrl);
// then
$filters = $user->getNotificationFilters();
$this->assertTrue(count($filters) >= 1);
}
($this->bunq
refers to BunqLib
}
When running this test, I'm getting the error:
Error message: Superfluous field "card_ids".Superfluous field "card_limits".
But I can't find any documentation about this error. I tried removing the default null values, changing the url, but none of these work.
Could it be a sandbox thing? Or what am I missing here?
Thanks!
First, It is Solved. It is FOR SURE a bug with SDK and the BunqLib in Tinker and Examples.
The basic flow is:
Tinker::addCallbackUrl => BunqLib::addCallbackUrl => UserPerson::getNotificationFilters => Add new notification filters to the current filter list => UserPerson::update().
But this is wrong in several places:
at BunqLib::addCallbackUrl is using "new NotificationFilter()" to generate a new NotificationFilter Object. This is incorrect because the SDK is asking for the NotificationFilterUrlUser / NotificationFilterMonataryAccount;
at BunqLib::addCallbackUrl is using UserPerson::update() to set the new NotificationFiler. This is incorrect because:
a. the parameters are mismatched;
b. the update is no longer taking NotificationFilter as a parameter and it is not going to update the filters;
The Solution:
STEP 1. replace BunqLib::addCallbackUrl with:
public function addCallbackUrl(string $callbackUrl) {
$allUpdatedNotificationFilter[] = new NotificationFilterUrl(
self::NOTIFICATION_CATEGORY_MUTATION,
$callbackUrl
);
$notificationFilterUrlUser = new NotificationFilterUrlUser($allUpdatedNotificationFilter);
$notificationFilterUrlUser -> create($allUpdatedNotificationFilter);
}
STEP 2. (THE BUG):
in bunq\sdk_php\Model\Core\BunqModel.php
at line: 361
Change:
$value = static::createListFromResponseArray($response, $wrapper);
Into:
$value = static::createListFromResponseArray($response[0], $wrapper);
Because the returned response is like:
Array(1) =>
Array(1) =>
Array(5)
"NotificationFilters" =>
....
There is one more dimension of the response array.
It is tested in both SANDBOX and PRODUCTION environments.
Hello guys,
I have installed bunq-tinker in laravel project vendor/tinker, but there is not much documentation/examples on web for how to code bunq-tinker. I am stucked here don't know how to use bunq-tinker.
Anybody please can help me out from this problem?
Thanks.
When a dependency is detected as missing it should ask the user if the dependency should be installed with the default installation command instead of simply exiting the setup script.
For composer the php-mbstring
and php-curl
packages are also required which are currently not checked yet
tinker/create-psd2-configuration.php --certificate ~/path/to/certs/signing_cert.pem --chain ~/path/to/certs/signing_cert_chain.pem --key ~/path/to/certs/signing_cert.key
from terminalError message: Certificate root is not trusted. Make sure that the last certificate in the chain is the root certificate. in /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Exception/ExceptionFactory.php:52
PHP Fatal error: Uncaught bunq\Exception\BadRequestException: HTTP Response Code: 400
The response id to help bunq debug: 6b3487d7-44e8-4a99-8f3c-45441bc7e810
Error message: Certificate root is not trusted. Make sure that the last certificate in the chain is the root certificate. in /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Exception/ExceptionFactory.php:52
Stack trace:
#0 /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Http/Handler/ResponseHandlerError.php(54): bunq\Exception\ExceptionFactory::createExceptionForResponse(Array, 400, '6b3487d7-44e8-4...')
#1 /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Http/Handler/HandlerUtil.php(42): bunq\Http\Handler\ResponseHandlerError->execute(Object(GuzzleHttp\Psr7\Response))
#2 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/promises/src/FulfilledPromise.php(39): bunq\Http\Handler\HandlerUtil::bunq\Http\Handler{closure}(Object(GuzzleHttp\Psr7\Response))
#3 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\FulfilledPromise::GuzzleHttp\Promise{closure}()
#4 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\Promise\TaskQueue->run(true)
#5 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/promises/src/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/promises/src/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending()
#7 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#8 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#9 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/guzzle/src/Client.php(183): GuzzleHttp\Promise\Promise->wait()
#10 /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Http/ApiClient.php(220): GuzzleHttp\Client->request('POST', Object(GuzzleHttp\Psr7\Uri), Array)
#11 /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Http/ApiClient.php(492): bunq\Http\ApiClient->request('POST', 'payment-service...', Array, Array, Array)
#12 /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Model/Core/PaymentServiceProviderCredentialInternal.php(46): bunq\Http\ApiClient->post('payment-service...', Array, Array)
#13 /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Context/ApiContext.php(221): bunq\Model\Core\PaymentServiceProviderCredentialInternal::createWithApiContext('-----BEGIN CERT...', '-----BEGIN CERT...', 'UvMNfs5vOA2TV9e...', Object(bunq\Context\ApiContext))
#14 /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Context/ApiContext.php(153): bunq\Context\ApiContext->initializePsd2Credential(Object(bunq\Model\Generated\Object\Certificate), Object(bunq\Security\PrivateKey), Array)
#15 /Users/noah-vincenznoah/Desktop/tinker2/tinker/create-psd2-configuration.php(57): bunq\Context\ApiContext::createForPsd2(Object(bunq\Util\BunqEnumApiEnvironmentType), Object(bunq\Model\Generated\Object\Certificate), Object(bunq\Security\PrivateKey), Array, '##### YOUR DEVI...')
#16 {main}
thrown in /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Exception/ExceptionFactory.php on line 52Fatal error: Uncaught bunq\Exception\BadRequestException: HTTP Response Code: 400
The response id to help bunq debug: 6b3487d7-44e8-4a99-8f3c-45441bc7e810
Error message: Certificate root is not trusted. Make sure that the last certificate in the chain is the root certificate. in /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Exception/ExceptionFactory.php:52
Stack trace:
#0 /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Http/Handler/ResponseHandlerError.php(54): bunq\Exception\ExceptionFactory::createExceptionForResponse(Array, 400, '6b3487d7-44e8-4...')
#1 /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Http/Handler/HandlerUtil.php(42): bunq\Http\Handler\ResponseHandlerError->execute(Object(GuzzleHttp\Psr7\Response))
#2 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/promises/src/FulfilledPromise.php(39): bunq\Http\Handler\HandlerUtil::bunq\Http\Handler{closure}(Object(GuzzleHttp\Psr7\Response))
#3 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\FulfilledPromise::GuzzleHttp\Promise{closure}()
#4 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\Promise\TaskQueue->run(true)
#5 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/promises/src/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/promises/src/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending()
#7 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#8 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#9 /Users/noah-vincenznoah/Desktop/tinker2/vendor/guzzlehttp/guzzle/src/Client.php(183): GuzzleHttp\Promise\Promise->wait()
#10 /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Http/ApiClient.php(220): GuzzleHttp\Client->request('POST', Object(GuzzleHttp\Psr7\Uri), Array)
#11 /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Http/ApiClient.php(492): bunq\Http\ApiClient->request('POST', 'payment-service...', Array, Array, Array)
#12 /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Model/Core/PaymentServiceProviderCredentialInternal.php(46): bunq\Http\ApiClient->post('payment-service...', Array, Array)
#13 /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Context/ApiContext.php(221): bunq\Model\Core\PaymentServiceProviderCredentialInternal::createWithApiContext('-----BEGIN CERT...', '-----BEGIN CERT...', 'UvMNfs5vOA2TV9e...', Object(bunq\Context\ApiContext))
#14 /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Context/ApiContext.php(153): bunq\Context\ApiContext->initializePsd2Credential(Object(bunq\Model\Generated\Object\Certificate), Object(bunq\Security\PrivateKey), Array)
#15 /Users/noah-vincenznoah/Desktop/tinker2/tinker/create-psd2-configuration.php(57): bunq\Context\ApiContext::createForPsd2(Object(bunq\Util\BunqEnumApiEnvironmentType), Object(bunq\Model\Generated\Object\Certificate), Object(bunq\Security\PrivateKey), Array, '##### YOUR DEVI...')
#16 {main}
thrown in /Users/noah-vincenznoah/Desktop/tinker2/vendor/bunq/sdk_php/src/Exception/ExceptionFactory.php on line 52
I have verified my certificate and its root certificate. I am unsure about the format for the client_service_provider_certificate_chain
parameter value for the request body to the POST /payment-service-credential-provider
endpoint for our certificates?
Assuming I have the three certificates:
What should the client_service_provider_certificate_chain
value be (ie the format of the signing_cert_chain.pem
file in the Steps to reproduce command)?
We have tried many different combinations
\n
) and -----BEGIN CERTIFICATE-----
and -----END CERTIFICATE-----
prefix and suffix for both B and C\n
) and -----BEGIN CERTIFICATE-----
and -----END CERTIFICATE-----
prefix and without suffix for both B and CHey guys, i need to know how can we use bunq tinker in laravel project?
What I've done so far, Installed tinker in new directory because when I try to run "bash <(curl -s https://tinker.bunq.com/php/setup.sh)" command it was saying " Please run the script from an empty directory".
And I've moved tinker folder in laravel vendor. But whenever i try to use BunqLib class in controller it giving me error "Class 'bunq\tinker\BunqLib' not found".
I have also tried with providers and alias in app.php but same error "class not found"
I'm stuck in bunq. I need help, Is anyone bunq expert here who can help me out?
Here the screenshot of error:
@OGKevin
bash <(curl -s https://tinker.bunq.com/php/setup.sh)
tinker/user-overview.php
Returns a fatal error
Micheles-MacBook-Pro:tinker-php michele$ tinker/user-overview.php
*** tinkering cool logo ***
Fatal error: Uncaught bunq\Exception\PleaseContactBunqException: HTTP Response Code: 500
The response id to help bunq debug: The response header "X-Bunq-Client-Response-Id" or "x-bunq-client-response-id" could not be found.
Error message:Encountered unhandled exception.
in /Users/michele/dev/tmi/tinker-php/vendor/bunq/sdk_php/src/Exception/ExceptionFactory.php:64
Stack trace:
#0 /Users/michele/dev/tmi/tinker-php/vendor/bunq/sdk_php/src/Http/Handler/ResponseHandlerError.php(54): bunq\Exception\ExceptionFactory::createExceptionForResponse(Array, 500, 'The response he...')
#1 /Users/michele/dev/tmi/tinker-php/vendor/bunq/sdk_php/src/Http/Handler/HandlerUtil.php(42): bunq\Http\Handler\ResponseHandlerError->execute(Object(GuzzleHttp\Psr7\Response))
#2 /Users/michele/dev/tmi/tinker-php/vendor/guzzlehttp/promises/src/FulfilledPromise.php(39): bunq\Http\Handler\HandlerUtil::bunq\Http\Handler{closure}(Object(GuzzleHttp\Psr7\Response))
#3 /Users/michele/dev/tmi/tinker-php/vendor/guzzlehttp/p in /Users/michele/dev/tmi/tinker-php/vendor/bunq/sdk_php/src/Exception/ExceptionFactory.php on line 64
I just tried the java tinker and I successfully created an account, so it sounds like a problem for this SDK and not a server error
The new sandbox url will be https://public-api.sandbox.bunq.com/v1/
.
This new environment will not support pub key pinning due to a bug in curl, see: https://curl.haxx.se/docs/todo.html#Support_intermediate_root_pinn. Therefore, public key pinning will be disabled in the SDK's for sandbox.
Originally posted by @OGKevin in bunq/sdk_php#149
# PHP Fatal error: Uncaught bunq\Exception\BadRequestException: HTTP Response Code: 400
The response id to help bunq debug: 6cbf9a52-7220-44d6-b118-2fb4d7458db5
Error message: Email has incorrect value "<IBAN>". in /home/evharten/betalingen/vendor/bunq/sdk_php/src/Exception/ExceptionFactory.php:52
Stack trace:
#0 /home/evharten/betalingen/vendor/bunq/sdk_php/src/Http/Handler/ResponseHandlerError.php(54): bunq\Exception\ExceptionFactory::createExceptionForResponse(Array, 400, '6cbf9a52-7220-4...')
#1 /home/evharten/betalingen/vendor/bunq/sdk_php/src/Http/Handler/HandlerUtil.php(42): bunq\Http\Handler\ResponseHandlerError->execute(Object(GuzzleHttp\Psr7\Response))
#2 /home/evharten/betalingen/vendor/guzzlehttp/promises/src/FulfilledPromise.php(39): bunq\Http\Handler\HandlerUtil::bunq\Http\Handler\{closure}(Object(GuzzleHttp\Psr7\Response))
#3 /home/evharten/betalingen/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\FulfilledPromise::GuzzleHttp\Promise\{closure}()
#4 /home/evharten/betalingen/vendo in /home/evharten/betalingen/vendor/bunq/sdk_php/src/Exception/ExceptionFactory.php on line 52
The description echo is showing format specifiers. (%s).
Update SDK version to 1.13.0
Currently users start without money, to change this a request will be sent to a predetermined user and will be accepted automatically.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.