#marcus_api

1 messages · Page 1 of 1 (latest)

rocky shaleBOT
#

đź‘‹ Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

đź”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1397891888618541087

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

lucid cloud
#

Two days ago, as a test on prod, I paid my own subscription:
stripeEventId": "evt_1RnlVgAfQ68zM8anRC6TCfWO" - I paid 14 Dollar plus 2 266 cents of tax. tax_rate": "txr_1HwVi5AfQ68zM8anHf3Zr456"

Then, for testing, I made several refunds formt eh stripe dashboard, of 1 USD and tried to create a credit note for it, automatically from my backend.

Todau, I created the refund: evt_3RnlVbAfQ68zM8an0XUuPKRQ
Then, the credit note was created, but it does not state any tax? How can this correct? Whenever I do a refund, then legally, there should also be tax involved, in case the customer did pay tax.. which I did originally.
"evt_1Ro9jjAfQ68zM8anrkQYUTSG"

Two days ago, as a test on prod, I paid my own subscription:
stripeEventId": "evt_1RnlVgAfQ68zM8anRC6TCfWO" - I paid 14 Dollar plus 2 266 cents of tax. tax_rate": "txr_1HwVi5AfQ68zM8anHf3Zr456"

Then, for testing, I made several refunds formt eh stripe dashboard, of 1 USD and tried to create a credit note for it, automatically from my backend.

Todau, I created the refund: evt_3RnlVbAfQ68zM8an0XUuPKRQ
Then, the credit note was created, but it does not state any tax? How can this correct? Whenever I do a refund, then legally, there should also be tax involved, in case the customer did pay tax.. which I did originally.
"evt_1Ro9jjAfQ68zM8anrkQYUTSG"

  1. evt_1RnlVgAfQ68zM8anRC6TCfWO
  2. evt_3RnlVbAfQ68zM8an0XUuPKRQ
  3. evt_1Ro9jjAfQ68zM8anrkQYUTSG
idle lichen
#

Sorry, I'm not sure what part of the credit note you want to update exactly ?

rocky shaleBOT
lucid cloud
#

I am not trying to update a credit note

#

Please read what I wrote

daring locust
#

hi! I'm taking over this thread.

#

you wrote a lot of words, and some of it seems to be duplicate. so it's hard to follow.
you want the refunds to include tax? what does that mean concretely? can you share a concrete example of what you were expecting to see, and what you saw instead?

lucid cloud
#

I gave a refund from the ui to a customer that is marked as tax required. So he paid instance 100usd plus 19% tax. That makes 119 usd.

#

Now if I give him a full refund of 119 usd in the stripe dashboard. There is just an amount no field for tax or whatever... It's the gross amount as far as I know...including the tax

#

Right?

daring locust
lucid cloud
#

Then I create a credit note referencing the refund. I want to link them, I want to "encapsulate" the refund with a credit note

#

So if the refund is gross. And the credit note shows tax .. I would expect to see like 100 usd plus 19 tax

#

But it did not work this way. In the above examples... I did follow these steps as described. Just I used partial refunds.. But I would expect that to behave in exactly the same way regarding the tax amounts

#

I gave 1 dollar refund and this created a credit card for note of 1 dollar without any tax... But what should my tax accountant do with that? So the customer paid one dollar less so also less tax is due...

daring locust
#

But I would expect that to behave in exactly the same way regarding the tax amounts
Again, can you share a concrete example? Like a specific Credit Note you created, and then highlight which part is "wrong"?

lucid cloud
#

I did

#

Right in the ticket description

#

3 event ids

#

Why do we create them if no one reads them?

daring locust
#

can you share just one ID, so we can look at it together?

lucid cloud
#

It's a process

daring locust
#

and why are you sharing Event ID? I thought the issue was the Credit Note itself?

lucid cloud
#

Not just one event

#

Well the event Id is what I see in the webhooks

#

So I hope it will allow you to find it

daring locust
#

ok. so looking at thte first event you shared: evt_1RnlVgAfQ68zM8anRC6TCfWO
what is the issue exactly here?

lucid cloud
#

evt_1RnlVgAfQ68zM8anRC6TCfWO, evt_3RnlVbAfQ68zM8an0XUuPKRQ, evt_1Ro9jjAfQ68zM8anrkQYUTSG

#

this is the start. no issue yet. It just shows how the customer bought a service

#

and it includes tax

#

19%

daring locust
#

right

lucid cloud
#

now, I issue a refund of 1 USD

#

the next one

daring locust
#

yes I see

lucid cloud
#

there in the stripe dashboard, you are asked for the amount, the total amount including tax

#

so I said 1 USD

#

since that must be GROSS

#

I would epect it to be something like 95 cents or so plus 15 cents tax or so

daring locust
#

there in the stripe dashboard, you are asked for the amount, the total amount including tax
you mean when you create the Refund?

