From 75a975d65db127b19a1f237c3231d3cd3a9b2f92 Mon Sep 17 00:00:00 2001 From: Christian Wick Date: Mon, 21 Jun 2021 03:43:20 +0200 Subject: [PATCH] div template changes --- README.md | 19 +++++--- .../theme/components/PageResource.vue | 20 ++++++-- .../rest/v1/merchant.settlement.latest/get.md | 6 +-- .../rest/v1/merchant.shortlink/index.md | 47 ++++++++++++++++++- .../rest/v1/merchant.statusCodes/index.md | 6 ++- .../rest/v1/merchant.users/create.md | 6 +-- .../rest/v1/merchant.users/delete.md | 6 +-- .../reference/rest/v1/merchant.users/get.md | 4 +- .../reference/rest/v1/merchant.users/index.md | 8 +++- .../rest/v1/merchant.users/update.md | 6 +-- .../v1/users.permissions.request/index.md | 6 ++- 11 files changed, 105 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 71fc0df..a7567d6 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ [![Netlify Status](https://api.netlify.com/api/v1/badges/f4516111-2bfc-4ae0-9fc3-626cfe56e954/deploy-status)](https://app.netlify.com/sites/settle-developer-docs/deploys) + # Settle API Docs ## Introduction This is the repo for the [Settle APIs Documentation](https://developer.settle.eu/) website. It's buildt using [Vuepress](https://vuepress.vuejs.org/) - a minimalistic Vue-powered static site generator from [Evan You](https://evanyou.me/), the creator of [Vue.js](https://vuejs.org/), and [Netlify CMS](https://www.netlifycms.org/) - an open source content management for your [Git workflow](https://guides.github.com/introduction/flow/). -***TL;DR:*** *[Contributing and setting up local environment](#contributing)* +**_TL;DR:_** _[Contributing and setting up local environment](#contributing)_ ## VuePress @@ -52,13 +53,19 @@ At its core, **Netlify CMS** is an open-source React app that acts as a wrapper `yarn install` -4. ### Start the local dev server +4. ### Add .env.local file + + Create a new file in the root folder named `.env.local` and add the `GITHUB_TOKEN` environment variable found in the Netlify Deploy Settings. + + Learn more about environment variables over in the [Netlify docs](https://docs.netlify.com/configure-builds/environment-variables/) + +5. ### Start the local dev server `yarn docs:dev` By default, you should now see your scaffolded Settle APIs docs site at [https://localhost:8080](https://localhost:8080)🚀 -5. ### Start the local CMS server +6. ### Start the local CMS server `npx netlify-cms-proxy-server` @@ -78,10 +85,10 @@ At its core, **Netlify CMS** is an open-source React app that acts as a wrapper 3. ### Push to the branch - `git push origin feat/my-awesome-feature` + `git push origin feat/my-awesome-feature` 4. ### Open a Pull Request 🤓 - `gh pr create --title "My Awesome feature" --body "This is my new awesome feature." --base dev` + `gh pr create --title "My Awesome feature" --body "This is my new awesome feature." --base dev` - **NOTE:** Pull Requests are used to start conversation about proposed changes before they're code is reviewed and eventually merged into the main branch, and **we will only consider Pull Requests initiated towards the [dev branch](https://github.com/SettleAPI/settle-developer-docs/tree/dev)**. Pull Requests towards any other branch will be ignored and closed without any further notifications. + **NOTE:** Pull Requests are used to start conversation about proposed changes before they're code is reviewed and eventually merged into the main branch, and **we will only consider Pull Requests initiated towards the [dev branch](https://github.com/SettleAPI/settle-developer-docs/tree/dev)**. Pull Requests towards any other branch will be ignored and closed without any further notifications. diff --git a/docs/.vuepress/theme/components/PageResource.vue b/docs/.vuepress/theme/components/PageResource.vue index e553cb9..70816ef 100644 --- a/docs/.vuepress/theme/components/PageResource.vue +++ b/docs/.vuepress/theme/components/PageResource.vue @@ -39,11 +39,17 @@
  • Required Auth Level: SECRET + >{{ $frontmatter.authLevel }} + + {{ $frontmatter.authLevel }} +
  • -
  • Authorized Roles: All
  • +
  • Authorized Roles: {{ $frontmatter.authRoles }}
  • # Base URIs @@ -140,7 +146,7 @@

    NOTE

    The request body can not be empty.

    - +

    # Response Body

    @@ -152,7 +158,11 @@

    WARNING

    -

    No reference found for method {{ $frontmatter.operationId }}.

    +

    + No reference found for method + {{ $frontmatter.operationId }}. +

    diff --git a/docs/api/reference/rest/v1/merchant.settlement.latest/get.md b/docs/api/reference/rest/v1/merchant.settlement.latest/get.md index 1182301..ea5780b 100644 --- a/docs/api/reference/rest/v1/merchant.settlement.latest/get.md +++ b/docs/api/reference/rest/v1/merchant.settlement.latest/get.md @@ -1,12 +1,12 @@ --- layout: SpecialLayout -title: merchant.settlement.latest +title: merchant.settlement.latest.get description: Endpoint description... api: merchant schema: merchant.settlement.latest -operationId: merchant.settlement.latest +operationId: merchant.settlement.latest.get operation: get method: get authLevel: SECRET authRoles: Any ---- \ No newline at end of file +--- diff --git a/docs/api/reference/rest/v1/merchant.shortlink/index.md b/docs/api/reference/rest/v1/merchant.shortlink/index.md index 3f52e8d..a523854 100644 --- a/docs/api/reference/rest/v1/merchant.shortlink/index.md +++ b/docs/api/reference/rest/v1/merchant.shortlink/index.md @@ -4,4 +4,49 @@ title: merchant.shortlink description: Overview schema: merchant.shortlink api: merchant ---- \ No newline at end of file +--- + +## Shortlink Scan Handler + +When user scans, Settle sends scan id and argstring, and can receive text and uri which can be transported back to the app. Uri will be opened in a web view inside the app if registered in list of trusted domains. + +
    +
    +

    + POST http://merchant.server/callback/url +

    +
    +
    + +

    + # Schema +

    + +
    + +### id + +- Type: `string` +- Required: `true` + +The scan token ID that can be used as recipient for payment and permission requests. Expires in one day. + +### argstring + +- Type: `string` +- Required: `false` +- Default: `null` + +The string that was appended to the shortlink value in the QR code that was scanned. + +
    + +## Trusted Domains + +Because of security considerations when opening external URIs inside the Settle App, URIs or domains that will be opened in the app needs to be preapproved by Settle. + +There are currently no API endpoints for managing trusted domains, please contact Settle support to register domain that should be visible inside app. + +## Shortlink Management + +To be able to receive scans, one must first register a shortlink. diff --git a/docs/api/reference/rest/v1/merchant.statusCodes/index.md b/docs/api/reference/rest/v1/merchant.statusCodes/index.md index 59cc8b9..830adda 100644 --- a/docs/api/reference/rest/v1/merchant.statusCodes/index.md +++ b/docs/api/reference/rest/v1/merchant.statusCodes/index.md @@ -4,4 +4,8 @@ title: merchant.statusCodes description: Overview schema: merchant.statusCodes api: merchant ---- \ No newline at end of file +--- + +## Status Code + +Some resources, such as the outcome resources (for payment request and permission request), have a status code field in the response body. The status_code resource lists and describes all possible status codes. Making a `GET /status_code/` request yields a list of status codes with corresponding names and descriptions. Making a `GET /status_code/{value}/` request (substituting `{value}` for a status code integer) yields the information for a particular status code. diff --git a/docs/api/reference/rest/v1/merchant.users/create.md b/docs/api/reference/rest/v1/merchant.users/create.md index 1a1e355..37c437c 100644 --- a/docs/api/reference/rest/v1/merchant.users/create.md +++ b/docs/api/reference/rest/v1/merchant.users/create.md @@ -7,6 +7,6 @@ schema: merchant.users operationId: merchant.users.create operation: post method: create -authLevel: SECRET -authRoles: Any ---- \ No newline at end of file +authLevel: KEY +authRoles: All +--- diff --git a/docs/api/reference/rest/v1/merchant.users/delete.md b/docs/api/reference/rest/v1/merchant.users/delete.md index 5ae24a5..4b4c7e1 100644 --- a/docs/api/reference/rest/v1/merchant.users/delete.md +++ b/docs/api/reference/rest/v1/merchant.users/delete.md @@ -7,6 +7,6 @@ schema: merchant.users operationId: merchant.users.delete operation: delete method: delete -authLevel: SECRET -authRoles: Any ---- \ No newline at end of file +authLevel: KEY +authRoles: All +--- diff --git a/docs/api/reference/rest/v1/merchant.users/get.md b/docs/api/reference/rest/v1/merchant.users/get.md index 0b4a3f0..243c935 100644 --- a/docs/api/reference/rest/v1/merchant.users/get.md +++ b/docs/api/reference/rest/v1/merchant.users/get.md @@ -8,5 +8,5 @@ operationId: merchant.users.get operation: get method: get authLevel: SECRET -authRoles: Any ---- \ No newline at end of file +authRoles: All +--- diff --git a/docs/api/reference/rest/v1/merchant.users/index.md b/docs/api/reference/rest/v1/merchant.users/index.md index 82f9d8b..edef636 100644 --- a/docs/api/reference/rest/v1/merchant.users/index.md +++ b/docs/api/reference/rest/v1/merchant.users/index.md @@ -4,4 +4,10 @@ title: merchant.users description: Overview schema: merchant.users api: merchant ---- \ No newline at end of file +--- + +## Mercant Users + +In order to gain access to the [Merchant API](/api/reference/rest/v1/) a client must authenticate itself using the ID and the secret/public key of an existing user. This means that the first user for a merchant must be created in the Self Service Portal or by an integrator on behalf of the merchant. + +Each user is created for a specific merchant, which ID is given by the value of the **X-Settle-Merchant** header when making a [ `merchant.users.create` ](/api/reference/rest/v1/merchant.users/create/) request. A user can only interact with the API on behalf of the merchant which it was created for. The user ID is chosen on create and is has to be unique for the parent Merchant. diff --git a/docs/api/reference/rest/v1/merchant.users/update.md b/docs/api/reference/rest/v1/merchant.users/update.md index cc0cb42..68e73f5 100644 --- a/docs/api/reference/rest/v1/merchant.users/update.md +++ b/docs/api/reference/rest/v1/merchant.users/update.md @@ -7,6 +7,6 @@ schema: merchant.users operationId: merchant.users.update operation: put method: update -authLevel: SECRET -authRoles: Any ---- \ No newline at end of file +authLevel: KEY +authRoles: All +--- diff --git a/docs/api/reference/rest/v1/users.permissions.request/index.md b/docs/api/reference/rest/v1/users.permissions.request/index.md index 06deb59..a6ba9de 100644 --- a/docs/api/reference/rest/v1/users.permissions.request/index.md +++ b/docs/api/reference/rest/v1/users.permissions.request/index.md @@ -4,4 +4,8 @@ title: users.permissions.request description: Overview schema: users.permissions.request api: users ---- \ No newline at end of file +--- + +## Permission Request + +Request authorization to access user controlled endpoint.