-
Notifications
You must be signed in to change notification settings - Fork 169
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
Feature 260/currency converter #273
base: main
Are you sure you want to change the base?
Feature 260/currency converter #273
Conversation
<p>method: 'GET', // this is the method used get method retrieves data | ||
<p>headers: { // takes in our api key as application json | ||
<p>accept: 'application-json', | ||
<p>'X-API-KEY': "f53b14db7658d93aeb2f8589838b87e01d730d82b9c73e9878065452902790b7" //for best practices save your api key in the .env file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not have this key in the frontend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i passed it has an env variable. The one above is for demo purposes for those who may not know how to use env
'X-API-KEY' : "f53b14db7658d93aeb2f8589838b87e01d730d82b9c73e9878065452902790b7" | ||
} | ||
}; | ||
const apiUrl = 'https://api.chimoney.io/v0.2/info/usd-amount-in-local?destinationCurrency=USD&amountInUSD=1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the endpoint for currency converter it is then passed to the fetch method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IS this not converting USD to USD?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it converts local to usd
here is the link to the project this site uses the chimoney api for converting currency. This site converts currency i.e from KES, GHN, NG to local |
Please set this up with the Chimoney API credentials so it works. I am getting |
i have tried generating several api-keys but they are giving the error 500 (key not valid) |
'X-API-KEY' : "f53b14db7658d93aeb2f8589838b87e01d730d82b9c73e9878065452902790b7" | ||
} | ||
}; | ||
const apiUrl = 'https://api.chimoney.io/v0.2/info/usd-amount-in-local?destinationCurrency=USD&amountInUSD=1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that you’re using the prod endpoint instead of staging. You can switch between prod and staging endpoint in the api docs
also consider managing api keys, chimoney base url and other changeable parameters in env variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cant find any resources about the prod and staging endpoints can we have a live meeting you show me the way around?
No description provided.