Obtain MID and TID programmatically

Hello,

When i go to configuration -> payment, i see two fields MID and TID.
How can I obtain this data programmatically?
I don’t figure out because I implemented many services but can’t find this fields.

Thanks