Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions php/nordeawrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct() {
$this->clientId = $ini_array['clientId'];
$this->clientSecret = $ini_array['clientSecret'];
$this->redirectUri = $ini_array['redirectUri'];
$this->authenticationUrl = $this->apiUrl . 'v1/authentication';
$this->authenticationUrl = $this->apiUrl . 'v2/authorize';
$this->accessTokenUrl = $this->authenticationUrl . '/access_token';
$this->accountsUrl = $this->apiUrl . 'v2/accounts';
$this->paymentsUrl = $this->apiUrl . 'v2/payments/sepa';
Expand Down Expand Up @@ -64,7 +64,10 @@ private function curlRequest($url, $headers = null, $method = 'get', $payload =
*/
private function getCode() {
$url = $this->authenticationUrl . '?client_id=' . $this->clientId
. '&redirect_uri=' . $this->redirectUri . '&state=';
. '&redirect_uri=' . $this->redirectUri
. '&state=oauth2'
. '&scope=ACCOUNTS_BASIC,ACCOUNTS_BALANCES,ACCOUNTS_DETAILS,ACCOUNTS_TRANSACTIONS,PAYMENTS_MULTIPLE'
. '&duration=1234';

$response = $this->curlRequest($url);
$body = substr($response, $curl_info['header_size']);
Expand Down
14 changes: 8 additions & 6 deletions python/generate_access_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
API_URI = 'https://api.nordeaopenbanking.com/'
CLIENT_ID = 'your client id here'
CLIENT_SECRET = 'your client secret here'
REDIRECT_URI = 'http://httpbin.org/get'
REDIRECT_URI = 'https://httpbin.org/'

"""
This is an example how to generate the access token from the scratch.
Expand All @@ -14,11 +14,13 @@
"""

def get_code():
endpoint = 'v1/authentication'
endpoint = 'v2/authorize'
payload = {
'client_id': CLIENT_ID,
'redirect_uri': REDIRECT_URI,
'state': ''
'redirect_uri': REDIRECT_URI + 'get',
'state': 'oauth2',
'scope': 'ACCOUNTS_BASIC,ACCOUNTS_BALANCES,ACCOUNTS_DETAILS,ACCOUNTS_TRANSACTIONS,PAYMENTS_MULTIPLE',
'duration': '1234'
}
r = requests.get(API_URI + endpoint, params=payload)
if not r.status_code == requests.codes.ok:
Expand All @@ -29,7 +31,7 @@ def get_code():


def get_access_token(code):
endpoint = 'v1/authentication/access_token'
endpoint = 'v2/authorize/access_token'
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'X-IBM-Client-Id': CLIENT_ID,
Expand All @@ -38,7 +40,7 @@ def get_access_token(code):

payload = {
'code': code,
'redirect_uri': REDIRECT_URI
'redirect_uri': REDIRECT_URI + 'post'
}
r = requests.post(API_URI + endpoint, data=payload, headers=headers)
if not r.status_code == requests.codes.ok:
Expand Down