Skip to content

Commit f951c17

Browse files
authored
Merge pull request #4 from SettleAPI/feature/x-auka-integrator
Added support for X-Auka-Integrator
2 parents f6e3f88 + f3ae812 commit f951c17

3 files changed

Lines changed: 219 additions & 95 deletions

File tree

README.md

Lines changed: 61 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Settle Request Generator
2-
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.
2+
3+
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.
34

45
## Try it here
56

6-
https://settleapi.github.io/settle-request-generator
7+
<https://settleapi.github.io/settle-request-generator>
78

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

1113
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.
1214

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

1719
### Generate RSA private key
20+
1821
```bash
1922
openssl genrsa -des -out private.pem 2048
2023
```
@@ -25,22 +28,24 @@ You'll have to to enter a passphrase. Under appropriate conditions (noninteracti
2528
openssl rsa -in private.pem -out private.pem
2629
```
2730

28-
2931
### Generate RSA public key
3032

3133
```bash
3234
openssl rsa -in private.pem -outform PEM -pubout -out public.pem
3335
```
3436

35-
3637
## Field data examples
3738

38-
* **Merchant ID**: `abc123`
39-
* **API key ID**: `xyz789`
40-
* **Method**: `POST`
41-
* **URL**: `https://api.sandbox.settle.eu/merchant/v1/payment_request/`
39+
### For default use with `X-Auka-User`
40+
41+
* **X-Auka-Merchant**: `abc123`
42+
* **X-Auka-User**: `xyz789`
43+
* **REST API Method**: `POST`
44+
* **REST API Endpoint URL**: `https://api.sandbox.settle.eu/merchant/v1/payment_request/`
4245
* **Request body**:
43-
```{
46+
47+
```
48+
{
4449
"payer": "abc123",
4550
"payee": "msisdn:47123456789",
4651
"idempotency_id": "04449a4866",
@@ -51,7 +56,9 @@ openssl rsa -in private.pem -outform PEM -pubout -out public.pem
5156
"expires_in": 120
5257
}
5358
```
54-
* **Private keyfor** `xyz789`:
59+
60+
* Private RSA key for **X-Auka-User** `xyz789`:
61+
5562
```
5663
-----BEGIN RSA PRIVATE KEY-----
5764
MIICXQIBAAKBgQCotJXYCo9VPuS1qjBRPAP5jAN9Wj8qmYnKMy31w81jiL3QegVQ/w6pCoy3
@@ -69,4 +76,47 @@ jFUCQQCEKcuxG/huGU5PuNRKA5TfpOE9l0cquiI9613YdbbUszc19PWXFywu5ttHzp29y3jE
6976
-----END RSA PRIVATE KEY-----
7077
```
7178

79+
### For integrator use with `X-Auka-Integrator`
80+
81+
* **X-Auka-Merchant**: `fzkmhy0q`
82+
* **X-Auka-Integrator**: `7e3cbb17`
83+
* **REST API Method**: `POST`
84+
* **REST API Endpoint URL**: `https://api.sandbox.settle.eu/merchant/v1/payment_request/`
85+
* **Request body**:
86+
87+
```
88+
{
89+
"payer": "fzkmhy0q",
90+
"payee": "msisdn:47123456789",
91+
"idempotency_id": "04449a4866",
92+
"currency": "NOK",
93+
"amount": 1000,
94+
"require_identified": "True",
95+
"chat_text": "Some text",
96+
"expires_in": 120
97+
}
98+
```
99+
100+
### Private RSA key
101+
102+
For **X-Auka-Integrator** `7e3cbb17`:
103+
104+
```
105+
-----BEGIN RSA PRIVATE KEY-----
106+
MIICWgIBAAKBgGeEsepm1Dm0LMW9H4cgO8+RpyiQh6JcWKlKfGZahTo3iXq55wGh
107+
DLOHVP1i5ULPuz8IA3HG1W481AlBeIvT/fmlKy/zjNUebAClvujpKjMRkn2p0Npg
108+
kyC4b17ZtoEkmixM2SrVhxBpy1PJoLFNKILqOGF+nFJ3Du/AEDOTNMrzAgMBAAEC
109+
gYAJYriW3hfj23grvYf8Qmnp2fTj8qa5i9HmF4DL7u0haCOo4u4U8bsrE9wa1Tqg
110+
IiGCB4H4cOStCArZg/wgAWqHeHKyn5+U74hbUnVMwj79zPgySJ/olFtrMptS8Jwe
111+
28zGDua91T7a8y/12HY+a4EGQd/K6S8z3lgnMBFcebI84QJBAKS1wVM0Nu4RZmSS
112+
50GWWui3sdHxe8OxyyiDUdBxajTuIuIH7/A6SOILRGs7cSF3ST9BVk0Lsx+jejvE
113+
rg30E9sCQQCg5KBqp93nZs0ky+DuVK63HYVo9+AF6r7bNXvvX9L0V0FaaUgqdjeL
114+
aonhBQ0VvmtCya+6poyptSbAVEmA09zJAkBI6VhaD6wdOMCd1tXeF8PIbsCdkgta
115+
dpLbLT6DSiFcqunwKtlQ+0wWHCy+V0LeMKLRCIg+dOZnJAPQ/2CZNqmvAkAl2yVT
116+
cwPnOmzyR3Y5HXuuYifNtuTi/4TAlyj9/ZHpI86gszzjoMUY7IxcgY++mfsqz8Gl
117+
LSLTm2fuwOY6hZ7hAkAmww+iGigsQK/qFUenQ1afn9hQxsLrriOgBKNZygqFBHh4
118+
4u6VK3BHZuYEpMcEzY6JSEKxucN7rZ8CulNO9A0w
119+
-----END RSA PRIVATE KEY-----
120+
```
72121

