Skip to content

Commit

Permalink
Fix: 500 on insufficient funds (#57)
Browse files Browse the repository at this point in the history
* don't 500 on unsufficinet funds

* updated swagger docs

* use 422 instead of 400 on not enough funds
  • Loading branch information
tigh-latte authored Oct 8, 2021
1 parent 2a93fd4 commit f0a4850
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 683 deletions.
20 changes: 4 additions & 16 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ var doc = `{
}
],
"responses": {
"200": {
"204": {
"description": ""
},
"404": {
Expand Down Expand Up @@ -241,7 +241,7 @@ var doc = `{
}
],
"responses": {
"204": {
"201": {
"description": ""
}
}
Expand Down Expand Up @@ -348,18 +348,6 @@ var doc = `{
}
}
},
"null.String": {
"type": "object",
"properties": {
"string": {
"type": "string"
},
"valid": {
"description": "Valid is true if String is not NULL",
"type": "boolean"
}
}
},
"payd.ClientError": {
"type": "object",
"properties": {
Expand All @@ -386,15 +374,15 @@ var doc = `{
"properties": {
"description": {
"description": "Description is an optional text field that can have some further info\nlike 'invoice for oranges'.\nMaxLength is 1024 characters.",
"$ref": "#/definitions/null.String"
"type": "string"
},
"expiresAt": {
"description": "ExpiresAt is an optional param that can be passed to set an expiration\ndate on an invoice, after which, payments will not be accepted.",
"type": "string"
},
"reference": {
"description": "Reference is an identifier that can be used to link the\npayd invoice with an external system.\nMaxLength is 32 characters.",
"$ref": "#/definitions/null.String"
"type": "string"
},
"satoshis": {
"description": "Satoshis is the total amount this invoice is to pay.",
Expand Down
20 changes: 4 additions & 16 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
}
],
"responses": {
"200": {
"204": {
"description": ""
},
"404": {
Expand Down Expand Up @@ -227,7 +227,7 @@
}
],
"responses": {
"204": {
"201": {
"description": ""
}
}
Expand Down Expand Up @@ -334,18 +334,6 @@
}
}
},
"null.String": {
"type": "object",
"properties": {
"string": {
"type": "string"
},
"valid": {
"description": "Valid is true if String is not NULL",
"type": "boolean"
}
}
},
"payd.ClientError": {
"type": "object",
"properties": {
Expand All @@ -372,15 +360,15 @@
"properties": {
"description": {
"description": "Description is an optional text field that can have some further info\nlike 'invoice for oranges'.\nMaxLength is 1024 characters.",
"$ref": "#/definitions/null.String"
"type": "string"
},
"expiresAt": {
"description": "ExpiresAt is an optional param that can be passed to set an expiration\ndate on an invoice, after which, payments will not be accepted.",
"type": "string"
},
"reference": {
"description": "Reference is an identifier that can be used to link the\npayd invoice with an external system.\nMaxLength is 32 characters.",
"$ref": "#/definitions/null.String"
"type": "string"
},
"satoshis": {
"description": "Satoshis is the total amount this invoice is to pay.",
Expand Down
16 changes: 4 additions & 12 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ definitions:
signature:
type: string
type: object
null.String:
properties:
string:
type: string
valid:
description: Valid is true if String is not NULL
type: boolean
type: object
payd.ClientError:
properties:
code:
Expand All @@ -39,22 +31,22 @@ definitions:
payd.InvoiceCreate:
properties:
description:
$ref: '#/definitions/null.String'
description: |-
Description is an optional text field that can have some further info
like 'invoice for oranges'.
MaxLength is 1024 characters.
type: string
expiresAt:
description: |-
ExpiresAt is an optional param that can be passed to set an expiration
date on an invoice, after which, payments will not be accepted.
type: string
reference:
$ref: '#/definitions/null.String'
description: |-
Reference is an identifier that can be used to link the
payd invoice with an external system.
MaxLength is 32 characters.
type: string
satoshis:
description: Satoshis is the total amount this invoice is to pay.
type: integer
Expand Down Expand Up @@ -179,7 +171,7 @@ paths:
produces:
- application/json
responses:
"200":
"204":
description: ""
"404":
description: returned if the paymentID has not been found
Expand Down Expand Up @@ -235,7 +227,7 @@ paths:
produces:
- application/json
responses:
"204":
"201":
description: ""
summary: Make a payment
tags:
Expand Down
Loading

0 comments on commit f0a4850

Please sign in to comment.