{"id":25084730,"url":"https://github.com/apollo-level2-web-dev/payment-method-integration","last_synced_at":"2025-04-01T12:21:08.308Z","repository":{"id":273667525,"uuid":"920480900","full_name":"Apollo-Level2-Web-Dev/payment-method-integration","owner":"Apollo-Level2-Web-Dev","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-26T15:23:18.000Z","size":154,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-07T07:18:31.242Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Apollo-Level2-Web-Dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-22T08:22:56.000Z","updated_at":"2025-01-25T05:37:16.000Z","dependencies_parsed_at":"2025-01-22T09:28:05.842Z","dependency_job_id":"d900983a-3b50-4358-8c75-1b1c3653cfc4","html_url":"https://github.com/Apollo-Level2-Web-Dev/payment-method-integration","commit_stats":null,"previous_names":["apollo-level2-web-dev/payment-method-integration"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apollo-Level2-Web-Dev%2Fpayment-method-integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apollo-Level2-Web-Dev%2Fpayment-method-integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apollo-Level2-Web-Dev%2Fpayment-method-integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apollo-Level2-Web-Dev%2Fpayment-method-integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Apollo-Level2-Web-Dev","download_url":"https://codeload.github.com/Apollo-Level2-Web-Dev/payment-method-integration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246635941,"owners_count":20809333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-07T07:18:33.637Z","updated_at":"2025-04-01T12:21:08.284Z","avatar_url":"https://github.com/Apollo-Level2-Web-Dev.png","language":"TypeScript","readme":"````markdown\n# Payment Method Integration (Shurjopay)\n\nThis repository demonstrates the integration of the **Shurjopay** payment gateway with separate **backend** and **frontend** implementations. It provides a comprehensive guide to integrating Shurjopay into your applications seamlessly.\n\n---\n\n## Features\n\n- **Backend API** for initiating payments and handling callbacks.\n- **Frontend interface** to initiate payments and display transaction statuses.\n- Environment-based configurations for streamlined development and production.\n- Clear and scalable folder structure.\n\n---\n\n## Prerequisites\n\nEnsure you have the following before starting:\n\n1. **Shurjopay** merchant account and API credentials.\n2. [Node.js](https://nodejs.org/) (v14 or later) installed.\n3. Package manager like `npm` or `yarn`.\n4. A modern web browser for testing the frontend.\n\n---\n\n## Getting Started\n\n### Clone the Repository\n\n```bash\ngit clone https://github.com/Apollo-Level2-Web-Dev/payment-method-integration.git\ncd payment-method-integration\n```\n````\n\n---\n\n## Backend Setup\n\n1. **Navigate to the Backend Directory**\n\n   ```bash\n   cd backend\n   ```\n\n2. **Install Dependencies**\n\n   ```bash\n   npm install\n   ```\n\n3. **Configure Environment Variables**\n\n   Create a `.env` file in the `backend` directory and add the following variables:\n\n   ```\n   PORT=4000\n   DATABASE_URL=\"\u003cMongodb DATABASE_URL\u003e\"\n\n   JWT_ACCESS_SECRET=verysecret\n   JWT_REFRESH_SECRET=veryverysecret\n   JWT_ACCESS_EXPIRES_IN=7d\n   JWT_REFRESH_EXPIRES_IN=365d\n\n   SP_ENDPOINT=https://sandbox.shurjopayment.com\n   SP_USERNAME=sp_sandbox\n   SP_PASSWORD=pyyk97hu\u00266u6\n   SP_PREFIX=SP\n   SP_RETURN_URL=http://localhost:5173/order/verification\n   ```\n\n4. **Run the Backend Server**\n\n   ```bash\n   npm start\n   ```\n\n   The backend will run at `http://localhost:4000`.\n\n---\n\n## Frontend Setup\n\n1. **Navigate to the Frontend Directory**\n\n   ```bash\n   cd frontend\n   ```\n\n2. **Install Dependencies**\n\n   ```bash\n   npm install\n   ```\n\n3. **Configure Environment Variables**\n\n   Create a `.env` file in the `frontend` directory and add the following variable:\n\n   ```\n   Vite_APP_API_URL=http://localhost:4000/api/v1\n   ```\n\n4. **Run the Frontend Application**\n\n   ```bash\n   npm start\n   ```\n\n   The frontend will run at `http://localhost:5173`.\n\n---\n\n## Folder Structure\n\n### Root Directory\n\n```\n.\n├── backend/               # Backend API and logic\n├── frontend/              # Frontend user interface\n├── README.md              # Project documentation\n└── .gitignore             # Git ignore rules\n\n```\n\n---\n\n### Backend Folder Structure\n\n```\nbackend/\n├── src/\n│   ├── app/\n│   │   ├── config/          # Configuration files (e.g., database, environment setup)\n│   │   ├── errors/          # Custom error handling classes and utilities\n│   │   ├── interfaces/      # TypeScript interfaces and types\n│   │   ├── middlewares/     # Express middlewares for validation, logging, authentication, etc.\n│   │   ├── modules/         # Feature modules (e.g., payment module for Shurjopay integration)\n│   │   │   ├── payment/     # Shurjopay-specific logic\n│   │   │   │   ├── controller/  # Payment controllers for handling API requests\n│   │   │   │   ├── router/       # Route definitions for payment-related endpoints\n│   │   │   │   ├── service/      # Business logic and interaction with Shurjopay API\n│   │   │   │   └── model/        # Mongoose models or database schemas if needed\n│   │   ├── utils/           # Helper functions and utilities (e.g., logging, error handling)\n│   │   └── app.ts           # Main Express app configuration and initialization\n│   └── server.ts            # Server initialization and entry point\n├── .env                     # Environment variables (e.g., API credentials)\n├── package.json             # Node.js dependencies\n└── tsconfig.json            # TypeScript configuration\n\n```\n\n---\n\n### Frontend Folder Structure\n\n```\nfrontend/\n├── public/                # Public assets\n├── src/\n│   ├── components/        # Reusable UI components\n│   ├── pages/             # Application pages (e.g., Payment, Success)\n│   ├── services/          # API calls to the backend\n│   ├── App.tsx            # Main App component\n│   ├── index.tsx          # Entry point for React\n├── .env                   # Environment variables\n├── package.json           # Node.js dependencies\n└── tsconfig.json          # TypeScript configuration\n\n```\n\n---\n\n## Payment Callback\n\nThe Shurjopay gateway sends transaction details to the **`RETURN_URL`** and **`CANCEL_URL`** specified in the `.env` file. Ensure these endpoints are correctly implemented in the backend to handle the responses.\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](https://chatgpt.com/c/LICENSE) file for details.\n\n---\n\n## Contact\n\nFor any questions or assistance, feel free to open an issue in the repository's [Issues](https://github.com/Apollo-Level2-Web-Dev/payment-method-integration/issues) section.\n\n```\n\nThis version improves readability, organizes information clearly, and includes all relevant details for both backend and frontend setups. Let me know if you need further customizations!\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapollo-level2-web-dev%2Fpayment-method-integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapollo-level2-web-dev%2Fpayment-method-integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapollo-level2-web-dev%2Fpayment-method-integration/lists"}