Skip to content

Working example of using the python sdk - #14

Merged
adrianboros merged 4 commits into
interledger:mainfrom
johngian:working-example-python-sdk
Nov 26, 2026
Merged

adrianboros merged 4 commits into
interledger:mainfrom
johngian:working-example-python-sdk

Conversation

@johngian

@johngian johngian commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

This PR fixes some issues identified in the code while running a real world example. On top of that, it replicates the peer to peer example from the nodejs implementation of the SDK. This was done in order to have a once off way to verify that the majority of the functionality can work in a real environment.

This PR ships with some docs under /examples/peer-to-peer/README.md on what the example does.

@johngian
johngian force-pushed the working-example-python-sdk branch 4 times, most recently from 83d14d6 to 1117cf6 Compare March 7, 2026 08:20
@johngian johngian changed the title Working example python sdk Working example of using python sdk Mar 7, 2026
@johngian johngian changed the title Working example of using python sdk Working example of using the python sdk Mar 7, 2026
@johngian
johngian force-pushed the working-example-python-sdk branch from 1117cf6 to a7f3b3f Compare March 7, 2026 09:14
johngian added 3 commits March 7, 2026 17:20
* Use OutgoingPaymentWithSpentAmounts to pass model verification
* Fix hash mismatch because of trailing slash
* Add default=None for optional fields
* Fix assignment typo on get_outgoing_payments
* Make updatedAt optional because some time the API response doesn't return it
* Minor oversights because of lack of testing in a real env
* Docs for the example are on README.md
* Uses docker-compose to simplify orchestration
* It replicates the example from the nodejs sdk repo
* Spins off a temporary sidecar service to handle callback
* Everything is locked to current latest
* Remove deprecated dependency and serialize field manually
@johngian
johngian force-pushed the working-example-python-sdk branch from a7f3b3f to 2a9b5f6 Compare March 7, 2026 09:20
@adrianboros

Copy link
Copy Markdown
Contributor

Thanks @johngian for exercising the SDK through a peer-to-peer payment example and contributing the fixes uncovered along the way. The example and its setup documentation will help developers understand the complete payment flow.

We’re proceeding with integrating this contribution after #12, following the sequence discussed there. We’ll reconcile the overlapping model, dependency, and request-handling changes while preserving the example and applicable fixes.

Follow-up work will align the combined SDK with Open Payments v1.5.1 and the sibling SDKs. For this contribution, that includes:

  • Verifying HTTP signatures and content digests against the exact transmitted URL and body bytes.
  • Completing callback-hash interoperability tests and documenting the supported encoding behavior.
  • Aligning response models and wallet extension handling with the current specifications.
  • Updating the example as the client interface evolves, with configurable test credentials and assertions covering the complete flow.

We’ll use this example as an ongoing integration scenario when validating the completed SDK. Thanks for providing both the fixes and a practical way to exercise them.

Preserve the model and workflow simplification from PR interledger#12 alongside the request fixes, dependency updates, and peer-to-peer example from PR interledger#14. Use the example adaptation published by @johngian at cb5a861. Regenerate the combined Poetry lockfile.

Validation: unit test passes; both example modules import; all nine example requests complete with mocked HTTP responses; Ed25519 signatures verify and reject changed target URIs; the documented callback hash vector passes; Poetry lock consistency passes.
@adrianboros
adrianboros merged commit c193919 into interledger:main Nov 26, 2026
4 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants