The main entry point to the GBuy API. You create one instance of this class and use it to send messages to GBuy and register the order callback. It must be passed a transport implementation that will be used to send and receive the GBuy messages. To send commands to GBuy you do:
StandAlone transport = new StandAlone(clientFactory, serverFactory, merchantId, merchantKey, gbuyURL); GBuy gbuy = new GBuy(transport); gbuy.getOrder(orderNumber).archive();
To receive notifications, you must create an implementation of the OrderListener interface and call registerOrderListener. Then call start() to start listening for connections.
StandAlone transport = new StandAlone(clientFactory, serverFactory, merchantId, merchantKey, gbuyURL); GBuy gbuy = new GBuy(transport); gbuy.registerOrderListener(orderListener); guy.start();
You can call registerOrderListener and registerCalculationListener multiple times, but it will have no effect until you call start. Once the GBuy is started, you can change the listeners, but always remember to call start so the changes are applied.