Payment refund currency confusement

I noticed a strange behaviour when doing a refund on a payment (connected with Stripe).
All my currency settings are set to JPY (even the clients).
Let’s say I have an invoice for 100000JPY (approx. 1000$).
The payment goes through via the customer portal with no issues and and everything is fine.

As soon as I want to do a refund (no matter if partial or not) I have the following two behaviours.

1:

  • I go to Payments and select on the 100000JPY payment “Refund Payment” (not going into “Edit Payment”).
  • The mask shows me: Amount ¥ <Amount I can type in>; Max: 100JPY (Instead of 100000JPY)
  • when I type in 100JPY (can’t input more), the balance of my invoice shows 100JPY refunded
  • In Stripe though, it shows me 100000 (hundred thousand) JPY refunded!!!

2:

  • I go to Payments and select on the 100000JPY payment “Edit Payment”
  • Under “More Actions” I select “Refund Payment”.
  • The mask shows me: Amount $ 100000; Max: 100000JPY (Notice the $ sign!)
  • when I type in 100 $? JPY?, the balance of my invoice shows 100JPY refunded
  • In Stripe though, it shows me 10000 (ten thousand) JPY refunded!!!

Can somebody reproduce this behaviour?
I hope it was just me who messed up something :wink:

Thank you in advance!

It sounds like a bug, we’ll work on a fix for our next release.

Ok, thanks!!!

I think there may be a few separate issues here:

  • There is a bug where the wrong currency symbol is shown when refunding on the edit payment page, this will be fixed in our next release.

The other two problems I haven’t been able to replicate:

  • I don’t see different max amounts. When testing you should be able to use any value, the max isn’t enforced with JavaScript. If you want to email screenshots to contact@invoiceninja.com it may help with debugging.

  • I’m not sure why the refund amounts are different, I’d suggest checking the Stripe API logs for more details.

  • Ok, I can live with the wrong currency symbol. No big issue.
  • You’re right the max amounts are not ennforced. But when I input 100’000JPY in case 1, the refund gets canceled on Stripe side as the amount Stripe receives is 100’000’000JPY and this exceeds the refundable amount. I can provide some screnshots, no problem.
  • The effective amounts, in case 1: 100’000JPY (typed in 100) and in case 2: 10’000JPY (typed in 100) are coming from the Stripe logs.

I’ll reset everyting again, start from scratch and check if the behaviour is still the same.

Are you entering the refund as 100’000 or 100000?

As 100000.

Ok, great. The formatting could cause a problem.

Numbers get parsed from 100’000 to 100000.
Anyway,I sent you some screenshots also with the values that reach Stripe.

Thank you for investigating!

Thanks for the screenshots, they were very helpful!

The refund amount discrepancy was due the JPY currency not having any decimals. Here’s the fix if you want to patch your code:

https://github.com/invoiceninja/invoiceninja/commit/d5924bc523938b4fb22a6ac2b83a7bd27429ad8a

Great!!! Unfortunately I’m on the hosted version #-o
Thank you anyway and keep up the good work.