-
Notifications
You must be signed in to change notification settings - Fork 89
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(backend): SPSPRouteError #2705
Conversation
✅ Deploy Preview for brilliant-pasca-3e80ec ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -24,11 +37,20 @@ const spspMiddleware = async ( | |||
): Promise<void> => { | |||
// Fall back to legacy protocols if client doesn't support Open Payments. | |||
if (ctx.accepts('application/spsp4+json')) { | |||
const receiver = ctx.walletAddress ?? ctx.incomingPayment |
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.
ctx.incomingPayment
was a leftover thing from when we had the "connection" resource in Open Payments. does not apply anymore
const walletAddressService = await ctx.container.use('walletAddressService') | ||
|
||
const walletAddress = await walletAddressService.getByUrl( | ||
ctx.walletAddressUrl |
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.
Using ctx.walletAddressUrl
instead of ctx.walletAddress
as part of a larger refactor to remove the wallet address middleware altogether, see #2708
9edbd82
to
6cf1e7f
Compare
6cf1e7f
to
b0b6e13
Compare
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.
LGTM
Changes proposed in this pull request
SPSPRouteError
instead of directly callingctx.throw
. This is then handled like any error thrown in the Open Payments routes/middlewareContext
Related to #1905
Checklist
fixes #number