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

Add ability to retrieve a source #107

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

bigomise
Copy link
Contributor

Add ability to retrieve a source https://www.omise.co/source-api

@chutiphon-k
Copy link

Cannot use sources.retrieve with publicKey, it receive error authentication failed. Please change to use secretKey .

var sources = function(config) {
  return resource.resourceActions('sources',
    ['create', 'retrieve'],
    {'key': config['secretKey'], 'omiseVersion': config['omiseVersion']}
  );
};

@varshard
Copy link
Contributor

@bigomise As @chutiphon-k said. retrieve use secret key, while create use public key.

https://www.omise.co/source-api

Change `publicKey` to `secretKey`
['create'],
{'key': config['publicKey'], 'omiseVersion': config['omiseVersion']}
['create', 'retrieve'],
{'key': config['secretKey'], 'omiseVersion': config['omiseVersion']}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create use publicKey (even though, secretKey is acceptable here), but retrieve only permit using secretKey. So, the ideal solution would be using publicKey on create and secretKey on retrieve.

@chutiphon-k
Copy link

Did you fix yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants