Add a transaction adapter
Before you begin
Procedure
-
In Studio, navigate in
to the
gw.lob.line.financialspackage. For Golf Cart, navigate togw.lob.go.financials. -
Right-click the
financialsnode, and then select . In the New Gosu Class dialog box, enter the name of the adapter. You specified the name of the adapter in theimplementsEntityelement of the transaction entity. For Golf Cart, enter GOTransactionAdapter. -
In the new Gosu class, write a constructor similar to the following for the
gw.lob.ho.GOTransactionAdapter:package gw.lob.go.financials uses gw.api.domain.financials.TransactionAdapter class GOTransactionAdapter implements TransactionAdapter { var _owner : entity.GOTransaction construct(owner : GOTransaction) { _owner = owner } }This code produces a Gosu error in the class statement that you fix in the next step.
-
Place the insertion point at the error (after
TransactionAdapter) and press Alt-Enter. Click the ImplementMethods command that pops up to open the Select Methods to Implement dialog box. With all listed methods selected, click OK to insert the empty methods into your code. - Write code for the new methods and properties. In most cases, the code for each method is a single line. Examine the transaction adapters for other lines of business as an example.
- At this point, you can verify your work. For instructions, see Verify your work.
