Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 61 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Settle Request Generator
This small utility can be used to help with testing the `KEY` authentication method for integration with the Settle API. It generates the correct headers for a signed request using the request parameters and a private key.

This small utility can be used to help with testing the `KEY` authentication method for integration with the Settle API. It generates the correct headers for a signed request using the request parameters and a private key.

## Try it here

https://settleapi.github.io/settle-request-generator
<https://settleapi.github.io/settle-request-generator>

## Authentication with the Settle API
Please visit the [Settle API documentation](https://developer.settle.eu/authentication.html) for more information on the two types of authentication, `SECRET` and `KEY`.

Please visit the [Settle API documentation](https://developer.settle.eu/authentication.html) for more information on the two types of authentication, `SECRET` and `KEY`.

The api credentials are managed in the [Settle Business portal](https://business.settle.eu/) (a [sandbox version](https://business.sandbox.settle.eu/) is also available) under the *Integration* tab.

Expand All @@ -15,6 +17,7 @@ To get started you can just let Settle generate the key-pair for you, but please
You can also generate your own key and just upload the public part to Settle.

### Generate RSA private key

```bash
openssl genrsa -des -out private.pem 2048
```
Expand All @@ -25,22 +28,24 @@ You'll have to to enter a passphrase. Under appropriate conditions (noninteracti
openssl rsa -in private.pem -out private.pem
```


### Generate RSA public key

```bash
openssl rsa -in private.pem -outform PEM -pubout -out public.pem
```


## Field data examples

* **Merchant ID**: `abc123`
* **API key ID**: `xyz789`
* **Method**: `POST`
* **URL**: `https://api.sandbox.settle.eu/merchant/v1/payment_request/`
### For default use with `X-Auka-User`

* **X-Auka-Merchant**: `abc123`
* **X-Auka-User**: `xyz789`
* **REST API Method**: `POST`
* **REST API Endpoint URL**: `https://api.sandbox.settle.eu/merchant/v1/payment_request/`
* **Request body**:
```{

```
{
"payer": "abc123",
"payee": "msisdn:47123456789",
"idempotency_id": "04449a4866",
Expand All @@ -51,7 +56,9 @@ openssl rsa -in private.pem -outform PEM -pubout -out public.pem
"expires_in": 120
}
```
* **Private keyfor** `xyz789`:

* Private RSA key for **X-Auka-User** `xyz789`:

```
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQCotJXYCo9VPuS1qjBRPAP5jAN9Wj8qmYnKMy31w81jiL3QegVQ/w6pCoy3
Expand All @@ -69,4 +76,47 @@ jFUCQQCEKcuxG/huGU5PuNRKA5TfpOE9l0cquiI9613YdbbUszc19PWXFywu5ttHzp29y3jE
-----END RSA PRIVATE KEY-----
```

### For integrator use with `X-Auka-Integrator`

* **X-Auka-Merchant**: `fzkmhy0q`
* **X-Auka-Integrator**: `7e3cbb17`
* **REST API Method**: `POST`
* **REST API Endpoint URL**: `https://api.sandbox.settle.eu/merchant/v1/payment_request/`
* **Request body**:

```
{
"payer": "fzkmhy0q",
"payee": "msisdn:47123456789",
"idempotency_id": "04449a4866",
"currency": "NOK",
"amount": 1000,
"require_identified": "True",
"chat_text": "Some text",
"expires_in": 120
}
```

### Private RSA key

For **X-Auka-Integrator** `7e3cbb17`:

```
-----BEGIN RSA PRIVATE KEY-----
MIICWgIBAAKBgGeEsepm1Dm0LMW9H4cgO8+RpyiQh6JcWKlKfGZahTo3iXq55wGh
DLOHVP1i5ULPuz8IA3HG1W481AlBeIvT/fmlKy/zjNUebAClvujpKjMRkn2p0Npg
kyC4b17ZtoEkmixM2SrVhxBpy1PJoLFNKILqOGF+nFJ3Du/AEDOTNMrzAgMBAAEC
gYAJYriW3hfj23grvYf8Qmnp2fTj8qa5i9HmF4DL7u0haCOo4u4U8bsrE9wa1Tqg
IiGCB4H4cOStCArZg/wgAWqHeHKyn5+U74hbUnVMwj79zPgySJ/olFtrMptS8Jwe
28zGDua91T7a8y/12HY+a4EGQd/K6S8z3lgnMBFcebI84QJBAKS1wVM0Nu4RZmSS
50GWWui3sdHxe8OxyyiDUdBxajTuIuIH7/A6SOILRGs7cSF3ST9BVk0Lsx+jejvE
rg30E9sCQQCg5KBqp93nZs0ky+DuVK63HYVo9+AF6r7bNXvvX9L0V0FaaUgqdjeL
aonhBQ0VvmtCya+6poyptSbAVEmA09zJAkBI6VhaD6wdOMCd1tXeF8PIbsCdkgta
dpLbLT6DSiFcqunwKtlQ+0wWHCy+V0LeMKLRCIg+dOZnJAPQ/2CZNqmvAkAl2yVT
cwPnOmzyR3Y5HXuuYifNtuTi/4TAlyj9/ZHpI86gszzjoMUY7IxcgY++mfsqz8Gl
LSLTm2fuwOY6hZ7hAkAmww+iGigsQK/qFUenQ1afn9hQxsLrriOgBKNZygqFBHh4
4u6VK3BHZuYEpMcEzY6JSEKxucN7rZ8CulNO9A0w
-----END RSA PRIVATE KEY-----
```

[![Netlify Status](https://api.netlify.com/api/v1/badges/a7197edc-db66-4a23-b006-657a5868fdbf/deploy-status)](https://app.netlify.com/sites/settle-request-generator/deploys)
36 changes: 29 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
animation: pulse 0.5s 1;
}

.pure-form-aligned .pure-control-group label {
width: 13em;
}

@keyframes pulse {
0% {
background-color: rgb(230, 255, 230);
Expand All @@ -38,29 +42,47 @@
<body>
<h1 id="test">Settle API PKCS#1 1.5 signature generator</h1>
<div class="pure-form pure-form-aligned">

<p>Is an Integrator acting as a proxy on behalf of a Merchant client?</p>
<div class="pure-u-1-2">
<div class="pure-u-1-8">
<label for="is-integrator-false" class="pure-radio">
<input type="radio" id="is-integrator-false" name="optionsRadios" value="integratorFalse" checked="" onclick="integratorFalse();" /> No
</label>
</div>
<div class="pure-u-1-8">
<label for="is-integrator-true" class="pure-radio">
<input type="radio" id="is-integrator-true" name="optionsRadios" value="integratorTrue" onclick="integratorTrue();" /> Yes
</label>
</div>
</div>
<hr /><br />
<div class="pure-control-group">
<label for="merchant_id">Merchant ID</label>
<label for="merchant_id">X-Auka-Merchant</label>
<input type="text" name="merchant_id" id="merchant_id"></input>
</div>

<div class="pure-control-group">
<label for="api_user">API key ID</label>
<div class="pure-control-group" id="controllGroupApiUser">
<label for="api_user">X-Auka-User</label>
<input type="text" name="api_user" id="api_user"></input>
</div>

<div class="pure-control-group integrator" id="controllGroupIntegrator">
<label for="X_Auka_Integrator">X-Auka-Integrator</label>
<input type="text" name="X_Auka_Integrator" id="X_Auka_Integrator"></input>
</div>

<div class="pure-control-group">
<label for="private_key">Private key</label>
<label for="private_key">Private RSA key</label>
<textarea name="private_key" id="private_key" cols="70" rows="15"></textarea>
</div>

<div class="pure-control-group">
<label for="method">Method</label>
<label for="method">REST API Method</label>
<input type="text" name="method" id="method"></input>
</div>

<div class="pure-control-group">
<label for="url">URL</label>
<label for="url">REST API Endpoint URL</label>
<input class='wide' type="text" name="url" id="url" cols="70"></input>
</div>

Expand Down
Loading