-
-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VirtualCard: Support refund transactions #6149
Conversation
privacyTransaction: Transaction, | ||
opts?: { host?: any; collective?: any; hostCurrencyFxRate?: number }, | ||
): Promise<any> => { | ||
): Promise<typeof models.Expense | undefined> => { | ||
const amount = privacyTransaction.settled_amount; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is our guarantee that settled_amount
is in USD here. Is it really always the case? Even if the charge is in another currency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they don't even list currency on their schema.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with the change.
@Betree have a look so you have the context about this behavior.
Co-authored-by: François Hodierne <francois@hodierne.net>
This covers the missing edge case of refunded virtual card charges.
Notice I'm only creating the transaction pair here, I don't think it makes sense to create an expense with a negative value.