Fix key send response body

This commit is contained in:
Stefan Kostic
2022-03-08 01:09:11 +01:00
parent b82deb3835
commit c6ba661227

View File

@@ -84,7 +84,7 @@ func (controller *KeySendController) KeySend(c echo.Context) error {
return c.JSON(http.StatusBadRequest, responses.NotEnoughBalanceError) return c.JSON(http.StatusBadRequest, responses.NotEnoughBalanceError)
} }
_, err = controller.svc.PayInvoice(c.Request().Context(), invoice) sendPaymentResponse, err := controller.svc.PayInvoice(c.Request().Context(), invoice)
if err != nil { if err != nil {
c.Logger().Errorf("Payment failed: %v", err) c.Logger().Errorf("Payment failed: %v", err)
sentry.CaptureException(err) sentry.CaptureException(err)
@@ -95,15 +95,13 @@ func (controller *KeySendController) KeySend(c echo.Context) error {
}) })
} }
responseBody := &PayInvoiceResponseBody{} responseBody := &PayInvoiceResponseBody{}
// responseBody.RHash = &lib.JavaScriptBuffer{Data: sendPaymentResponse.PaymentHash} responseBody.RHash = &lib.JavaScriptBuffer{Data: sendPaymentResponse.PaymentHash}
// responseBody.PaymentRequest = paymentRequest responseBody.Amount = invoice.Amount
// responseBody.PayReq = paymentRequest responseBody.Description = invoice.Memo
// responseBody.Amount = invoice.Amount responseBody.DescriptionHashStr = invoice.DescriptionHash
// responseBody.Description = invoice.Memo responseBody.PaymentError = sendPaymentResponse.PaymentError
// responseBody.DescriptionHashStr = invoice.DescriptionHash responseBody.PaymentPreimage = &lib.JavaScriptBuffer{Data: sendPaymentResponse.PaymentPreimage}
// responseBody.PaymentError = sendPaymentResponse.PaymentError responseBody.PaymentRoute = sendPaymentResponse.PaymentRoute
// responseBody.PaymentPreimage = &lib.JavaScriptBuffer{Data: sendPaymentResponse.PaymentPreimage}
// responseBody.PaymentRoute = sendPaymentResponse.PaymentRoute
return c.JSON(http.StatusOK, responseBody) return c.JSON(http.StatusOK, responseBody)
} }