Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions spec/definitions/InvoiceAndToken.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ type: object
required:
- invoice
- invoiceAccessToken
- invoiceUrl
properties:
invoice:
$ref: "#/definitions/Invoice"
invoiceAccessToken:
$ref: "#/definitions/AccessToken"
invoiceUrl:
$ref: "#/definitions/InvoiceUrl"
2 changes: 2 additions & 0 deletions spec/definitions/InvoiceParams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ properties:
type: object
clientInfo:
$ref: "#/definitions/InvoiceClientInfo"
urlParams:
$ref: "#/definitions/InvoiceUrlParams"
2 changes: 2 additions & 0 deletions spec/definitions/InvoiceParamsWithTemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ properties:
metadata:
description: "Invoice metadata"
type: object
urlParams:
$ref: "#/definitions/InvoiceUrlParams"
10 changes: 10 additions & 0 deletions spec/definitions/InvoiceUrl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: object
required:
- url
properties:
url:
description: >
Invoice's payment URL
type: string
example: "https://shop-specific-example.com/path/to/checkout?invoiceID=ABCDEF12345&\
invoiceAccessToken=0123456789abcdef0123456789abcdef&locale=en-US&theme=tomorrow-night"
7 changes: 7 additions & 0 deletions spec/definitions/InvoiceUrlParams.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: object
required: []
additionalProperties: true
properties: {}
example:
locale: "en-US"
theme: "tomorrow-night"
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ post:
- invalidRequest
- invalidDeadline
- invoiceTermsViolated
- invalidUrlParams
message:
description: Human-readable description of the error
type: string
Expand Down
1 change: 1 addition & 0 deletions spec/paths/processing@invoices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ post:
- invalidInvoiceCost
- invoiceTermsViolated
- ambiguousPartyID
- invalidUrlParams
message:
description: Human-readable description of the error
type: string
Expand Down
42 changes: 42 additions & 0 deletions spec/paths/processing@invoices@{invoiceID}@urls.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
post:
operationId: createInvoiceUrl
description: Construct an URL for invoice payment with set of optional query parameters.
tags:
- Invoices
parameters:
- $ref: "#/parameters/requestID"
- $ref: "#/parameters/deadline"
- $ref: "#/parameters/invoiceID"
- name: params
in: body
description: Payment forms's prefill parameters
required: true
schema:
$ref: "#/definitions/InvoiceUrlParams"
responses:
"201":
description: Invoice's payment URL is constructed.
schema:
$ref: "#/definitions/InvoiceUrl"
"404":
$ref: "#/responses/NotFound"
"401":
$ref: "#/responses/Unauthorized"
"400":
description: Invalid data for url construction
schema:
type: object
required:
- code
- message
properties:
code:
description: >
[Error code](#tag/Error-Codes)
type: string
enum:
- invalidUrlParams
message:
description: Human-readable description of the error
type: string
example: Bad url params
2 changes: 2 additions & 0 deletions spec/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,8 @@ tags:

| **refundCartConflict** | It is impossible to define the refund content as the refund distribution and cart are sent at the same time. |

| **invalidUrlParams** | Failed to construct payment URL and encode provided parameters due to incorrect encoding, incomplete sequences, or invalid characters. |

## General errors

The errors that occur during the transaction attempts with the objects
Expand Down
Loading