I need Javascript Developer
Budget: ₹600 – ₹1,500 INR
Project Requirements: Fixing Credit Point Update Issue in Wix Integration with Razorpay Payment Gateway
Background:
You are working on a Wix site that integrates with a Razorpay payment gateway for users to purchase plans. Based on the plan purchased, users should receive corresponding credit points, which are stored in the Wix database (UserCredits collection). After a successful payment, the credit points should be updated and displayed correctly on the user dashboard.
Current Problem:
Issue: After a payment is made via Razorpay, the credit points are not being updated correctly in the database. The points remain at 0 for the user, even though the payment was successful.
Objective: Ensure that after a successful payment, the credit points are updated according to the selected plan and are displayed correctly on the user’s dashboard.
Scope of Work:
Investigate the Existing Code:
Review the current frontend code (Wix Code) that interacts with Razorpay and the backend code that updates the credit points in the database.
Verify the logic in both the frontend and backend for correctly updating the user’s credits after a payment.
Ensure Proper Data Flow:
Ensure the payment success details are correctly passed from the Razorpay payment gateway to the backend function updateCreditsOnPurchase().
Verify that the correct plan is passed in the paymentDetails object and that the plan’s associated credit points are calculated correctly.
Backend Verification:
Ensure the updateCreditsOnPurchase() function in the backend is properly updating the credit points for the user in the UserCredits collection.
If the user already exists in the collection, update their credits; if not, create a new record.
Ensure that the user record is queried and updated correctly in the database.
Frontend Credit Display:
Review the code in the frontend that fetches and displays the user’s credits using the displayUserCredits() function.
Ensure the frontend is querying the UserCredits collection and properly displaying the credit points.
Test Payment Workflow:
Simulate a payment using the Razorpay gateway and verify that the backend correctly updates the user’s credit points based on the plan selected.
Ensure the frontend reflects the correct number of credits after the payment is processed.
Debugging and Logs:
Check the Wix Developer Console for any potential errors or logs that could provide insight into where the issue is occurring.
Review the logs for payment success callbacks and verify if they contain the correct plan details.
Documentation:
Document the changes made to the code to fix the issue.
Provide clear instructions on how the system works for future reference (e.g., plan-to-credit mapping, backend logic, etc.).
Deliverables:
A working solution where credit points are properly updated in the UserCredits collection after a successful payment.
Verified changes in both frontend and backend code to ensure the user’s credits are updated correctly and displayed on their dashboard.
Debugging logs or any other documentation to explain how the issue was fixed.
Testing results with detailed steps on how to verify the fix.
Technical Details:
Frontend Code: Wix (Velo) with JavaScript, interacts with the updateCreditsOnPurchase function in the backend.
Backend Code: Wix backend (openai.jsw), calls the Razorpay API, updates the UserCredits collection.
Payment Gateway: Razorpay
Database: Wix Data (UserCredits collection)
Assumptions:
The user is logged in before making a payment.
The Razorpay API integration is functioning correctly.
Freelancer Skills Required:
Wix Velo (Wix Code) development
Razorpay payment gateway integration
Wix database (Wix Data) management
JavaScript (Node.js for backend functions)
Experience with troubleshooting and debugging Wix applications
Background:
You are working on a Wix site that integrates with a Razorpay payment gateway for users to purchase plans. Based on the plan purchased, users should receive corresponding credit points, which are stored in the Wix database (UserCredits collection). After a successful payment, the credit points should be updated and displayed correctly on the user dashboard.
Current Problem:
Issue: After a payment is made via Razorpay, the credit points are not being updated correctly in the database. The points remain at 0 for the user, even though the payment was successful.
Objective: Ensure that after a successful payment, the credit points are updated according to the selected plan and are displayed correctly on the user’s dashboard.
Scope of Work:
Investigate the Existing Code:
Review the current frontend code (Wix Code) that interacts with Razorpay and the backend code that updates the credit points in the database.
Verify the logic in both the frontend and backend for correctly updating the user’s credits after a payment.
Ensure Proper Data Flow:
Ensure the payment success details are correctly passed from the Razorpay payment gateway to the backend function updateCreditsOnPurchase().
Verify that the correct plan is passed in the paymentDetails object and that the plan’s associated credit points are calculated correctly.
Backend Verification:
Ensure the updateCreditsOnPurchase() function in the backend is properly updating the credit points for the user in the UserCredits collection.
If the user already exists in the collection, update their credits; if not, create a new record.
Ensure that the user record is queried and updated correctly in the database.
Frontend Credit Display:
Review the code in the frontend that fetches and displays the user’s credits using the displayUserCredits() function.
Ensure the frontend is querying the UserCredits collection and properly displaying the credit points.
Test Payment Workflow:
Simulate a payment using the Razorpay gateway and verify that the backend correctly updates the user’s credit points based on the plan selected.
Ensure the frontend reflects the correct number of credits after the payment is processed.
Debugging and Logs:
Check the Wix Developer Console for any potential errors or logs that could provide insight into where the issue is occurring.
Review the logs for payment success callbacks and verify if they contain the correct plan details.
Documentation:
Document the changes made to the code to fix the issue.
Provide clear instructions on how the system works for future reference (e.g., plan-to-credit mapping, backend logic, etc.).
Deliverables:
A working solution where credit points are properly updated in the UserCredits collection after a successful payment.
Verified changes in both frontend and backend code to ensure the user’s credits are updated correctly and displayed on their dashboard.
Debugging logs or any other documentation to explain how the issue was fixed.
Testing results with detailed steps on how to verify the fix.
Technical Details:
Frontend Code: Wix (Velo) with JavaScript, interacts with the updateCreditsOnPurchase function in the backend.
Backend Code: Wix backend (openai.jsw), calls the Razorpay API, updates the UserCredits collection.
Payment Gateway: Razorpay
Database: Wix Data (UserCredits collection)
Assumptions:
The user is logged in before making a payment.
The Razorpay API integration is functioning correctly.
Freelancer Skills Required:
Wix Velo (Wix Code) development
Razorpay payment gateway integration
Wix database (Wix Data) management
JavaScript (Node.js for backend functions)
Experience with troubleshooting and debugging Wix applications