lucid cloud
#

(math is wrong but I hope you get it 🙂 )

#

yes

#

and then.. there is a lonely refund

#

and my processes requires credit notes

#

so I wrote some code that is suppoed to mantel the refund into a credit note to fix that

#

well teh credit note is the last event

#

it also has no tax amounts shown

#

and the credit note that results in.. also shows no tax

#

@ApplicationScoped
public class RefundHandler implements StripeEventHandler {

@Inject
StripeCreditNoteEnsurer creditNoteEnsurer;

@Override
public void handle(StripeObject stripeObject) {
    creditNoteEnsurer.handle((Refund) stripeObject);
}

@Override
public StripeEventType type() {
    return REFUND_CREATED;
}

}

#

then..

public void handle(Refund refund) {
    String refundId = refund.getId();
    String invoiceId = findInvoiceIdForRefund(refund);

    if (!creditNoteClient.existsForRefundOnInvoice(refundId, invoiceId)) {
        creditNoteClient.createCreditNote(refund, invoiceId);
    }
}
#

/////

daring locust
lucid cloud
#

Hm. But that's the whole idea here?

#

What should I do with the refund?

#

I can't kill it can I?

daring locust
#

I don't really get your last question, sorry.

lucid cloud
#

OK so a refund means - for whatever reason just give back some money to the customer

#

Right?

daring locust
#

like you said earlier, a refund doesn't have any "tax" information, only an amount. so if you create a credit note based on a refund, I think that's expected that the credit note doesn't use tax.

lucid cloud
#

And the credit note is the proper way to bring the amount credited into a proper accounting context

lucid cloud
daring locust
lucid cloud
#

Yes, you’re right. With the invoice ID, which I also have, I can create a new credit note. And I’m sure that would work just fine. But that’s not what I need in this case.

In our example, the customer bought a product for 100 dollars plus 19 dollars tax – so a gross amount of 119 dollars. Let’s say I want to give a refund, for example 19 dollars – that would be 10 dollars net plus 9 dollars tax – then I refund 19 dollars.

If I now create another credit note for 19 dollars, the customer ends up getting 38 dollars back – two times 19. That would be too much.

And if I do a full refund – meaning I give the full 119 dollars back – then there’s no credit left. In that case, I couldn’t create a credit note anymore.

What I actually want: I should never have made a refund without a credit note. Unfortunately, that keeps happening to me in your UI, because your interface is a bit confusing. At least for me.

Now I want to fix this: If this ever happens again – either to me or one of my team members – I want to detect through the webhook that a refund was made, check whether there’s a credit note for that refund, and if not, I want to automatically create one afterwards. This credit note should act like a kind of wrapper – a protective layer around the refund – so that I can properly and legally handle the refund in my invoicing and accounting systems.

daring locust
#

you can always use metadata to link the Credit Note to the original Refund.

lucid cloud
#

The credit note should be done just for tax and account and invoicing reasons. No further money should be given to the customer. Just acting as a virtual wrapper

lucid cloud
daring locust
#

the metadata would have no impact on the actual logic, it's just for you to track things.

lucid cloud
#

It should only be a logical wrapper for legal reasons

daring locust
#

so the credit note may update the customer balance to give them some money back. but you can always undo that by directly re-setting the customer balance to 0.

lucid cloud
#

That sounds like a hack?

daring locust
#

which part? resetting the customer balance?

lucid cloud
#

Yeah

#

Sounds dangerous fragile

daring locust
#

you are trying to "fix a mistake", so what I suggested is a way to fix that mistake.

lucid cloud
#

But back to my original question... Why can I set up everything as I did... And still it's not working properly?

#

Because if that would just be working.... All would be perfect. Otherwise I would expect an exception telling me that this won't work and I would have to look for alternatives

daring locust
#

Why can I set up everything as I did... And still it's not working properly?
I'm not sure I follow your question. can you clarify?

lucid cloud
#

Why can I create a refund that obviously includes tax and attach it to a credit note which is missing the tax

#

Seems like a bug to me

daring locust
lucid cloud
#

This is not answering my question. It seems you don't know?

daring locust
#

no I'm not very familiar with this API. did you saw a different behavior in the past?

lucid cloud
#

no, I am implementing this just now

#

how can you not be familar with the stripe api but work here?

daring locust
#

I am familiar with the Stripe API, but not very familiar with the Credit Note API.

lucid cloud
#

hm.

#

Is there someone who does? Becaue if you dont knwo the credit note api.. then you can't possibly help me here, I guess?

rocky shaleBOT
lucid cloud
#

Hi can you please help me here?

charred quiver
#

@lucid cloud please contact https://support.stripe.com/?contact=true

#

actually, it seems that you already did

#

and someone is looking into your issue as we speak

#

if you don't mind I will close this thread and we'll get back to you with a response as soon as we have one