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

Added Payment Page in VigyBag #2178

Merged
merged 3 commits into from
Aug 8, 2024

Conversation

SadafKausar2025
Copy link
Contributor

@SadafKausar2025 SadafKausar2025 commented Aug 8, 2024

Fixes Issue #2177

Closes #2177

Changes proposed

Screenshots

Screenshot (2328)
Screenshot (2329)
Screenshot (2330)

Note to reviewers

Summary by CodeRabbit

  • New Features

    • Introduced a new payment page accessible via the navigation route payment-page.
    • Added a payment policy page for comprehensive guidance on payment methods.
    • Enhanced user understanding of payment processes with detailed information on various payment options.
  • Bug Fixes

    • Updated the "Terms & Conditions" link in the footer to redirect users to the new payment page.
  • Documentation

    • Improved clarity on payment options, security measures, and terms associated with each payment method for a better user experience.

Copy link

vercel bot commented Aug 8, 2024

@SadafKausar2025 is attempting to deploy a commit to the Vivek Prajapati's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Aug 8, 2024

Walkthrough

This update introduces a new payment information page to the VigyBag application, enhancing user navigation and functionality. New routes for the Payment_Page and Payment_Policy components have been added, allowing users to access various payment options and policies directly. Additionally, the Footer component has been modified to redirect users from the "Terms & Conditions" link to the payment page, thereby improving the overall user experience.

Changes

Files Change Summary
src/App.jsx, src/User/components/Footer/Footer.jsx Added routes for Payment_Page and Payment_Policy, and updated the Footer link to point to /payment-page.
src/User/pages/Payment-Page/payment-page.jsx, src/User/pages/Payment-Policy/payment-policy.jsx Implemented Payment_Page and Payment_Policy components with detailed payment information and policies.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Footer
    participant App
    participant Payment_Page
    participant Payment_Policy

    User->>Footer: Clicks on "payments"
    Footer->>App: Navigates to /payment-page
    App->>Payment_Page: Renders payment options
    Payment_Page-->>User: Displays payment information

    User->>Footer: Clicks on "payment policy"
    Footer->>App: Navigates to /payment-policy
    App->>Payment_Policy: Renders payment policy
    Payment_Policy-->>User: Displays payment policy information
Loading

Assessment against linked issues

