Created
February 9, 2018 22:27
-
-
Save mmoravec/0176973070e4a2c91c439a86ac2b70ad to your computer and use it in GitHub Desktop.
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
function* getToken(action) { | |
const params = { | |
method: 'POST', | |
mode: 'cors', | |
body: JSON.stringify({ | |
merchantIdScanReference: 'YOURSCANREFERENCE1', | |
successUrl: 'https://www.your-site.com/sucess', | |
errorUrl: 'https://www.your-site.com/error', | |
}), | |
headers: new Headers({ | |
'Content-Type': 'application/json', | |
Accept: 'application/json', | |
'User-Agent': 'ThorToken Whitelist/0.0.1', | |
Authorization: | |
'Basic ' + base64.encode(credentials.jumio.api_token + ':' + credentials.jumio.api_secret), | |
}), | |
}; | |
debugger; | |
try { | |
const data = yield call( | |
fetch, | |
'https://netverify.com/api/netverify/v2/initiateNetverify', | |
params | |
); | |
debugger; | |
console.log(data); | |
yield put(getTokenSuccess(data)); | |
} catch (error) { | |
console.log(error); | |
yield put(getTokenFailure(error)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment