This is a React-based payment application that allows users to make payments using PIX, and copy payment details. This app includes a payment form with custom input handling, environment variable configuration, and deployment instructions.
The app can be seeing running in here: https://justpay.gruposkip.com/
- Real-time amount adjustment with range slider and manual input
- Payment submission with custom API key header
- Displays payment method with Pix code and QR code
- Option to copy the Pix code with one click
- Node.js and npm installed
- An API endpoint to handle payment requests
- Hosting account (for deployment)
-
Clone this repository to your local machine:
git clone https://github.com/devEduardoLemos/payment-app.git cd your-repo-name -
Install dependencies:
npm install
-
Create a
.envfile in the root directory, with the content:REACT_APP_API_KEY=your-api-key-value -
Start the development server:
npm start
- Amount Adjustment: Use the range slider or click on the displayed value to enter an amount manually.
- Description: Enter a description for the payment.
- Submit Payment: Click "Pay" to submit the payment.
- Copy Pix Code: Click the "Copy Pix Code" button to copy the Pix code to the clipboard.
Follow these steps to deploy your application to HostGator:
Build the app for production:
npm run buildThis will create a build folder containing optimized static files.
- Log in to the hosting: Access your dashboard panel.
- File Manager: Go to the File Manager and open the
public_htmlfolder. - Upload Build Files:
- Compress the
buildfolder into a.zipfile and upload it. - Extract the
.zipfile contents and move them to thepublic_htmlroot if needed.
- Compress the
Alternatively, you can upload the contents of the build folder to public_html via FTP.
If your app uses client-side routing, add a .htaccess file in public_html with the following content to redirect requests to index.html:
# Redirect all requests to index.html
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>Visit your domain (e.g., https://yourdomain.com) to confirm that the app is running as expected.
This project is licensed under the MIT License.