Skip to content

Commit

Permalink
Return correct Amount and Fee on the payment responses
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bumi committed Mar 1, 2024
1 parent 2360406 commit 30eb351
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions controllers_v2/keysend.ctrl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions controllers_v2/payinvoice.ctrl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 30eb351

Please sign in to comment.