Before you begin
The Open Payments SDKs provide developers with pre-built functions that simplify interactions with the Open Payments API. Currently, we offer a TypeScript/NodeJS SDK and a PHP SDK, with plans to expand to additional languages and frameworks in the future.
Using the SDKs
Section titled “Using the SDKs”Each SDK snippet page uses a tabbed interface to support multiple programming languages. This means you can find the relevant code snippets for the language of your choice with ease, without needing individual pages for each language. The basic structure of each page is as follows:
- The page title reflects the operation, function, or action being performed.
- A few overview paragraphs provide context about the function, its role in the Open Payments flow, and any general information that may be helpful.
- The “Before you begin” section that links back to this page for steps to create a test wallet.
- The main content area includes the tabbed interface where you can select your preferred programming language.
Within the tabbed interface, you’ll notice the following sections:
- A “Prerequisites” button that links to the respective SDK’s README on GitHub for setup instructions.
- Any additional configuration steps required for the selected language.
- Code blocks for each step in the process, broken down into manageable chunks.
- After the code snippets, any other commands that need to be run are mentioned, along with links to the relevant API reference documentation or other pertinent resources.
This consistent structure across all SDK snippet pages allow you to quickly grasp the functionality and implementation details, making it easier to work with the Open Payments SDKs.
Create an account on the test wallet
Section titled “Create an account on the test wallet”Before working with our SDK snippets, we recommend creating a wallet account on the test wallet that’s part of the Interledger testnet.
The test wallet lets you create developer keys and wallet accounts, funded with play money, for making Interledger transactions via the Open Payments APIs.
- Go to wallet.interledger-test.dev.
- Click Create account at the bottom-right of the screen.
- Enter your e-mail address, a strong password, then confirm the password. Click the arrowhead.
- Go to your inbox and look for an e-mail sent by
tech@interledger.org
with the subject “[Test.Wallet] Verify your account”. Click Confirm my email address. - Click Login to your account at the email verification screen.
- Log in with your credentials.
- Complete the Know Your Customer (KYC) steps. The only real information you need to share is your email address. All other information can be fake.
You’re now ready to create a test wallet and add money to it!
Create and fund a wallet account
Section titled “Create and fund a wallet account”-
Click New account on the Interledger Wallet dashboard.
-
Enter any account name, select an asset (currency), then click Create account.
-
Click Close, then click Accounts from the left nav bar.
-
Select the account you just created.
-
Click Deposit.
-
Enter an amount between 50 to 1,000 to deposit into the account, then click Deposit.
You now have a funded test wallet!
Add a payment pointer to your wallet account
Section titled “Add a payment pointer to your wallet account”- Select the account from the Test Wallet dashboard.
- Click Add payment pointer.
- Enter a Payment Pointer name and a Public name of your choosing.
- Click Create. Your account now has a payment pointer.
Obtain a public-private key pair and key ID
Section titled “Obtain a public-private key pair and key ID”Before you can initialize an authenticated Open Payments client, you must obtain a public-private key pair and a key ID.
- Click Settings in the left sidebar on the dashboard.
- Click the Developer Keys tab.
- Expand the menu for your wallet account.
- Click Generate public & private key.
- Enter any nickname for the key pair, then click Generate keys. A file named
private.key
automatically downloads to your machine - Click Close. Your key ID appears on the screen, along with a Show/Hide option for your public key.
You can now use your keys and payment pointer to initialize an authenticated Open Payments client.