Skip to content

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