Getting started

Contents

Before you start you have to contact with USP Team to configure your account.

After successful configuration you will receive:

  • merchant_id / seller_id - your ID in TMS system

  • list of agent_id’s - list of payment operators eg. PayU

  • list of payment channels

Requirements

Set up an API for notifications (which is described here - Notifications) and send to us an Endpoint Address - this is mandatory requirement

Any product that the merchant wants to sell has to be registered by Accounting Department in order to receive the material index for it. The product together with its material index has to be added in our system to enable the start of its sale.

Tutorial

Step 1 - Send set_transaction_sync request to pay-system’s endpoint

To initiate the transaction, send a JSON-RPC request to our API

API address: https://paysystem.tms.onetapi.pl

Method: set_transaction_sync

Example request to set_transaction_sync
 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
{
    "jsonrpc":"2.0",
    "id":"<id_of_request>",
    "method":"set_transaction_sync",
    "params":{
        "trans_ext_id": "<your_id_of_transaction>",
        "seller_id": "<your_merchant_id>",
        "merchant_id": "1",
        "user_agreements": "2",
        "invoice_series_id": "1",
        "payment":{
            "channel_id": "<channel_id>",
            "currency": "PLN"
        },
        "articles":[
            {
                "prod_id": "<product_id>",
                "sap_index": "<sap_material_index_for_product>",
                "vat_rate": "23",
                "name": "test product",
                "quantity": "1",
                "price": "<product_price>"
            }
        ],
        "customer": {
            "ext_id": "1234qwera",
            "company": "test",
            "firstname": "tester",
            "lastname": "testowski",
            "email": "test_user@test.pl",
            "street": "Długa",
            "city": "KRK",
            "phone": "4851035122",
            "postcode": "31-620",
            "country": "PL"
        },
        "client_ip": "127.0.0.1",
        "test": "True",
        "next_url": "https://onet.pl"
    }
}

Then you should get an answer similar to the one below:

Example response from set_transaction_sync
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
  "jsonrpc": "2.0",
  "id": "<id_of_request>",
  "result": {
    "status": "1",
    "data": {
      "redirect_url": "https://merch-prod.snd.payu.com/pay/?orderId=H64PMLV1K2220408GUEST000P01&token=eyJhbGciOiJIUzI1NiJ9.eyJvcmRlcklkIjoiSDY0UE1MVjFLMjIyMDQwOEdVRVNUMDAwUDAxIiwicG9zSWQiOiJxR3M5QUdVZyIsImF1dGhvcml0aWVzIjpbIlJPTEVfQ0xJRU5UIl0sInBheWVyRW1haWwiOiJ0b21la19zeW5jQHRlc3QucGwiLCJleHAiOjE2NDk0OTkxNzgsImlzcyI6IlBBWVUiLCJhdWQiOiJhcGktZ2F0ZXdheSIsInN1YiI6IlBheVUgc3ViamVjdCIsImp0aSI6ImUxMDA2NGQ3LTE4N2QtNDUwMi05MDU2LTc5NmEyN2JmZTVhNiJ9.Fl3NzUUwPMytH7JJX6b2c1fG6CuuEmxDiWMr1Suq0uM",
      "action_type": "REDIRECT_USER"
    }
  }
}

Step 2 - Redirect user to returned url

In this step you should redirect user to url, which was returned in “redirect_url” in Step 1.

Step 3 - User completes a transaction on the bank’s side

In this step user completes the transaction on the bank’s supplier’s side.

Step 4 - User returns to shop

In this step user will be redirected to url in your shop.

Step 5 - Shop handles notification from TMS

Your shop receives a notification from TMS about transaction’s status.

Learn more

Now that the reader has completed your tutorial, they’ll want to learn more.

Now, when you already know how to use X, read about more advanced Topics or learn with How-to guides.