@@ -23,10 +23,10 @@ func NewPaymentRequestHandler(svc p4.PaymentRequestService) *paymentRequestHandl
23
23
24
24
// RegisterRoutes will setup all routes with an echo group.
25
25
func (h * paymentRequestHandler ) RegisterRoutes (g * echo.Group ) {
26
- g .GET (RoutePaymentRequest , h .createPaymentRequest )
26
+ g .GET (RoutePaymentRequest , h .buildPaymentRequest )
27
27
}
28
28
29
- // createPaymentRequest will setup and return a new payment request.
29
+ // buildPaymentRequest will setup and return a new payment request.
30
30
// @Summary Request to pay an invoice and receive back outputs to use when constructing the payment transaction
31
31
// @Description Creates a payment request based on a payment id (the identifier for an invoice).
32
32
// @Tags Payment
@@ -38,14 +38,14 @@ func (h *paymentRequestHandler) RegisterRoutes(g *echo.Group) {
38
38
// @Failure 400 {object} validator.ErrValidation "returned if the user input is invalid, usually an issue with the paymentID"
39
39
// @Failure 500 {string} string "returned if there is an unexpected internal error"
40
40
// @Router /api/v1/payment/{paymentID} [GET].
41
- func (h * paymentRequestHandler ) createPaymentRequest (e echo.Context ) error {
41
+ func (h * paymentRequestHandler ) buildPaymentRequest (e echo.Context ) error {
42
42
var args p4.PaymentRequestArgs
43
43
if err := e .Bind (& args ); err != nil {
44
44
return errors .Wrap (err , "failed to bind request" )
45
45
}
46
- resp , err := h .svc .CreatePaymentRequest (e .Request ().Context (), args )
46
+ resp , err := h .svc .PaymentRequest (e .Request ().Context (), args )
47
47
if err != nil {
48
48
return errors .WithStack (err )
49
49
}
50
- return e .JSON (http .StatusCreated , resp )
50
+ return e .JSON (http .StatusOK , resp )
51
51
}
0 commit comments