Mobiltek¶
General info¶
Mobiltek subscription payment method allows merchants to utilize functionality provided by Mobiltek payment agent, of recurring payments working in direct billing fashion, without the need to control when a user should renew his subscription. The whole flow is executed through one method exposed by PaySystem service, with one additional method to cancel subscription if it will be necessary due to specific merchant business flow. All consecutive payments, being the result of started subscription, all automatically performed by Mobiltek, and automatically stored and accounted by TMS. The amount of money involved in a subscription and the period between payments need to be configured by Mobiltek, prior to using the service for the first time. Merchant is notified about following events: subscription started, subscription cancelled, successful subscription charge, failed subscription charge.
Mobiltek one time payment method allows merchants to deliver one time payment functionality (pay per event).
Important: Before you’ve started integration with TMS, please contact with USP to configure your services and enviroments.
Setting up - One Time Payment¶
To initialize new Mobiltek Pay Per Event payment you need to send request to PaySystem:
Interface: paysystem.tms.onetapi.pl
Method: 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":"request_1", "method":"set_transaction_sync", "params":{ "trans_ext_id": "cab3131a-dec7-49cc-8607-0121a61d3427", # your id of trans "seller_id": "34801", # your app id "merchant_id": "1", "user_agreements": "2", "invoice_series_id": "1", "payment":{ "channel_id": "18912", # dedicated channel id for your app id "currency": "PLN" }, "articles":[ { "prod_id": "55555", "sap_index": "45000437", "vat_rate": "23", "name": "test product", "quantity": "1", "price": "10" # gross price in pennies } ], "customer":{ "ext_id": "1234qwera", "company": "test", "firstname": "tester", "lastname": "testowski", "email": "tomek@test.pl", "street": "piękna", "city": "krk", "phone": "48501123123", "postcode": "31-620", "country": "PL" }, "client_ip": "127.0.0.1", "test": "False", "next_url": "http://onet.pl" } } |
1 2 3 4 5 6 7 8 9 10 11 | { "jsonrpc": "2.0", "id": "example", "result": { "status": "1", "data": { "redirect_url": "https://pay.mobiltek.pl/ppe?msisdn=48690112325&transaction_id=1000014896266637&service_id=30576&price=0.1&product=P%C5%82atno%C5%9B%C4%87%20w%20serwisie%20Mediaklub&user_ip=127.0.0.1&user_id=&return_url=http%3A%2F%2Fonet.pl&error_url=http%3A%2F%2Fonet.pl&hash=4931ea19dba634294565f8ab9dc844c1f71a58a0828dc89928652ddc91e50da018245f8e45c04abe612fcd042255977da4631e8439afea69462340287ea1f037", "action_type": "REDIRECT_USER" } } } |
Setting up - Subscription¶
To initialize new subscription in Mobiltek system payment you need to send request to set_subscription method. Important is to set proper channel_id, which is dedicated for only one type of subscription.
After the registration process is completed, the user will be charged the amount of the transaction periodically by the operator.
Interface: paysystem.tms.onetapi.pl
Method: set_subscription
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 | { "jsonrpc":"2.0", "id":"example", "method":"set_subscription", "params":{ "trans_ext_id": "cab3131a-dec7-49cc-8607-0121a61d3427", # your id of trans "merchant_id": "34801", # your app_id "invoice_required": false, "payment":{ "channel_id": "18913", # dedicated channel for your type of subscription "currency": "PLN" }, "articles":[ { "prod_id": "55555", "sap_index": "45000437", "vat_rate": "23", "name": "test product", "quantity": "1", "price": "10" } ], "customer":{ "ext_id": "1234qwera", "company": "test", "firstname": "testersu", "lastname": "testowski", "email": "tomek_sync@test.pl", "street": "piękniejsza", "city": "KRK", "phone": "48501123123", "postcode": "31-620", "country": "PL" }, "client_ip": "127.0.0.1", "test": "False", "next_url": "http://onet.pl" } } |
Unsubscribe / cancel subscription¶
To unsubscribe user from existing subscription send request to dedicated method in PaySystem API.
Interface: paysystem.tms.onetapi.pl
Method: unsubscribe
1 2 3 4 5 6 7 8 9 | { "jsonrpc": "2.0", "id": "request2", "method": "unsubscribe", "params": { "order_ext_id": "cab3131a-dec7-49cc-8607-0121a61d3427", "client_ip": "10.0.0.1" } } |
1 2 3 4 5 6 7 8 9 | { "jsonrpc": "2.0", "id": "request2", "result": { "status": 1, "result": "ERROR\n4321:Subscriber not found", "action_type": null } } |
In result field we pass original message received from Mobiltek. If it starts with “OK” and numeric code equals 2302 the process completed successfuly otherwise it means that error occured.
Notifications¶
Merchant can be informed about events happening during subscription lifetime through notifications. The events for which a notification can be sent are:
Subscription start
Successful subscription charge
Failed subscription charge
Subscription cancellation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | { "jsonrpc": "2.0", "id": "1669214883subscription_start", "method": "subscription_start", "params": { "user_id": "<user_id>", "user_email": "<user_email>", "amount": "10", "currency": "PLN", "order_id": "<ext_order_id>", "signature": "<signature>", "additional_data": { "mobiltek_msisdn": "<phone_number>", "mobiltek_operator_id": "<operator_id>", "mobiltek_notification_type": "REGISTRATION" } } } |
If you wish to be notified about certain events, provide us with information about which notifications you want receive, where they should be sent to and how should they be structured.