Yeah, only way I can think to do this is to save the identifier for the payment card in a custom record with a duplicate of the memo. Since record.PAYMENT_CARD is an enum for the record module, you should be able to script it. I wonder if you can record.load and then record.getValue()? Instead of search... not sure it that fits your use case though, if you need a lookup of the id or something.