Node JS technical test with Stripe & Octobat APIs.
Clone this project
git clone git@github.com:bellangerq/technical-test.git
Install Node dependencies:
npm install
Create a .env file and store your Stripe keys (with dotenv):
PUBLISHABLE_KEY=pk_test_******
SECRET_KEY=sk_test_******
Create an Octobat account and link it with your Stripe account.
Launch local server and visit localhost:3000:
npm start
- STRIPE
- Create Stripe token
- Create Stripe charge
- Associate token to charge
- Show Stripe charge token if success (
.then) - Show status if error (
.catch) - Create form view
- Pass query parameters to Stripe token
- Redirect page on success
- Show error if any
- FRONT
- Design form
- Front form validations
- Design redirect page
- Display preview before payment
- Show amount with & without tax
- Show spinner on load
- OCTOBAT
- Add country in Stripe charge
- Add country selection in view
- Set chosen country to Octobat customer
- Apply tax rate depending on customer country
- Fetch tax rate in preview
- Make POST https://apiv2.octobat.com/tax_evidence_requests request on page load with default country
- Make POST https://apiv2.octobat.com/tax_evidence_requests request on
selectchanges with selected country - Update tax rate thanks to tax_evidence object
- MISC
- Deploy to Heroku
- Get the list of eligible countries
- Input price is HT