Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Interface is backwards in example #6

Open
andrew-templeton opened this issue Feb 10, 2022 · 0 comments
Open

API Interface is backwards in example #6

andrew-templeton opened this issue Feb 10, 2022 · 0 comments

Comments

@andrew-templeton
Copy link

https://github.com/CyberSource/cybersource-flex-samples-node/blob/master/express-microform/app.js#L85

^^^ Wrong, the right way is:

// note the FORMAT is a STRING as the first argument, and the encryptionType and targetOrigin must be object for SECOND argument
const getTokenizationToken = async () => new Promise((resolve, reject) =>
  new CybersourceRestApi.KeyGenerationApi(configuration()).generatePublicKey(
    'JWT',
    { encryptionType: 'RsaOaep256', targetOrigin: 'http://localhost:5000' },
    (error, data) => error ? reject(error) : resolve(data))
  )

getTokenizationToken().then(console.log).catch(console.error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant