bunq / sdk_php

PHP SDK for bunq API
MIT License
84 stars 54 forks source link

Failed to create API Context #163

Closed sebastiaanspeck closed 5 years ago

sebastiaanspeck commented 5 years ago

Steps to reproduce:

  1. Clean install a new laravel application laravel new bunq
  2. vendor/bin/bunq-install
  3. Choose PRODUCTION
  4. Insert api key
  5. leave proxy empty (Just press Enter)

What should happen:

  1. API Context created

What happens:

  1. An error occurred: Generating a new private key failed. See "http://php.net/manual/en/function.openssl-pkey-new.php" for more info.

Traceback

SDK version and environment

Response id

Extra info:

OGKevin commented 5 years ago

Hi,

Have you actually look a look to the references link ?

maybe https://github.com/bunq/sdk_php/issues/102 will help

This is likely because you are missing openSSL on your system as noted on the php docs.

sebastiaanspeck commented 5 years ago

Nope. I installed openSSL.

openssl version outputs OpenSSL 1.0.2p 14 Aug 2018

Am I missing a step?

OGKevin commented 5 years ago

Not sure, what platform are you using ?

OGKevin commented 5 years ago

And have you compiled PHP with open ssl as discribed in http://php.net/manual/en/openssl.installation.php

sebastiaanspeck commented 5 years ago

Not sure, what platform are you using ?

I'm using MacOS Mojave

sebastiaanspeck commented 5 years ago

And have you compiled PHP with open ssl as discribed in http://php.net/manual/en/openssl.installation.php

Just tried:

MacBook:bunq user$ vendor/bin/bunq-install --with-openssl
Choose an environment (SANDBOX/PRODUCTION): PRODUCTION
Please provide your api key: [API-KEY]
Provide a proxy url, leave empty for no proxy (default: no proxy): 
An error occurred: Generating a new private key failed. See "http://php.net/manual/en/function.openssl-pkey-new.php" for more info.
OGKevin commented 5 years ago

That is not compiling php with OpenSSL πŸ€¦β€β™‚οΈ 😝

A quick google search on how to install/compile php with open ssl resulted in: https://gist.github.com/ryanscherler/fea4bb75379c1564df7e027c45615cc9 Please give that a try.

sebastiaanspeck commented 5 years ago

I tried that:

$ php -i | grep "SSL Version" -> SSL Version => LibreSSL/2.6.4
$ brew uninstall php71-mcrypt -> Error: No such keg: /usr/local/Cellar/php71-mcrypt
$ brew uninstall php71 -> Error: No such keg: /usr/local/Cellar/php@7.1
$ brew install --with-openssl curl -> went well
$ brew install --with-homebrew-curl php71 -> went well
$ brew install php71-mcrypt -> 
Error: No available formula with the name "php71-mcrypt" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
$ php -i | grep "SSL Version" -> SSL Version => LibreSSL/2.6.4
OGKevin commented 5 years ago

And πŸ˜• ? Did it work or not ? It seems that you are randomly copy pasting the comands. Are you sure your php is even linked to the php you just installed ? If this is not the case then the commands you just ran will have no effect of course.

You can verify this by running php -v and which php. It seems that you’re lost on how to setup php/environment. I would suggest you try googling a bit. Basically what you need is php with OpenSSL installed. Google should give at least some tutorials on how to set this up.

sebastiaanspeck commented 5 years ago

It didn't work... I will try and otherwise I am having to let go the idea to "play" with Bunq

OGKevin commented 5 years ago

if You are missing experience/knowledge with php/brew/macOS , then I would suggest to try and get some knowledge there first. If you want to directly get started I would suggest you try python. That is an easier language to get started with. 😊

sebastiaanspeck commented 5 years ago

I have enough experience with Python. I wanted to create a Laravel website using the sdk_php