How to create math with wixcodes - I need an expert

I have created a website that requires alot of calculation and automatic matching base on data calculations… I need help on how to allow the data automatically matches one user to another base on the calculations that I will program. Example below

If user1 is to donate $100
User2 should me matched with user1 to receive the donation

user1 should be able to send a prompt (POP) message to User2 when he made his payment
so that the user2 can confirm his payment…

I have already finished develping my website and this is the help that I need right now.

Hi,

i’d think about the donation as a transaction between 2 users.

  1. user1 is looking for a match, choose user2 and initiate the transaction
  2. user2 should be notified (email for example), and should choose to accept, and approve the money transfer
    i’d recommend you design the entire flow, each of the states (donation accepted, rejected, money transfered, money transfer confirmed etc), model the different actions the users can make in each of the donation states (approve, reject, propose donation, confirm money transfered etc).
    the different states should be reflected in the status of the donation in the db, actions as buttons visible to specific user (user1/user2) in each of the states.

if you have a specific question you might need help with, please let me know
thanks,
Shlomi

1 Like

If you take a look at the screen shot above, you will see a table that I created… I have a table for when a user post that he want to make a donation, and I have another table for when the user1 is matched with another user who is supposed to receive the amount of money user1 is willing to donate and I have another table for the user1 that is makin three tables…

table1 contains user1 information of the amount he is willing to donate
table2 contains user2 information displaying on user1’s profile
table3 contains user1 information displaying on user2’s profile

want these tables to display at a specific time, that is when the action is been made from user 1, then table1will display, then when our database match user1 with a specific user who is to receive that amount then table two appears to user1 with user2’s payment receving details and the same time user1’s details displaying on user2’s dynamic profile page…

We have already done the dynamic pages and they are working, and we have done the tables, but ll tables are showing at once, but we want a query to call each table base on a specific action,

Additionally, going back to my initial question, I need your help with how to make those functions you spoke about above work, that is exactly part of my puzzle here and you answered it perfectly, but I need your help on how to also make those kind of action buttoms, if, after, before and etc…

Thank you for responding

1 Like

Hi,

can you please share the url of the website you are building?
i’d recommend you keep the donation in a single db collection but with different statuses, it will also make it easier to change the state (status) of each donation.
keep the db model clear and simple, while design the different display pages for different type of users with those tables you discussed above. each of those table can have a different view (data set) of the same db collection, filtering donations of a specific status for the users.

the wix code approach to this table would be use of wix-code repeaters just design their repeating layouts to best match your table design you like, not the images design you’d see in most examples.
then, please use our code reference you can find here to draw the action buttons which matches the current donation state.
for example the current user1 that is watching the ‘donation table’ as you called it, might have 2 different donations proposed:

  1. for 100usd from user2 in the status ‘suggested’ he can then click on one of each buttons → ‘confirm’ or ‘decline’ each can implement an onclick event and eventually move the donation to the next status in the flow
  2. for 150usd from user3 which was was already approved and in the status of ‘awaiting transaction money wire’ which has no available actions for user1 at all and thus no buttons

user2 and user3 which are making the donations will have their own view which is different, but based on the same db collection with their own available action on each of the items. all depends on the flow (or as us computer geeks call - state machine or workflow) you should design for your site

good luck!
Shlomi

You are great… This is the url to my website

born2wingh.com

1 Like