EDIT: App1 and App2 are web based systems.
So I have two applications, the one is an auth system, think SSO, payments, affiliate earnings and the other is a game plugged into the auth system.
App 1 = SSO & Payments App 2 = Game
Affiliates log into App 1 to create their affiliate identities and then they point users to App 2 using the unique affiliate code. Their customers play the game and the data is recorded on app 2.
Now what I want is an affiliate to log into app 1 and be able to quickly see all his earnings on app 2.
Methods considered:
App 2 has an api accessed by App 1: http://app2/get/earnings/uniquecode when an affiliate wants to view transactions, the page connects to the API which pulls all the data and shows on his or her page.
Alternatively, each time a transaction takes place on App 2, it posts this to an api on App 1 which stores it to a table. This means App 1 only needs to access a local db...
Are there other methods that could be considered?