docs: add Windows setup instructions and update Postman docs (#486)

This commit is contained in:
Ankit Yadav
2023-02-03 15:54:48 +05:30
committed by GitHub
parent 7d8f100037
commit 4d6031f7e4
4 changed files with 115 additions and 8375 deletions

View File

@ -0,0 +1,34 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Existing Dockerfile",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile"
},
"features": {
"ghcr.io/devcontainers-contrib/features/redis-homebrew:1": {}
},
"customizations": {
"vscode": {
"extensions": ["tamasfe.even-better-toml", "rust-lang.rust-analyzer"]
}
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8080]
// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
}

View File

@ -20,6 +20,7 @@ Check the Table Of Contents to jump to the relevant section.
- [Set up hyperswitch using Docker Compose](#set-up-hyperswitch-using-docker-compose)
- [Set up a Rust environment and other dependencies](#set-up-a-rust-environment-and-other-dependencies)
- [Set up dependencies on Ubuntu-based systems](#set-up-dependencies-on-ubuntu-based-systems)
- [Set up dependencies on Windows](#set-up-dependencies-on-windows)
- [Set up dependencies on MacOS](#set-up-dependencies-on-macos)
- [Set up the database](#set-up-the-database)
- [Configure the application](#configure-the-application)
@ -131,12 +132,51 @@ for your distribution and follow along.
cargo install diesel_cli --no-default-features --features "postgres"
```
5. Make sure your system has OpenSSL installed:
```shell
sudo apt install libssl-dev
```
Once you're done with setting up the dependencies, proceed with
[setting up the database](#set-up-the-database).
[postgresql-install]: https://www.postgresql.org/download/
[redis-install]: https://redis.io/docs/getting-started/installation/
### Set up dependencies on Windows
We'll be using [`winget`][winget] in this section of the guide, where possible.
You can opt to use your favorite package manager instead.
1. Install PostgreSQL database, following the
[official installation docs][postgresql-install-windows].
2. Install Redis, following the
[official installation docs][redis-install-windows].
3. Install rust with `winget`:
```shell
winget install -e --id Rustlang.Rust.GNU
```
4. Install `diesel_cli` using `cargo`:
```shell
cargo install diesel_cli --no-default-features --features "postgres"
```
5. Install OpenSSL with `winget`:
```shell
winget install openssl
```
[winget]: https://github.com/microsoft/winget-cli
[postgresql-install-windows]: https://www.postgresql.org/download/windows/
[redis-install-windows]: https://redis.io/docs/getting-started/installation/install-redis-on-windows
### Set up dependencies on MacOS
We'll be using [Homebrew][homebrew] in this section of the guide.
@ -306,8 +346,13 @@ Once you're done with configuring the application, proceed with
1. Sign up or sign in to [Postman][postman].
2. Open our [Postman collection][postman-collection] and switch to the
["Variables" tab][variables].
Add the admin API key you configured in the application configuration under
the "current value" column for the `admin_api_key` variable.
Update the value under the "current value" column for the `baseUrl` variable
to have the hostname and port of the locally running server
(`http://localhost:8080` by default).
3. While on the "Variables" tab, add the admin API key you configured in the
application configuration under the "current value" column for the
`admin_api_key` variable.
1. If you're running Docker Compose, you can find the configuration file at
[`config/docker_compose.toml`][config-docker-compose], search for
@ -316,8 +361,8 @@ Once you're done with configuring the application, proceed with
file at [`config/Development.toml`][config-development], search for
`admin_api_key` to find the admin API key
3. Open the ["Quick Start" folder][quick-start] in the collection.
4. Open the ["Merchant Account - Create"][merchant-account-create] request,
4. Open the ["Quick Start" folder][quick-start] in the collection.
5. Open the ["Merchant Account - Create"][merchant-account-create] request,
switch to the "Body" tab and update any request parameters as required.
- If you want to use a different connector for making payments with
@ -330,7 +375,7 @@ Once you're done with configuring the application, proceed with
Store the merchant ID, API key and publishable key returned in the response
securely.
5. Open the ["Variables" tab][variables] in the
6. Open the ["Variables" tab][variables] in the
[Postman collection][postman-collection] and add the following variables:
1. Add the API key you obtained in the previous step under the "current value"
@ -349,6 +394,9 @@ Once you're done with configuring the application, proceed with
`connector_account_details` fields and update them.
You can find connector-specific details to be included in this
[spreadsheet][connector-specific-details].
- Open the ["Variables" tab][variables] in the
[Postman collection][postman-collection] and set the `connector_api_key`
variable to your connector's API key.
Click on the "Send" button to create a payment connector account.
You should obtain a response containing most of the data included in the

View File

@ -1,18 +1,34 @@
## POSTMAN Collection
# Postman Collection
The [Postman](https://www.postman.com/) [collection](./collection.postman.json) is generated using [Portman](https://www.npmjs.com/package/@apideck/portman) tool from the [OpenApi Spec](../openapi/open_api_spec.yaml).
You can find the latest Postman collection [here][postman-collection].
For getting started quickly, you can also
[fork the Postman collection][postman-collection-fork] under your workspace.
Steps to generate the new collection.
## Auto-Generating the Postman Collection
* Install portman [ [refer to github](https://github.com/apideck-libraries/portman) ]
The [Postman collection][postman-collection] is generated using
[`portman`][portman] tool from the [OpenAPI specification][openapi-spec].
If you'd like to generate the collection from the OpenAPI specification, you can
follow the below steps:
```bash
# Global install
$ npm install -g @apideck/portman
```
1. Install `portman`, refer to the instructions on
[the repository][portman-repository]:
* From the base directory, run
```shell
npm install -g @apideck/portman
```
```bash
portman --cliOptionsFile postman/portman-cli.json
```
2. From the root of the project directory, run the following command to generate
the Postman collection.
```shell
portman --cliOptionsFile postman/portman-cli.json
```
**NOTE:** Please verify Postman collection variables before trying out the APIs.
[postman-collection]: https://www.postman.com/hyperswitch/workspace/hyperswitch/collection/25176183-e36f8e3d-078c-4067-a273-f456b6b724ed
[postman-collection-fork]: https://www.postman.com/hyperswitch/workspace/hyperswitch/collection/25176183-e36f8e3d-078c-4067-a273-f456b6b724ed/fork
[portman]: https://www.npmjs.com/package/@apideck/portman
[openapi-spec]: /openapi/open_api_spec.yaml
[portman-repository]: https://github.com/apideck-libraries/portman

File diff suppressed because one or more lines are too long