-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add wallet address to subresource requests #305
Changes from 7 commits
511814e
75c35f0
7b24784
dea540e
250d95d
bdb2f56
e860b72
0f67aaf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@interledger/open-payments': minor | ||
--- | ||
|
||
Added "walletAddress" field to resource POST request bodies, added "wallet-address" query parameter to resource GET requests. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,6 +137,8 @@ paths: | |
type: object | ||
additionalProperties: false | ||
properties: | ||
walletAddress: | ||
$ref: ./schemas.yaml#/components/schemas/walletAddress | ||
incomingAmount: | ||
$ref: ./schemas.yaml#/components/schemas/amount | ||
description: The maximum amount that should be paid into the wallet address under this incoming payment. | ||
|
@@ -151,6 +153,7 @@ paths: | |
examples: | ||
Create incoming payment for $25 to pay invoice INV2022-02-0137: | ||
value: | ||
walletAddress: 'https://openpayments.guide/alice/' | ||
incomingAmount: | ||
value: '2500' | ||
assetCode: USD | ||
|
@@ -275,6 +278,7 @@ paths: | |
$ref: '#/components/responses/403' | ||
description: List all incoming payments on the wallet address | ||
parameters: | ||
- $ref: '#/components/parameters/wallet-address' | ||
- $ref: '#/components/parameters/cursor' | ||
- $ref: '#/components/parameters/first' | ||
- $ref: '#/components/parameters/last' | ||
|
@@ -328,12 +332,15 @@ paths: | |
examples: | ||
Create an outgoing payment based on a quote: | ||
value: | ||
walletAddress: 'https://ilp.rafiki.money/alice/' | ||
quoteId: 'https://ilp.rafiki.money/quotes/ab03296b-0c8b-4776-b94e-7ee27d868d4d' | ||
metadata: | ||
externalRef: INV2022-02-0137 | ||
schema: | ||
type: object | ||
properties: | ||
walletAddress: | ||
$ref: ./schemas.yaml#/components/schemas/walletAddress | ||
quoteId: | ||
type: string | ||
format: uri | ||
|
@@ -344,6 +351,7 @@ paths: | |
description: Additional metadata associated with the outgoing payment. (Optional) | ||
required: | ||
- quoteId | ||
- walletAddress | ||
additionalProperties: false | ||
description: |- | ||
A subset of the outgoing payments schema is accepted as input to create a new outgoing payment. | ||
|
@@ -482,6 +490,7 @@ paths: | |
$ref: '#/components/responses/403' | ||
description: List all outgoing payments on the wallet address | ||
parameters: | ||
- $ref: '#/components/parameters/wallet-address' | ||
- $ref: '#/components/parameters/cursor' | ||
- $ref: '#/components/parameters/first' | ||
- $ref: '#/components/parameters/last' | ||
|
@@ -531,10 +540,12 @@ paths: | |
examples: | ||
Create quote for an `receiver` that is an Incoming Payment with an `incomingAmount`: | ||
value: | ||
walletAddress: 'https://ilp.rafiki.money/alice' | ||
receiver: 'https://ilp.rafiki.money/incoming-payments/37a0d0ee-26dc-4c66-89e0-01fbf93156f7' | ||
method: ilp | ||
Create fixed-send amount quote for $25: | ||
value: | ||
walletAddress: 'https://ilp.rafiki.money/alice' | ||
receiver: 'https://ilp.rafiki.money/incoming-payments/37a0d0ee-26dc-4c66-89e0-01fbf93156f7' | ||
method: ilp | ||
debitAmount: | ||
|
@@ -543,6 +554,7 @@ paths: | |
assetScale: 2 | ||
Create fixed-receive amount quote for $25: | ||
value: | ||
walletAddress: 'https://ilp.rafiki.money/alice' | ||
receiver: 'https://ilp.rafiki.money/incoming-payments/37a0d0ee-26dc-4c66-89e0-01fbf93156f7' | ||
method: ilp | ||
receiveAmount: | ||
|
@@ -553,16 +565,21 @@ paths: | |
oneOf: | ||
- description: Create quote for an `receiver` that is an Incoming Payment with an `incomingAmount` | ||
properties: | ||
walletAddress: | ||
$ref: ./schemas.yaml#/components/schemas/walletAddress | ||
receiver: | ||
$ref: ./schemas.yaml#/components/schemas/receiver | ||
method: | ||
$ref: '#/components/schemas/payment-method' | ||
required: | ||
- walletAddress | ||
- receiver | ||
- method | ||
additionalProperties: false | ||
- description: Create a quote with a fixed-receive amount | ||
properties: | ||
walletAddress: | ||
$ref: ./schemas.yaml#/components/schemas/walletAddress | ||
receiver: | ||
$ref: ./schemas.yaml#/components/schemas/receiver | ||
method: | ||
|
@@ -571,12 +588,15 @@ paths: | |
description: The fixed amount that would be paid into the receiving wallet address given a successful outgoing payment. | ||
$ref: ./schemas.yaml#/components/schemas/amount | ||
required: | ||
- walletAddress | ||
- receiver | ||
- method | ||
- receiveAmount | ||
additionalProperties: false | ||
- description: Create a quote with a fixed-send amount | ||
properties: | ||
walletAddress: | ||
$ref: ./schemas.yaml#/components/schemas/walletAddress | ||
receiver: | ||
$ref: ./schemas.yaml#/components/schemas/receiver | ||
method: | ||
|
@@ -585,6 +605,7 @@ paths: | |
description: The fixed amount that would be sent from the sending wallet address given a successful outgoing payment. | ||
$ref: ./schemas.yaml#/components/schemas/amount | ||
required: | ||
- walletAddress | ||
- receiver | ||
- method | ||
- debitAmount | ||
|
@@ -650,6 +671,7 @@ paths: | |
description: A client can fetch the latest state of an incoming payment to determine the amount received into the wallet address. | ||
parameters: | ||
- $ref: '#/components/parameters/id' | ||
- $ref: '#/components/parameters/wallet-address' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the wallet address is needed here because the id is unique. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it also the case for completing an incoming payment (https://github.com/interledger/open-payments/pull/305/files#diff-9debc2038853698222051b2c2a428cee93e9dda6af6076de559971933879580dR722-R725) since the path still contains that unique id? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, indeed. |
||
'/incoming-payments/{id}/complete': | ||
post: | ||
summary: Complete an Incoming Payment | ||
|
@@ -690,6 +712,21 @@ paths: | |
$ref: '#/components/responses/403' | ||
'404': | ||
description: Incoming Payment Not Found | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
walletAddress: | ||
$ref: ./schemas.yaml#/components/schemas/walletAddress | ||
required: | ||
- walletAddress | ||
examples: | ||
Complete incoming payment for https://openpayments.guide/alice: | ||
value: | ||
walletAddress: 'https://openpayments.guide/alice/' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe this can just be the |
||
description: |- | ||
A client with the appropriate permissions MAY mark a non-expired **incoming payment** as `completed` indicating that the client is not going to make any further payments toward this **incoming payment**, even though the full `incomingAmount` may not have been received. | ||
|
||
|
@@ -748,6 +785,7 @@ paths: | |
- $ref: '#/components/parameters/signature' | ||
parameters: | ||
- $ref: '#/components/parameters/id' | ||
- $ref: '#/components/parameters/wallet-address' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
'/quotes/{id}': | ||
get: | ||
summary: Get a Quote | ||
|
@@ -1282,6 +1320,13 @@ components: | |
type: string | ||
description: Sub-resource identifier | ||
required: true | ||
wallet-address: | ||
name: wallet-address | ||
in: query | ||
schema: | ||
type: string | ||
description: 'URL of a wallet address hosted by a Rafiki instance.' | ||
required: true | ||
signature: | ||
name: Signature | ||
in: header | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
POST /quote request body should also contain
walletAddress