Pay3 Unity Integration
Event Listeners
2min
after completing transactions in pay3 sdk ui, the pay3 sdk publishes events via firebase real time database for all native sdks the listener can be registered after successfully completing the anonymos login in firebase which happens during initialisation pay3 sdk transaction status this event is fired by pay3 sdk in following scenario on completion of checkout transaction triggered by triggeropencheckout snapshot payload data (type object) following keys are present in this object status (type string) the status can have values success or error message (type string) user friendly message returned after completion of the transaction orderid (type string) pay3 order id requestid (type string) unique id passed by app error (type object, optional) following keys will be present if there is an error please refer to sdk errors docid\ upvtc67wkwgncscjvaq0v for reference code (type number) error code message (type string) error message pay3helper cs public class pay3helper monobehaviour { // pseudocode to attach a listner to receive transaction status // events with in the unity application private void starttransactionlistener() { firebasedatabase getinstance(fbapp) getreference("/app notifications/"+fbuserid+"/pay3 sdk transaction status") valuechanged += (object sender2, valuechangedeventargs event) => { // extract event data from snapshot object returned by the event listener }; } }