Confirming a transaction from Python?

J's Avatar

J

Feb 19, 2019 @ 05:03 AM

I'm writing a script to process transactions using a Python script. Is there a way to get the Confirmed/Unconfirmed state of a transaction? I'd like the script to not process transactions that are already confirmed. Also is there a way to set a transaction as Confirmed? I'm trying to avoid doing that manually after.

I tried looking at getStatus(), but that seems to always return 40 and I can't seem to find what the status actually means in the Java developer documentation

  1. 1 Posted by J on Feb 19, 2019 @ 06:30 AM

    J's Avatar

    OK.So I think I found part of the answer. txn.isNew() seems yield confirmed/unconfirmed status from what I can tell.
    There doesn't seem to be a way to change isNew to False??
    (Still not clear what getStatus() is for?)

  2. Support Staff 2 Posted by Sean Reilly on Feb 19, 2019 @ 11:35 PM

    Sean Reilly's Avatar

    Hi J,

    Great questions! You're right about the meaning of isNew() and you can also use setIsNew(false) to mark a transaction as confirmed.

    As for getStatus(), that has a bit of documentation here: https://infinitekind.com/dev/apidoc/com/infinitekind/moneydance/mod... but the short answer is that it is the old version of getClearedStatus() and should really be marked as deprecated.

    Thanks,

    Sean Reilly
    Developer, The Infinite Kind
    http://infinitekind.com

  3. 3 Posted by J on Feb 20, 2019 @ 03:51 AM

    J's Avatar

    Thanks for the response. So I tried txn.setIsNew(False) and that works well. Is there a reason that setIsNew isn't documented?

    Had another question...what do I feed into setClearedStatus()? I see it wants AbstractTxn.ClearedStatus, but I'm not sure how to create something in Python set this value. I'd like to be able to set the CLEARED, RECONCILING, UNRECONCILED state from Python as well.

  4. 4 Posted by Jim C on Feb 26, 2019 @ 04:44 AM

    Jim C's Avatar

    (Bumping my own thread...)
    Any thoughts on:
    how to setClearedStatus() in Python? I see it wants
    AbstractTxn.ClearedStatus, but I'm not sure how to create something in
    Python set this value. I'd like to be able to set the CLEARED, RECONCILING,
    UNRECONCILED state from Python as well.

  5. System closed this discussion on May 28, 2019 @ 04:50 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac