A Ruby on Rails e-commerce application featuring user authentication, product management, shopping cart functionality, and Mpesa payment integration
A Ruby on Rails e-commerce application featuring user authentication, product management, shopping cart functionality, and Mpesa payment integration.
Before you begin, ensure you have the following installed:
Clone the repository:
git clone https://github.com/Raymond9734/rails-shop.git
cd rails-shop
Make the script Executable then Run the setup script:
chmod +x ./setup.sh
./setup.sh
Configure your environment variables in .env
:
MPESA_CONSUMER_KEY: 'your_consumer_key'
MPESA_CONSUMER_SECRET: 'your_consumer_secret'
MPESA_PASSKEY: 'your_passkey'
MPESA_SHORTCODE: 'your_shortcode'
MPESA_INITIATOR_NAME: 'your_initiator_name'
MPESA_INITIATOR_PASSWORD: 'your_password'
CALLBACK_URL: 'your_ngrok_url'
REGISTER_URL: "https://sandbox.safaricom.co.ke/mpesa/c2b/v1/registerurl"
Start the Rails server:
rails server
In a separate terminal, start ngrok:
ngrok http 3000
Update the callback URL in .env
with your new ngrok URL:
CALLBACK_URL: 'your-new-ngrok-url'
Run the test suite:
rails test