Skip to content

Commit

Permalink
add endpoints to retrieve payment-request
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-basiuk committed Dec 24, 2024
1 parent 9b6438c commit 3ad27f3
Show file tree
Hide file tree
Showing 13 changed files with 788 additions and 101 deletions.
99 changes: 92 additions & 7 deletions api/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,29 @@ paths:
$ref: '#/components/responses/500'

/v2/identities/{identifier}/payment-request:
get:
summary: Get Payment Requests
operationId: GetPaymentRequests
description: Get payment requests for the provided identity.
tags:
- Payment
security:
- basicAuth: [ ]
parameters:
- $ref: '#/components/parameters/pathIdentifier'
responses:
'200':
description: Payment Requests
content:
application/json:
schema:
$ref: '#/components/schemas/GetPaymentRequestsResponse'
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
post:
summary: Create Payment Request
operationId: CreatePaymentRequest
Expand Down Expand Up @@ -1501,6 +1524,54 @@ paths:
'500':
$ref: '#/components/responses/500'

/v2/identities/{identifier}/payment-request/{id}:
get:
summary: Get Payment Request
operationId: GetPaymentRequest
description: Get a specific payment request for the provided identity.
tags:
- Payment
security:
- basicAuth: [ ]
parameters:
- $ref: '#/components/parameters/pathIdentifier'
- $ref: '#/components/parameters/id'
responses:
'200':
description: Retrieve a payment request
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePaymentRequestResponse'
'400':
$ref: '#/components/responses/400'
'404':
$ref: '#/components/responses/404'
'500':
$ref: '#/components/responses/500'
delete:
summary: Delete Payment Request
operationId: DeletePaymentRequest
description: Remove a specific payment request for the provided identity.
tags:
- Payment
security:
- basicAuth: [ ]
parameters:
- $ref: '#/components/parameters/pathIdentifier'
- $ref: '#/components/parameters/id'
responses:
'200':
description: Payment request deleted
content:
application/json:
schema:
$ref: '#/components/schemas/GenericMessage'
'400':
$ref: '#/components/responses/400'
'500':
$ref: '#/components/responses/500'

/v2/payment/settings:
get:
summary: Payments Configuration
Expand Down Expand Up @@ -1642,7 +1713,7 @@ paths:
in: path
required: true
requestBody:
required: true
required: false
content:
application/json:
schema:
Expand Down Expand Up @@ -2332,12 +2403,15 @@ components:

PaymentVerifyRequest:
type: object
required:
- txHash
properties:
txHash:
type: string
example: "0x8f271174b45ba7892d83..."
description: If txHash not provided then only verification on the Payment contract will be performed by nonce and issuer DID.
userDID:
type: string
example: "did:iden3:polygon:amoy:2qVSDLNYs2s5HDMTyb4Su67ZvrZ..."
description: If a User DID is provided, the payment will be verified for the specified User DID.

BasicMessage:
type: object
Expand Down Expand Up @@ -2405,7 +2479,7 @@ components:
- issuerDID
- name
- description
- config
- paymentOptions
- modifiedAt
- createdAt
properties:
Expand All @@ -2421,7 +2495,7 @@ components:
type: string
description:
type: string
config:
paymentOptions:
$ref: '#/components/schemas/PaymentOptionConfig'
modifiedAt:
$ref: '#/components/schemas/TimeUTC'
Expand Down Expand Up @@ -2449,19 +2523,25 @@ components:
type: string
signingKeyID:
type: string
expiration:
type: string
format: date-time
example: 2025-04-17T11:40:43.681857-03:00
x-omitempty: true
description: Expiration date for the payment option, if not set the 1 hour from the creation date will be used

PaymentOptionRequest:
type: object
required:
- name
- description
- config
- paymentOptions
properties:
name:
type: string
description:
type: string
config:
paymentOptions:
$ref: '#/components/schemas/PaymentOptionConfig'

CreatePaymentRequest:
Expand Down Expand Up @@ -2491,6 +2571,11 @@ components:
type: string
example: "<user did>"

GetPaymentRequestsResponse:
type: array
items:
$ref: '#/components/schemas/CreatePaymentRequestResponse'

CreatePaymentRequestResponse:
type: object
required:
Expand Down
Loading

0 comments on commit 3ad27f3

Please sign in to comment.