Objective Addressed Explanation
Add payment information page in VigyBag (#2177)
Provide information on payment policies (#2177)

🐰 In the land of VigyBag, so bright and grand,
A payment page has sprung, just like we planned!
With options galore and a link to explore,
Users rejoice, for they’ll find so much more!
So hop on in, and give it a try,
With every click, let transactions fly! ✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b32e861 and cdedaa5.

Files selected for processing (3)
  • src/App.jsx (2 hunks)
  • src/User/components/Footer/Footer.jsx (1 hunks)
  • src/User/pages/Payment-Page/payment-page.jsx (1 hunks)
Additional comments not posted (4)
src/User/components/Footer/Footer.jsx (1)

238-239: Verify navigation change from "Terms & Conditions" to "payments".

The link text and destination have been changed from "Terms & Conditions" to "payments". Ensure this change aligns with the intended user journey and that users will not miss important legal information previously accessible here.

Verification successful

Navigation change verified: "Terms & Conditions" is still accessible.

The "Terms & Conditions" link is still present in the footer and on the payment page, ensuring users can access important legal information. The change to "payments" does not remove this access.

  • src/User/components/Footer/Footer.jsx: Contains "Terms & Conditions".
  • src/User/pages/Payment-Page/payment-page.jsx: References "Terms & Conditions".
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of "Terms & Conditions" in the codebase to ensure it is still accessible.

# Test: Search for "Terms & Conditions" usage. Expect: Occurrences of the term in other parts of the codebase.
rg --type js -A 5 $'Terms & Conditions'

Length of output: 929

src/App.jsx (2)

41-41: Import statement for Payment_Page component.

The import statement for the Payment_Page component is correctly added. Ensure that the path is accurate and the component is implemented as expected.


186-186: New route for Payment_Page added.

The route for the Payment_Page component has been added successfully. Verify that this page is accessible and functions as intended within the application.

src/User/pages/Payment-Page/payment-page.jsx (1)

3-612: Content and structure of Payment_Page.

The content is detailed and covers various aspects of payment methods and policies. Ensure that all information is accurate and up-to-date. Consider adding links to bank registration pages for 3D Secure passwords if applicable.


const Payment_Page = () => {
useEffect(() => {
document.title = "VigyBag | Return and Cancellation";
Copy link
Contributor

Choose a reason for hiding this comment

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

Update document title to reflect the page content.

The document title is set to "VigyBag | Return and Cancellation", which seems incorrect for a payment page. Update the title to accurately reflect the page's purpose.

-    document.title = "VigyBag | Return and Cancellation";
+    document.title = "VigyBag | Payment Information";
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
document.title = "VigyBag | Return and Cancellation";
document.title = "VigyBag | Payment Information";

@codervivek5
Copy link
Owner

codervivek5 commented Aug 8, 2024

rename this routes to payment-policy or payment-information

not payment page

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between cdedaa5 and 930deaa.

Files selected for processing (1)
  • src/User/pages/Payment-Page/payment-page.jsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/User/pages/Payment-Page/payment-page.jsx

@SadafKausar2025
Copy link
Contributor Author

hello @codervivek5
sir I have changed the route name

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 930deaa and 8943cd9.

Files selected for processing (2)
  • src/App.jsx (2 hunks)
  • src/User/pages/Payment-Policy/payment-policy.jsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/App.jsx
Additional comments not posted (2)
src/User/pages/Payment-Policy/payment-policy.jsx (2)

1-6: LGTM! Proper use of imports and useEffect.

The import statement and useEffect usage for setting the document title are correct and appropriate.


620-620: LGTM! Correct export statement.

The default export of the component is correct and follows React best practices.

Comment on lines +8 to +617
</tr>
</tbody>
</table>
<p className="text-sm">
There is NO processing fee charged for availing VigyBag's EMI
payment option. On return or exchange, interest charged by the
bank till that time will not be refunded by VigyBag.
</p>
<p className="text-sm">
You may check with the respective bank/issuer on how a
cancellation, refund or pre-closure could affect the EMI terms,
and what interest charges would be levied on you for the same.
</p>
<h4>Example and Calculations</h4>
<p className="text-sm">
The table below shows a representative rendering of EMI plans for
a ₹20,000 purchase on VigyBag paid using the EMI payment plan:
</p>
<div className="overflow-x-auto">
<table className="min-w-full border-2 border-black">
<thead className="border-2">
<tr className="border-2 border-black">
<th className="border-2 border-black">Tenure (months)</th>
<th className="border-2 border-black">Loan amount</th>
<th className="border-2 border-black">
Monthly installment
</th>
<th className="border-2 border-black">
Bank interest rate
</th>
<th className="border-2 border-black">
Total effective price you pay
</th>
<th className="border-2 border-black">
Interest paid to Bank
</th>
</tr>
</thead>
<tbody>
<tr className="border-2 border-black">
<td className="border-2 border-black">3</td>
<td className="border-2 border-black">₹20,000</td>
<td className="border-2 border-black">₹6,800.44</td>
<td className="border-2 border-black">12.00%</td>
<td className="border-2 border-black">₹20,401.33</td>
<td className="border-2 border-black">₹401.33</td>
</tr>
<tr className="border-2 border-black">
<td className="border-2 border-black">6</td>
<td className="border-2 border-black">₹20,000</td>
<td className="border-2 border-black">₹3,450.97</td>
<td className="border-2 border-black">12.00%</td>
<td className="border-2 border-black">₹20,705.80</td>
<td className="border-2 border-black">₹705.80</td>
</tr>
<tr className="border-2 border-black">
<td className="border-2 border-black">9</td>
<td className="border-2 border-black">₹20,000</td>
<td className="border-2 border-black">₹2,344.32</td>
<td className="border-2 border-black">13.00%</td>
<td className="border-2 border-black">₹21,098.89</td>
<td className="border-2 border-black">₹1,098.89</td>
</tr>
<tr className="border-2 border-black">
<td className="border-2 border-black">12</td>
<td className="border-2 border-black">₹20,000</td>
<td className="border-2 border-black">₹1,786.35</td>
<td className="border-2 border-black">13.00%</td>
<td className="border-2 border-black">₹21,436.15</td>
<td className="border-2 border-black">₹1,436.15</td>
</tr>
</tbody>
</table>
</div>
<br />
<h3 className="text-black font-bold text-sm">
How do I make a payment using VigyBag's credit card EMI option?
</h3>
<br />
<p className="text-sm">
Once you've added the desired items to your VigyBag shopping cart,
proceed with your order as usual by entering your address. When
you're prompted to choose a payment mode for your order, select
'EMI' & follow these simple steps:
</p>
<ol>
<li>Choose your credit-card issuing bank you wish to pay from</li>
<li>Select the EMI plan of your preference</li>
<li>Enter your credit card details</li>
<li>Click 'Save and Pay'</li>
</ol>
<p className="text-sm">
Please note that the full amount will be charged on your card the
day of the transaction.
</p>
</section>
</main>
</div>
</div>
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider breaking down the component into smaller components.

The component contains a lot of static text, which could be broken down into smaller, reusable components. This would improve maintainability and readability.

// Example of breaking down into smaller components
const PaymentMethods = () => (
  <section>
    <h3 className="text-black font-bold text-sm">How do I pay for a VigyBag purchase?</h3>
    <p className="text-sm">VigyBag offers you multiple payment methods...</p>
  </section>
);

// Usage in the main component
const Payment_Policy = () => {
  useEffect(() => {
    document.title = "VigyBag | Return and Cancellation";
  }, []);

  return (
    <div className="bg-[#fff0e3ff] text-gray-800 p-4 md:p-8 font-sm">
      <div className="max-w-6xl mx-auto bg-white shadow-md p-4 md:p-8 rounded-lg mt-24">
        <main>
          <PaymentMethods />
          {/* Other sections */}
        </main>
      </div>
    </div>
  );
};

Copy link

vercel bot commented Aug 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vigybag ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2024 4:41pm

@codervivek5 codervivek5 merged commit ee95844 into codervivek5:main Aug 8, 2024
2 checks passed
Copy link

github-actions bot commented Aug 8, 2024

Congratulations, Your pull request has been successfully merged 🥳🎉 Thank you for your contribution to the project 🚀 Keep Contributing!! ✨

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

Successfully merging this pull request may close these issues.

feature : Adding Payment Page of vigybag
2 participants