Closed reshmabidikar closed 2 years ago
On hovering over the (?) icon, it should display the amount.
This is customer requirement to have this effect? Or we can have this listed the same way like other columns?
Note that this fix also needs to be applied to the payment screen below.
Kaui loads partials templates so this is included anywhere where we load payments_table.
When we go to listing of all payments we see capture amount
so something has been implemented to show what amount has been captured.
This is customer requirement to have this effect? Or we can have this listed the same way like other columns?
Could you please elaborate on what you mean by other columns?
When we go to listing of all payments we see capture amount so something has been implemented to show what amount has been captured.
I do not think we need to change anything here, so the payments screen can continue to display the captured amount. @pierre, any thoughts?
?
hover effect, just plain columns with data if there is any and we could implement this the same like other columns. here is commit for this feature https://github.com/kpbacode/killbill-admin-ui/commits/show-processamount
This is customer requirement to have this effect? Or we can have this listed the same way like other columns?
I don't think we should introduce a new column for that. In 99.9999% of the cases, amount == processed amount
. So, in most cases, this new column will take space for not much information. We could have a hover effect for that 0.0001% case, just like in the audit screens?
I do not think we need to change anything here, so the payments screen can continue to display the captured amount. @pierre, any thoughts?
Agreed, auth/capture amounts are a different concept and should be kept as-is.
[] Need to figure out how to add transaction with different processed amount. (https://killbill.github.io/slate/index.html?shell#account-trigger-a-payment-authorization-purchase-or-credit) [] Will add this tool tip at the bottom, to don't cover the amount.
Need to figure out how to add transaction with different processed amount.
You mean for testing purposes? If so, you cannot actually. This is returned in corner cases by the payment plugins. You might be able to use the payment test plugin to fake it, but I wouldn't bother.
Proposed Fix:
When the
processedAmount
is different fromamount
, Kaui should show theprocessedAmount
followed by a(?)
symbol. On hovering over the(?)
icon, it should display theamount
. So, in the example above, it should display$10 (USD) (?)
and on hover of the small(?)
icon, it should display$60 (USD)
implemented as requested
todo: tests
Did some testing using the payment test plugin. The Retrieve Payment by Id endpoint returns the following data (Different values are returned for amount
and processedAmount
):
{
"accountId": "1b5ef030-b380-4d6b-aa35-29c72c7375ff",
"paymentId": "a70a3127-0ab0-4c6f-897c-faf119acd794",
"paymentNumber": "2",
"paymentExternalKey": "a70a3127-0ab0-4c6f-897c-faf119acd794",
"authAmount": 0,
"capturedAmount": 0,
"purchasedAmount": 10,
"refundedAmount": 0,
"creditedAmount": 0,
"currency": "USD",
"paymentMethodId": "9d24cb12-d95c-4469-9bbe-13c289c7de41",
"transactions": [
{
"transactionId": "d32c1d32-6f01-4180-a813-d06af77e9a9e",
"transactionExternalKey": "d32c1d32-6f01-4180-a813-d06af77e9a9e",
"paymentId": "a70a3127-0ab0-4c6f-897c-faf119acd794",
"paymentExternalKey": "a70a3127-0ab0-4c6f-897c-faf119acd794",
"transactionType": "PURCHASE",
"amount": 100,
"currency": "USD",
"effectiveDate": "2022-10-27T08:47:01.000Z",
"processedAmount": 10,
"processedCurrency": "USD",
"status": "SUCCESS",
"gatewayErrorCode": null,
"gatewayErrorMsg": null,
"firstPaymentReferenceId": null,
"secondPaymentReferenceId": null,
"properties": null,
"auditLogs": []
}
],
"paymentAttempts": null,
"auditLogs": []
}
However, Kaui displays the following screen (No question mark icon and nothing shown on hovering the mouse over the amount
field):
You are using version with this template updated? killbill-admin-ui/app/views/kaui/payments/_payment_table.html.erb
<% if transaction.amount.present? %>
<% if transaction.amount != transaction.processed_amount %>
<%= humanized_money_with_symbol Kaui::Transaction.processed_amount_to_money(transaction) %>
(<%= transaction.currency %>)
<a href="#" data-toggle="tooltip" class="kb-tooltip" title="<%= I18n.translate('requested_amount_colon') %> <%= humanized_money_with_symbol Kaui::Transaction.amount_to_money(transaction) %>(<%= transaction.currency %>)">(?)</a>
<% else%>
<%= humanized_money_with_symbol Kaui::Transaction.amount_to_money(transaction) %>
(<%= transaction.currency %>)
<% end %>
<% end %>
Yes, I had the correct code but my killbill-admin-ui-standalone
code was not pointing to the local killbill-admin-ui
code. On fixing this, it works fine. I see the following payment screen:
The invoice payment screen also works as expected.
The Kaui payments screen and the invoice payment screen display an incorrect amount when the processed amount is different from the actual amount.
These screens use the
amount
field from the transaction, not theprocessedAmount
field.For example, when the Retrieve Invoice Payment endpoint returns
amount=60
andprocessedAmount=10
, Kaui displays60
as can be seen from the invoice payment screenshot below:Proposed Fix:
When the
processedAmount
is different fromamount
, Kaui should show theprocessedAmount
followed by a(?)
symbol. On hovering over the(?)
icon, it should display theamount
. So, in the example above, it should display$10 (USD) (?)
and on hover of the small(?)
icon, it should display$60 (USD)
Note that this fix also needs to be applied to the payment screen below.