Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Additional metadata on transactions #47

Open
troygilbert opened this issue Jul 26, 2018 · 8 comments
Open

Additional metadata on transactions #47

troygilbert opened this issue Jul 26, 2018 · 8 comments
Assignees
Labels

Comments

@troygilbert
Copy link

The OFX file includes some additional details for each transaction that are not captured when parsing. Would it be possible to extract those fields or include a SimpleXMLElement referencing the whole transaction so that other tools could pluck them out as needed? This seems to be the most straightforward way to extend the library without having to build a more extensive system.

@asgrim
Copy link
Owner

asgrim commented Jul 27, 2018

What does the metadata look like exactly please?

@asgrim asgrim self-assigned this Jul 27, 2018
@mkopinsky
Copy link

Unfortunately OFX/SGML files are not valid xml, so simply delegating to SimpleXML doesn't work. I do wish there were an SGML parser we could piggyback off of.

@asgrim
Copy link
Owner

asgrim commented Aug 6, 2018

This library does use SimpleXML, after bodging it up a bit, so it may be possible; though I'd rather have an explicit API for capturing metadata like this.

Do you have some anonymised sample data to show the structure of this metadata at all please?

@troygilbert
Copy link
Author

This is what I added to Ofx.php:231:

$transaction->cardNumber = (string)$t->CCACCTTO->ACCTID;

This represents the card number of the credit/debit card used for a specific transaction for accounts with multiple credit/debit cards.

I've not looked it up in any specifications, I just browsed the OFX file directly curious if the information was in there. ;-)

@asgrim
Copy link
Owner

asgrim commented Aug 7, 2018

Hmm - does the ACCTID in the (non-immediate) parent "credit account" node not already provide what you're looking for? - $creditAccount->accountNumber on L210 here

private function buildCreditAccount(SimpleXMLElement $xml)
{
$nodeName = 'CCACCTFROM';
if (!isset($xml->CCSTMTRS->$nodeName)) {
$nodeName = 'BANKACCTFROM';
}
$creditAccount = new BankAccount();
$creditAccount->transactionUid = $xml->TRNUID;
$creditAccount->agencyNumber = $xml->CCSTMTRS->$nodeName->BRANCHID;
$creditAccount->accountNumber = $xml->CCSTMTRS->$nodeName->ACCTID;

@troygilbert
Copy link
Author

It shows up there, but each transaction has the ID specified and they appear to be a mixture (as far as I can tell inspecting the resulting parsed data). (Wish I could provide some anonymized data, but I don't have the time to prepare that for you at the moment.)

@troygilbert
Copy link
Author

Hi James, I'm gonna send you some anonymized data via email -- not posting here in case I did a bad job of anonymizing! ;-)

@asgrim
Copy link
Owner

asgrim commented Aug 8, 2018

Thanks, received it; I'm not gonna be able to look at this for at least a couple months probably tho, got a lot of conferences/trips coming up I'm afraid :/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants