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

Feature 260/currency converter #273

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

davidongora
Copy link
Contributor

No description provided.

<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
Copy link
Contributor

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

Copy link
Contributor Author

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'
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this do?

Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

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

@phyleria phyleria added the hacktoberfest Hacktoberfest issues label Oct 23, 2023
@davidongora
Copy link
Contributor Author

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

https://currency-converter-coral-chi.vercel.app/

uchibeke
uchibeke previously approved these changes Oct 25, 2023
@uchibeke
Copy link
Contributor

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

https://currency-converter-coral-chi.vercel.app/

Please set this up with the Chimoney API credentials so it works. I am getting Result: {"status":"error","error":"key not valid. Generate a new one from the developer portal"}

@davidongora
Copy link
Contributor Author

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'
Copy link
Contributor

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

Copy link
Contributor Author

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?

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

Successfully merging this pull request may close these issues.

3 participants