#tomas at amenitiz

1 messages ยท Page 1 of 1 (latest)

proud plankBOT
fair tangle
#

Don't think that's possible, confirming

sterile hamlet
#

I've tried issuing the invoice as such, snippets using the Ruby SDK:

Stripe::InvoiceItem.create(invoice: "in_1MmD1wIsA9C1ybP08o0KmVyV", customer: "cus_KfRRXDSpUuy0oC", amount: 6000, description: "asd")
Stripe::Invoice.pay("in_1MmD51IsA9C1ybP0CM9OM137", { paid_out_of_band: true })
fair tangle
#

I suspect you may need to temporarily increment the balance amount

sterile hamlet
#

I don't want the balance discount to reflect on the invoice though, so I imagine I need to:

  • Get the balance amount and store it
  • Set it to 0
  • Issue the invoice
  • Set the balance amount back to what it was
#

(the examples I sent was with a balance amount of 4000 cents, not 20000). The invoice ended up being for 2000 cents; when what I need is an invoice for the full 6000 cents; and the balance to remain unchanged. Don't know if I'm being clear with my use need

#

I'll wait, please don't close me ๐Ÿ˜„

fair tangle
sterile hamlet
#

Beyond race conditions, is there any other side effect I could introduce doing this? The balance is just some "store credit" I extend to my customers, but there's no real movements of funds, right?

#

I mean obvious side effects, I realise managing the complexities of a transaction is actually my job

fair tangle
sterile hamlet
#

Last question, this one is a lot simpler

#

What's the endpoint to change this balance? ๐Ÿคฆโ€โ™‚๏ธ

fair tangle
#

You can't just mutate it directly, needs to be an associated transaction to increment/decrement

sterile hamlet
#

Oh, I get it, thanks

#

So this won't have any other side effects either, no? Like issuing a pair of opposite balance transactions should result in no changes to the balance state (aside from logging the transactions)?

fair tangle
#

Correct

sterile hamlet
#

You've been really helpful, my doubts are clear

#

Thank you very much, have a nice day ๐Ÿ™‚