122+
[![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)

index.html

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
animation: pulse 0.5s 1;
2424
}
2525

26+
.pure-form-aligned .pure-control-group label {
27+
width: 13em;
28+
}
29+
2630
@keyframes pulse {
2731
0% {
2832
background-color: rgb(230, 255, 230);
@@ -38,29 +42,47 @@
3842
<body>
3943
<h1 id="test">Settle API PKCS#1 1.5 signature generator</h1>
4044
<div class="pure-form pure-form-aligned">
41-
45+
<p>Is an Integrator acting as a proxy on behalf of a Merchant client?</p>
46+
<div class="pure-u-1-2">
47+
<div class="pure-u-1-8">
48+
<label for="is-integrator-false" class="pure-radio">
49+
<input type="radio" id="is-integrator-false" name="optionsRadios" value="integratorFalse" checked="" onclick="integratorFalse();" /> No
50+
</label>
51+
</div>
52+
<div class="pure-u-1-8">
53+
<label for="is-integrator-true" class="pure-radio">
54+
<input type="radio" id="is-integrator-true" name="optionsRadios" value="integratorTrue" onclick="integratorTrue();" /> Yes
55+
</label>
56+
</div>
57+
</div>
58+
<hr /><br />
4259
<div class="pure-control-group">
43-
<label for="merchant_id">Merchant ID</label>
60+
<label for="merchant_id">X-Auka-Merchant</label>
4461
<input type="text" name="merchant_id" id="merchant_id"></input>
4562
</div>
4663

47-
<div class="pure-control-group">
48-
<label for="api_user">API key ID</label>
64+
<div class="pure-control-group" id="controllGroupApiUser">
65+
<label for="api_user">X-Auka-User</label>
4966
<input type="text" name="api_user" id="api_user"></input>
5067
</div>
5168

69+
<div class="pure-control-group integrator" id="controllGroupIntegrator">
70+
<label for="X_Auka_Integrator">X-Auka-Integrator</label>
71+
<input type="text" name="X_Auka_Integrator" id="X_Auka_Integrator"></input>
72+
</div>
73+
5274
<div class="pure-control-group">
53-
<label for="private_key">Private key</label>
75+
<label for="private_key">Private RSA key</label>
5476
<textarea name="private_key" id="private_key" cols="70" rows="15"></textarea>
5577
</div>
5678

5779
<div class="pure-control-group">
58-
<label for="method">Method</label>
80+
<label for="method">REST API Method</label>
5981
<input type="text" name="method" id="method"></input>
6082
</div>
6183

6284
<div class="pure-control-group">
63-
<label for="url">URL</label>
85+
<label for="url">REST API Endpoint URL</label>
6486
<input class='wide' type="text" name="url" id="url" cols="70"></input>
6587
</div>
6688

0 commit comments

Comments
 (0)