users and a collection orders in the database. An order belongs to a customer through a field user. An order has a field order_reference and payment_reference that are ids of objects from Razorpay.
.png?fit=max&auto=format&n=UDnqA5TqR2qMKTU8&q=85&s=1075420315c0e8ae5ec139b9bf3e105d)
Models
models/users.js
forest/razorpay-orders.js
Add relationships to virtual collections
You need to declare a relationship between theusers collection and the virtual razorpayPayments and razorpayOrders collections in the forest/users.js file.
Define route logic for the relationship
You now have to implement the logic to be executed to retrieve and send the information from Razorpay to the UI when the corresponding route is called. This is done in the fileroutes/users.js. Remember that you need to properly serialize the objects in order for the UI to correctly display them, using the RecordsSerializer.