mapping one_time_invoices to its owning entity

c.stadach's Avatar

c.stadach

08 Jun, 2011 08:50 AM

Is it possible to map a one_time_invoice to a detail in an account.

I realize there is an invoice id. But unfortunatelly I get the whole client information including all his invoices returned, when creating a one time invoice through the API with help from the expectedbehavior/cheddargetter_client_ruby gem.

From my point of view I cannot define for certain which invoice is the one I just created.
Is it the last entered one? But what if two invoices where created simultaneously? Will both be in the return hash?

thanks for the help
Christian

  1. Support Staff 1 Posted by Marc Guyer on 08 Jun, 2011 02:54 PM

    Marc Guyer's Avatar

    Invoices have a "type". Normal recurring invoices are type=subscription. One-time invoices are type=one-time. That should help with duplicates. Does that answer your question?

  2. 2 Posted by c.stadach on 08 Jun, 2011 02:56 PM

    c.stadach's Avatar

    But what if there are more than one one_time_invoice.
    In this case the type is not an identifying attribute

  3. Support Staff 3 Posted by Marc Guyer on 08 Jun, 2011 03:46 PM

    Marc Guyer's Avatar

    I suppose it's still possible to have more than one one-time invoice at the same moment. Just playing devil's advocate: what would be the consequences if it did happen?

  4. 4 Posted by c.stadach on 08 Jun, 2011 04:07 PM

    c.stadach's Avatar

    the problem is, I need to mark a position as paid.
    And I don't want to mark it before the transaction is approved.

    Lets say two one_time_invoices have been made at "the same time".
    Both get a return hash with all invoices (I assume both of those hashes have both invoices within them), the newest invoice is not marked approved.
    How do I know which one of the two positions I can mark as paid?

  5. Support Staff 5 Posted by Marc Guyer on 08 Jun, 2011 09:08 PM

    Marc Guyer's Avatar

    Hmm... If an invoice is declined, it is not recorded -- a declined error message is returned.

    What are you using for the charge code? Is it somehow related to your "position"?

  6. 6 Posted by c.stadach on 10 Jun, 2011 02:49 PM

    c.stadach's Avatar

    It seems like that is the only way to properly map the invoices to the applied position.
    thanks for your help

  7. c.stadach closed this discussion on 10 Jun, 2011 02:49 PM.

Discussions are closed to public comments.
If you need help with Cheddar please start a new discussion.

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

Recent Discussions

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM