PayGateway - frequently asked questions

How to get started?

If you would like to use the PayGateway module, please contact the USP team usp@lst.onet.pl.

What libraries do you recommend for token encryption?

How to encode the payload?

This examples show how to create JWE token in Python and javascript.

JWE token with jwcrypto example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from jwcrypto import jwk, jwe
from jwcrypto.common import json_encode

DATA = {
    "trans_ext_id": "jwe_trans_test_1",
    "is_subscription": False,
    "invoice_required": True,
    "payment": {
        "channel_id": "",
        "amount": "10",
        "currency": "PLN"
    },
    "articles": [
        {
            "prod_id": "55555",
            "sap_index": "45000434",
            "vat_rate": "23",
            "name": "Product's name",
            "quantity": "1",
            "price": "10",
            "config": [
                {"name": "conf_name", "value": "conf_value"}
            ]
        }
    ],
    "customer": {
        "ext_id": "1234qwera",
        "company": "test",
        "firstname": "Jan",
        "lastname": "Kowalski",
        "email": "jan@kowalski.pl",
        "street": "Nowa",
        "city": "Kraków",
        "phone": "48123456789",
        "postcode": "31-620",
        "country": "PL",
    },
    "next_url": "http://onet.pl",
    "config": {},
    "locale": "pl",
    "extras": {}

}

SECRET = "qblugBqpzcAj6L07qw56uHlJYCLlYhQ!"

keyBase64Bytes = base64.urlsafe_b64encode(SECRET.encode("utf-8"))
keyBase64Str = str(keyBase64Bytes, "utf-8")

jwk_key_data = {
    "k": keyBase64Str,
    "kty": "oct"
}

data_json = json.dumps(DATA, separators=(",", ":")).encode("utf-8")

jwe_key = jwk.JWK.from_json(json.dumps(jwk_key_data))
jwe_token = jwe.JWE(data_json,
                    json_encode({"alg": "A256KW",
                                "enc": "A256CBC-HS512"}))
jwe_token.add_recipient(jwe_key)
enc = jwe_token.serialize(compact=True)

print(enc)
JWE token with jwcrypto example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import { CompactEncrypt } from 'jose';
import { PaymentPayload } from 'types/commonTypes.d';

export const encryptPayload = (payload: Partial<PaymentPayload>, secretKey: string): Promise<string> =>
new CompactEncrypt(new TextEncoder().encode(JSON.stringify(payload)))
    .setProtectedHeader({
    alg: 'A256KW',
    enc: 'A256CBC-HS512',
    })
    .encrypt(Buffer.from(secretKey, 'utf8'));

Is it possible to receive additional information in the notifications?

Yes. In the standard TMS configuration, it sends the following notifications Notifications If you need additional data in this notifications or a new type of notification, please contact the USP team.

How does PayGateway support recurring payments / subscriptions?

As part of PayGateway, a new subscription module has been created, allowing for organized handling of recurring payments. If you sell recurring services such as monthly subscriptions, this module will allow you to group successive payments for renewals within one subscription. If you would like to obtain more information, please contact the USP team at usp@lst.onet.pl.

Does PayGateway integrate with Onet Konto / Account?

Yes. PayGateway allows for integration of TMS with Onet Account. Thanks to such integration in the Onet Account dashboard, the user has the ability to:

  • manage credit cards

  • view subscription information

  • and much more (in the future)

Is it possible to customize the appearance of PayGateway?

Yes, it is possible. For details, please contact us.