interledger / open-payments

Protocol to setup payments between entities on the Web based on GNAP
https://openpayments.dev
Apache License 2.0
175 stars 29 forks source link

feat: make body, interact_ref optional on client grant continue #436

Closed BlairCurrey closed 6 months ago

BlairCurrey commented 6 months ago

Changes proposed in this pull request

Updates the client args so that the continue request does not require the interact_ref nor body. It was recently changed such that it can be undefined, but is still required like so:

client.grant.continue({ accessToken, url }, { interact_ref: undefined })

With these changes you can do:

client.grant.continue({ accessToken, url }, {})

or

client.grant.continue({ accessToken, url })

Context

small follow-up on https://github.com/interledger/open-payments/issues/433

Originally I made the PR for ergonomics sake on the client, but actually I think it will be necessary for continuation polling via the client (at least without adjusting auth server logic), since this is how we're checking whether or not to poll (condition wont be met with any body.interact_ref):

  if (!ctx.request.body || Object.keys(ctx.request.body).length === 0) {
    await pollGrantContinuation(deps, ctx, continueId, continueToken)
    return
  }
changeset-bot[bot] commented 6 months ago

🦋 Changeset detected

Latest commit: c830020caf585c30323da283406a335e36b0eafe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | -------------------------- | ----- | | @interledger/open-payments | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

netlify[bot] commented 6 months ago

Deploy Preview for openpayments-preview canceled.

Name Link
Latest commit c830020caf585c30323da283406a335e36b0eafe
Latest deploy log https://app.netlify.com/sites/openpayments-preview/deploys/65ebe62bff9cee0008ae82d0