From 30eb3511ca8c8b3a809dca031ae664094ab89071 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Fri, 1 Mar 2024 22:07:09 +0100 Subject: [PATCH] Return correct Amount and Fee on the payment responses So far we have returned the total amount (which includes the fee) and the fee. This information was taken from the payment route response now we directly return it from the invoice data. This is consistent with the other transaction responses --- controllers_v2/keysend.ctrl.go | 4 ++-- controllers_v2/payinvoice.ctrl.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controllers_v2/keysend.ctrl.go b/controllers_v2/keysend.ctrl.go index 0340e69..0d365b5 100644 --- a/controllers_v2/keysend.ctrl.go +++ b/controllers_v2/keysend.ctrl.go @@ -247,8 +247,8 @@ func (controller *KeySendController) SingleKeySend(ctx context.Context, reqBody } responseBody := &KeySendResponseBody{ - Amount: sendPaymentResponse.PaymentRoute.TotalAmt, - Fee: sendPaymentResponse.PaymentRoute.TotalFees, + Amount: invoice.Amount, + Fee: invoice.Fee, CustomRecords: customRecords, Description: reqBody.Memo, Destination: reqBody.Destination, diff --git a/controllers_v2/payinvoice.ctrl.go b/controllers_v2/payinvoice.ctrl.go index bf16737..e96eef9 100644 --- a/controllers_v2/payinvoice.ctrl.go +++ b/controllers_v2/payinvoice.ctrl.go @@ -129,8 +129,8 @@ func (controller *PayInvoiceController) PayInvoice(c echo.Context) error { } responseBody := &PayInvoiceResponseBody{ PaymentRequest: paymentRequest, - Amount: sendPaymentResponse.PaymentRoute.TotalAmt, - Fee: sendPaymentResponse.PaymentRoute.TotalFees, + Amount: invoice.Amount, + Fee: invoice.Fee, Description: invoice.Memo, DescriptionHash: invoice.DescriptionHash, Destination: invoice.DestinationPubkeyHex,