Enables sending of multiple requests to an OFX server through a single connection.
ipworksofx_ofxbatch_open(); ipworksofx_ofxbatch_close($res); ipworksofx_ofxbatch_register_callback($res, $id, $function); ipworksofx_ofxbatch_get_last_error($res); ipworksofx_ofxbatch_get_last_error_code($res); ipworksofx_ofxbatch_set($res, $id, $index, $value); ipworksofx_ofxbatch_get($res, $id, $index); ipworksofx_ofxbatch_do_config($res, $configurationstring); ipworksofx_ofxbatch_do_postrequest($res); ipworksofx_ofxbatch_do_readofxdatafile($res, $filename); ipworksofx_ofxbatch_do_reset($res); ipworksofx_ofxbatch_do_writeofxdatafile($res, $filename);
The OFXBatch class allows your application to download account information, bank, credit card, investment, loan statements, make intrabank and/or interbank transfers, and/or download your FI profile in one single request submitted to the FI's OFX server. This class provides for applying a single authentication context to multiple requests in order to reduce the overhead of user authentication.
All downloads are batched into a single secure HTTPS connection to the financial institution. To use the OFXBatch class first identify the financial institution by setting the FIId, FIOrganization and FIUrl,properties. Next identify the OFX user and application by setting the OFXUser, OFXPassword, OFXAppId and OFXAppVersion properties. The same signon information will be used for the entire batch.
To build the request, depending on each request type, the corresponding IPWorks OFX components should be used. So, if account information, bank, credit card, investment, loan statement, bank transfer, and FI profile are part of this multiple request, then instances of Account, BankStatement, CCStatement, InvStatement, LoanStatement, BankTransfer, and FIProfile (corresponding to the each request type) should be used. The individual components that generate the OFX request aggregate will not need the sign on data to generate their request.
Set properties of each corresponding component (excluding the SignOn part which is already set), as you would do when using these components to send single requests to the server. Please refer to each class help files for details on how to build each individual OFX request .
OFXBatch.OFXBatchItems.Request = BankStatement.OFXRequest; OFXBatch.OFXBatchItems.Request = CCStatement.OFXRequest; OFXBatch.OFXBatchItems.Request = FIProfile.OFXRequest;
Then, use the PostRequest method to build and transmit the request automatically.
Message sets will/must appear in the following order in the request: Signon, Signup, Bank statement, Intrabank funds transfers, Credit card statements, Loan statements, Investment statements, Interbank funds transfers, and FI Profile, regardless of their order while populating the OFXBatchItems. In the server response, the message sets will be returned in the server response in the same order.
Upon successful response, the OFXBatchItemResponse array property will be populated automatically, which will contain several blocks of information consisting of a server response for each request. To parse this response, the OFXBatchItemResponse at the same index should be passed as OFXResponse of the corresponding component using the same order as submitted in the request.
BankStatement.OFXResponse = OFXBatch.OFXBatchItems.Response; CCStatement.OFXResponse = OFXBatch.OFXBatchItems.Response; FIProfile.OFXResponse = OFXBatch.OFXBatchItems.Response;
Properties of each class are now populated and ready for retrieval.
Note: If signon data is different across components, then they cannot be used in the same batch, otherwise an error will be thrown.
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
|FIId||Financial institution identifier.|
|FIOrganization||Financial institution organization name.|
|FirewallAutoDetect||This property tells the class whether or not to automatically detect and use firewall system settings, if available.|
|FirewallType||This property determines the type of firewall to connect through.|
|FirewallHost||This property contains the name or IP address of firewall (optional).|
|FirewallPassword||This property contains a password if authentication is to be used when connecting through the firewall.|
|FirewallPort||This property contains the TCP port for the firewall Host .|
|FirewallUser||This property contains a user name if authentication is to be used connecting through a firewall.|
|FIUrl||Financial institution URL.|
|OFXAppId||OFX application identifier.|
|OFXAppVersion||OFX application version.|
|OFXBatchItemCount||The number of records in the OFXBatchItem arrays.|
|OFXBatchItemRequest||OFX request aggregate.|
|OFXBatchItemRequestType||The type of OFX request included in the batch.|
|OFXBatchItemRequestUID||The current batch item's unique transaction ID.|
|OFXBatchItemResponse||The OFX response aggregate.|
|ProxyAuthScheme||This property is used to tell the class which type of authorization to perform when connecting to the proxy.|
|ProxyAutoDetect||This property tells the class whether or not to automatically detect and use proxy system settings, if available.|
|ProxyPassword||This property contains a password if authentication is to be used for the proxy.|
|ProxyPort||This property contains the TCP port for the proxy Server (default 80).|
|ProxyServer||If a proxy Server is given, then the HTTP request is sent to the proxy instead of the server otherwise specified.|
|ProxySSL||This property determines when to use SSL for the connection to the proxy.|
|ProxyUser||This property contains a user name, if authentication is to be used for the proxy.|
|SSLAcceptServerCertEncoded||The certificate (PEM/base64 encoded).|
|SSLCertEncoded||The certificate (PEM/base64 encoded).|
|SSLCertStore||The name of the certificate store for the client certificate.|
|SSLCertStorePassword||If the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.|
|SSLCertStoreType||The type of certificate store for this certificate.|
|SSLCertSubject||The subject of the certificate used for client authentication.|
|SSLServerCertEncoded||The certificate (PEM/base64 encoded).|
|Timeout||A timeout for the class.|
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
|Config||Sets or retrieves a configuration setting.|
|PostRequest||Submits a batch of requests to an OFX server through a single connection.|
|ReadOFXDataFile||Reads an OFX response from a file.|
|Reset||Reset the internal state of the class and all properties to their default values.|
|WriteOFXDataFile||Writes the OFX response sent by the server to a file.|
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
|ConnectionStatus||Fired to indicate changes in connection state.|
|Error||Information about errors during data delivery.|
|SSLServerAuthentication||Fired after the server presents its certificate to the client.|
|SSLStatus||Shows the progress of the secure connection.|
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
|CacheContent||If true, the original XML is saved in a buffer.|
|ErrorOnEmptyAttr||If true, passing an invalid attribute to the Attr method will throw an exception.|
|IgnoreBadAttributePrefixes||If true, bad (unknown) attribute prefixes are ignored.|
|IgnoreBadElementPrefixes||If true, bad (unknown) element prefixes are ignored.|
|PreserveWhitespace||If true, leading and trailing whitespace in element text is preserved.|
|BuildInfo||Information about the product's build.|
|CodePage||The system code page used for Unicode to Multibyte translations.|
|LicenseInfo||Information about the current license.|
|ProcessIdleEvents||Whether the class uses its internal event loop to process events when the main thread is idle.|
|SelectWaitMillis||The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.|
|UseInternalSecurityAPI||Tells the class whether or not to use the system security libraries or an internal implementation.|