So basically you need to write two functions to complete that script. The function alreadyProcessed() takes the value in $eventId and determines if you already processed this event. It needs to return either true or false for the if statement to work.
Then you need a function called doProcessEvent(…) that actually adds the event to however you’re going to track things.
Supersonic can’t be more specific. They don’t know anything about what kind of database you are using. They don’t have any ideas about how your database is structured. The only assumption they have about your data model is you can look up records by whatever value they use for $eventId.
I don’t know how SQL friendly you are or how much PHP/MySQL you know, but “alreadyProcessed” just needs to query your database (and again I can’t make assumptions about your setup) similar to:
$query = “SELECT * FROM yourdata WHERE eventId=’” . $eventId . “’”;
you would then query your database (assuming you have a database column named eventid…). Then you would check the result of the query and if it returned data (i.e. it found a row with that eventId) then you would return true if you got nothing back you would return 0.
Then the other function would add a record to the database. You would use an “INSERT INTO tablename” type query to insert the record. At this point things get really abstract, but at a minimum you would need a database table that has an auto-incrementing integer index field. You would need string type fields for each of the variables they provide, though rewards might be a number type field. I’d need to see the values to make sure.
And that would take care of their call back needs.
Rob