Blik Oneclick

Provider: PayU

Introduction

Pay and register token FLOW

../../../../_images/blik-oneclick1.png

Pay with blik oneclick token FLOW

../../../../_images/blik-oneclick2.png

Pay with blik oneclick token - token ambiguity FLOW

../../../../_images/blik-oneclick3.png

Generating a transaction

The merchant generates a request for set_transaction. In the payment section, the aa_id is set to the ID of the blik oneclick register channel. This channel ID is provided by USP team. Creating the transaction is asynchronous, and after sending the set_transaction request there is only returned a status if the request has been accepted or not. If the request is accepted, the transaction is processed.

Customer ext_id and email are required to properly create blik token. The same data should be used to register token, and to use this token. If there will be any difference token will be invalid.

Example set_transaction request to create blik oneclick transaction
1
2
3
4
5
6
7
8
"payment":{
    "channel_id": "<blik-oneclick-register-paychannel-id>",
    "amount": "0",
    "currency": "PLN"
    "config": {
         "blik_code": <blik-t6-code>
     },
},

Notification

After the transaction is processing it can be checked if the payment has been prepared using the method get_action_and_data.

If payment will be completed paysystem will send notification to the merchant with the status of payment and blik token.

TODO Example of notification.

Merchant should save token on his side, and use it in a further transactions for this client.

Generating a transaction with saved blik token

The merchant generates a request for set_transaction. In the payment section the aa_id is set to the ID of the blik oneclick payment channel (it is diffrent then blik oneclick register channel!). This channel ID is provided by USP team.

Customer ext_id and email are required to properly use blik token.

Example payment object for set_transaction request to create transaction with saved blik token
1
2
3
4
5
6
7
8
     "payment":{
        "channel_id": <blik-oneclick-payment-paychannel-id>,
        "amount": "0",
        "currency": "PLN"
        "config": {
             "blik_token": <blik-token>
         },
    },

Token ambiguity

If blik user has configured blik service in a couple of bank’s, and save token in more then one bank, token ambiguity issue will appear. This means that using just blik token, payment Agent have not enough information to charge user bank account.

If this situation will appear, function get_action_and_data will return information that transaction can’t be processed successfully, and information about application alternatives (user application in different bank’s).

Alternative apps data format:

"alternatives":[
    {
        "appKey":"alternative key",
        "appLabel":"alternative label"
    }
]

Then merchant should ask the user to choose one of the applications, then create a new transaction with additional info about the application in blik_app_key field (in get_action_and_data data format it appear at appKey).

Example payment object for set_transaction request to create transaction with non ambiguous token
1
2
3
4
5
6
7
8
9
 "payment":{
    "channel_id": <blik-oneclick-payment-paychannel-id>,
    "amount": "0",
    "currency": "PLN"
    "config": {
         "blik_token": <blik-token>,
         "blik_app_key": <blik-app-key>
     },
},

Error Massages and Exceptions

  • User token is invalid (ex. token has expired)

  • User T6 code is invalid

  • User don’t have funds

  • User don’t accept payment