Skip to content
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: Adds async reactor documentation #76

Merged
merged 10 commits into from
Feb 21, 2023
Merged

feat: Adds async reactor documentation #76

merged 10 commits into from
Feb 21, 2023

Conversation

dhudec
Copy link
Contributor

@dhudec dhudec commented Feb 16, 2023

Description

  • Documents async reactors
  • Documents reactor errors and the reactor formula JS SDK

Testing required outside of automated testing?

  • Not Applicable

Screenshots (if appropriate):

  • Not Applicable

Rollback / Rollforward Procedure

  • Roll Forward
  • Roll Back

Reviewer Checklist

  • Description of Change
  • Description of outside testing if applicable.
  • Description of Roll Forward / Backward Procedure
  • Documentation updated for Change

@dhudec dhudec requested a review from a team as a code owner February 16, 2023 20:34
@vercel
Copy link

vercel bot commented Feb 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
developers-basistheory-com ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 21, 2023 at 5:02PM (UTC)

When integrating with an external API within a reactor, we strongly recommend handling all vendor-specific errors
that are documented by the vendor and translating into an appropriate Basis Theory error type.

Some vendors express error scenarios via HTTP status codes, while others opt to return a generic status code such as `200 OK` while
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Some vendors express error scenarios via HTTP status codes, while others opt to return a generic status code such as `200 OK` while
Some external APIs express error scenarios via HTTP status codes, while others opt to return a generic status code such as `200 OK` while

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhudec I actually wonder if this is fine now that i read everything. I've been trying to think about how I talk about these relationships vs how one of our end-users may.

Vendor may be fine now, although I'm wondering if we should be talking about it specifically as an API vs Vendor/3rd Party in our docs as that is really what they would be interacting with.

Thoughts? (for now I'm fine if you close this without adding it and we can talk more in Slack)

| `args` | false | _object_ | `null` | Arguments to provide to the reactor. These arguments must contain the declared [request parameters](/docs/api/reactors/reactor-formulas#reactor-formula-request-parameters) for the reactor formula. |
| Parameter | Required | Type | Default | Description |
| -------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `args` | false | _object_ | `null` | Arguments to provide to the reactor. These arguments must contain the declared [request parameters](/docs/api/reactors/reactor-formulas#reactor-formula-request-parameters) for the reactor formula. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still true? i thought we did away with "required" arguments?

Or does this mean that IF the reactor defines them, you MUST include them?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the latter, we should be explicit about that here. I can suggest if that's the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, we don't require request parameters to be declared anymore

| -------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `args` | false | _object_ | `null` | Arguments to provide to the reactor. These arguments must contain the declared [request parameters](/docs/api/reactors/reactor-formulas#reactor-formula-request-parameters) for the reactor formula. |
| `callback_url` | false | _string_ | `null` | Indicates that the reactor should be invoked asynchronously and the result delivered as a webhook to this URL. See [Asynchronous Reactors](/docs/concepts/what-are-reactors#asynchronous-reactors) for more info. |
| `timeout_ms` | false | _int_ | `10000` | The maximum execution time for the reactor. Value must be between `10000` (10s) and `210000` (3.5m). Only supported for [Asynchronous Reactors](/docs/concepts/what-are-reactors#asynchronous-reactors) requests. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the value CANT be less than 10s?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the way it is right now, that's correct...

@@ -95,6 +104,38 @@ curl "https://api.basistheory.com/reactors/5b493235-6917-4307-906a-2cd6f1a90b13/
}'
```

### Asynchronous Reactors

Reactors can be invoked asynchronously by providing a `callback_url` parameter within the [request](/docs/api/reactors#invoke-a-reactor).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Reactors can be invoked asynchronously by providing a `callback_url` parameter within the [request](/docs/api/reactors#invoke-a-reactor).
Reactors are invoked asynchronously by providing a `callback_url` parameter within the [request](/docs/api/reactors#invoke-a-reactor).

@dhudec dhudec merged commit 4fb1ded into master Feb 21, 2023
@dhudec dhudec deleted the eng-4078 branch February 21, 2023 17:02
bt-platform-eng pushed a commit that referenced this pull request Feb 21, 2023
# [1.32.0](v1.31.0...v1.32.0) (2023-02-21)

### Features

* Adds async reactor documentation ([#76](#76)) ([4fb1ded](4fb1ded))
@bt-platform-eng
Copy link

🎉 This PR is included in version 1.32.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants