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
5 changes: 5 additions & 0 deletions .changeset/chilly-frogs-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@interledger/open-payments': patch
---

Update README
42 changes: 20 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,19 @@ Open Payments is an open API standard that can be implemented by account servici
- Subscriptions
- Invoice Payments

An Open Payments server runs two sub-systems, a **resource server** which exposes APIs for performing functions against the
underlying accounts and and **authorisation server** which exposes APIs compliant with the
[GNAP](https://datatracker.ietf.org/doc/html/draft-ietf-gnap-core-protocol) standard for getting grants to access the resource server
APIs.
The Open Payments APIs are a collection of three sub-systems:

This repository hosts the Open API Specifications of the two APIs which are published along with additional documentation at
https://openpayments.dev.
- A **wallet address server** which exposes public information about Open Payments-enabled accounts called "wallet addresses"
- A **resource server** which exposes APIs for performing functions against the underlying accounts
- A **authorisation server** which exposes APIs compliant with the [GNAP](https://datatracker.ietf.org/doc/html/draft-ietf-gnap-core-protocol) standard for getting grants to access the resource server APIs

Additionally, this repository also contains three published libraries:
This repository contains contains a [NodeJS Open Payments SDK](https://github.com/interledger/open-payments-node/tree/main/packages/open-payments) to make requests via the Open Payments API, as well as TypeScript types for the API.

It also contains two additional libraries:

- [`@interledger/open-payments`](https://github.com/interledger/open-payments/tree/main/packages/open-payments) contains a NodeJS Open Payments SDK to make requests via the Open Payments API, as well as TypeScript types for the API.
- [`@interledger/http-signature-utils`](https://github.com/interledger/open-payments/tree/main/packages/http-signature-utils) provides tools for working with [HTTP Message Signatures](https://datatracker.ietf.org/doc/draft-ietf-httpbis-message-signatures).
- [`@interledger/openapi`](https://github.com/interledger/open-payments/tree/main/packages/openapi) exposes functionality to validate requests and responses according to a given OpenAPI 3.1 schema.

The code for the landing [page](https://openpayments.dev) is in `./docs`.

## Dependencies

- [Interledger](https://interledger.org/developers/rfcs/interledger-protocol/)

### New to Interledger?

Never heard of Interledger before? Or would you like to learn more? Here are some excellent places to start:
Expand Down Expand Up @@ -63,6 +56,19 @@ More phone numbers: https://tel.meet/htd-eefo-ovn?hs=5

## Local Development Environment

This repository contains a Git submodule, which contains the Open Payments OpenAPI specifications.
After cloning, make sure to initialize and update it:

```bash
git submodule update --init
```

Alternatively, clone the repository with submodules in one step:

```bash
git clone --recurse-submodules [email protected]:interledger/open-payments-node.git
```

### Prerequisites

- [NVM](https://github.com/nvm-sh/nvm)
Expand All @@ -83,14 +89,6 @@ pnpm clean
pnpm i
```

### Local Development

You can preview the docs by running the command

```sh
pnpm --filter openpayments-docs start
```

### Useful commands

```sh
Expand Down
10 changes: 5 additions & 5 deletions packages/open-payments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[Open Payments](https://openpayments.dev/) is an API standard that allows third-parties (with the account holder's consent) to initiate payments and to view the transaction history on the account holder's account.

Open Payments consists of two OpenAPI specifications, a **resource server** which exposes APIs for performing functions against the underlying accounts and an **authorization server** which exposes APIs compliant with the [GNAP](https://openpayments.dev/introduction/grants/) standard for getting grants to access the resource server APIs.
Open Payments consists of three OpenAPI specifications, a **wallet address server** which exposes public information about Open Payments-enabled accounts called "wallet addresses", a **resource server** which exposes APIs for performing functions against the underlying accounts and an **authorization server** which exposes APIs compliant with the [GNAP](https://openpayments.dev/introduction/grants/) standard for getting grants to access the resource server APIs.

This package provides TypeScript & NodeJS tools for using Open Payments:

Expand Down Expand Up @@ -119,7 +119,7 @@ try {

> **Note**
>
> A high level Open Payments flow with diagrams can be found [here](https://openpayments.dev/introduction/op-flow/).
> A high level Open Payments flow with diagrams can be found [here](https://openpayments.dev/concepts/op-flow/).

As mentioned previously, Open Payments APIs can facilitate a payment between two parties.

Expand Down Expand Up @@ -166,7 +166,7 @@ const incomingPaymentGrant = await client.grant.request(
access: [
{
type: 'incoming-payment',
actions: ['read-all', 'create']
actions: ['read', 'create']
}
]
}
Expand Down Expand Up @@ -233,7 +233,7 @@ const quote = await client.quote.create(

5. Create `OutgoingPayment` grant & start interaction flow:

The final step for Online Marketplace's backend system will be to create an `OutgoingPayment` on Alice's wallet. Before this, however, Online Marketplace will need to create an outgoing payment grant, which typically requires some sort of interaction with Alice. Online Marketplace will need to facilitate this interaction with Alice (e.g. redirect her to a webpage with a dialog) to get her consent for creating an `OutgoingPayment` on her account at Cloud Nine Wallet.
The final step for Online Marketplace's backend system will be to create an `OutgoingPayment` on Alice's wallet. Before this, however, Online Marketplace will need to create an outgoing payment grant, which requires an interaction with Alice. Online Marketplace will need to facilitate this interaction with Alice (e.g. redirect her to a webpage with a dialog) to get her consent for creating an `OutgoingPayment` on her account at Cloud Nine Wallet. Online Marketplace's backend system will provide a `nonce` in the request in order to secure the communication between itself and Alice's authorization server. See [hash verification](https://openpayments.dev/identity/hash-verification/) for more details.

```ts
const outgoingPaymentGrant = await client.grant.request(
Expand Down Expand Up @@ -280,7 +280,7 @@ This request will return a response as such:
}
```

Alice would be then redirected to the URL specified at `interact.redirect`, where she can approve or reject the grant request.
Alice would be then redirected to her [Identity Provider](https://openpayments.dev/identity/idp/) at the URL specified in `interact.redirect`, where she can approve or reject the grant request.

> **Note**
>
Expand Down
2 changes: 1 addition & 1 deletion packages/open-payments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "https://github.com/interledger/open-payments.git",
"directory": "packages/open-payments"
},
"homepage": "https://github.com/interledger/open-payments/tree/main/packages/open-payments#readme",
"homepage": "https://github.com/interledger/open-payments-node/tree/main/packages/open-payments#readme",
"publishConfig": {
"access": "public"
},
Expand Down