Skip to main content

Python SDK for Mercury service

Project description

Mercury SDK can be used in projects that interface with the mercury service that provides common internal functionality.

Initializing the client

from mercuryclient import MercuryApi
# Setup connection parameters
conn_params = {'username': 'mercury_username', 'password':'password', 'url':'https://mercury-url.com'}
m = MercuryApi(conn_params)
m.send_mail(['recipent@email.com'],'Test mail', 'Mail body','ses','ses_profile')

Available APIs:

  • send_mail

  • send_sms

  • request_experian_report

  • get_experian_response

  • fetch_experian_report

  • request_cibil_report

  • get_cibil_response

  • fetch_cibil_report

  • request_highmark_report

  • get_highmark_response

  • fetch_highmark_report

  • request_verify_id

  • get_verify_id_result

  • request_bank_statement

  • get_bank_statement_result

  • verify_webhook

  • insurance

  • secure_patyment_recharge
    • get_operators_list

    • make_recharge

    • get_recharge_status

    • get_recharge_wallet_balance

    • get_recharge_ip

    • get_recharge_plans

  • bbps
    • set_agent_on_board

    • get_state

    • get_district_by_state

    • get_bill_categories

    • get_biller_by_categories

    • get_customer_params_by_biller_id

    • get_amount

    • send_bill_payment_request_transid

    • send_bill_payment_request

    • get_duplicate_payment_receipt

    • register_trasaction_complaint

    • register_service_complaint

    • get_complaint_status

    • get_bbpsid

  • verify_bank_account

  • verify_gstin

  • get_verify_gst_result

  • generate_okyc_otp

  • verify_okyc_otp

  • fetch_rc_details

  • verify_udyog_aadhaar

  • fetch_equifax_report

  • generate_liveness_session_id

  • get_liveness_session_result

  • extract_itr_details

  • fetch_itr_report

  • generate_epfo_otp

  • verify_epfo_otp

  • get_epfo_details

  • name_match

  • check_e_sign

  • create_indv_entity

  • create_legal_entity

  • payments
    • generate_qr_code

    • generate_payment_plan

    • create_payment_subscription

    • fetch_subscription

    • generate_payment_link

Types:

For complex requests like CIBIL, Experian or Highmark, you can construct the request JSON using the provided pydantic models. The types are available at mercury.types.<request_type>.request.

Example using models for generating Highmark Request:

from mercuryclient.types.highmark.request import Applicant, HighmarkRequest
applicant = Applicant(name="Example Name" ...)
request_obj = HighmarkRequest(
    applicant=applicant,
    inquiry_reference_number="ABCDE",
    ...
)
# After generating your request, pass the object to the corresponding request
m.fetch_highmark_report(request_obj, profile="sample_profile)

Testing:

Tests are run under tox

You can install tox with

>>> pip install tox

If using pyenv - you can do the following steps before running tox (patch version will depend on your installations - tox only considers the major version)

>>> pyenv local 3.7.3 3.6.8 3.8.1

Without this step - tox will not be able to find the interpreters

Run tests using the following command

>>> tox

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mercuryclient-1.20.0.tar.gz (43.9 kB view details)

Uploaded Source

Built Distribution

mercuryclient-1.20.0-py3-none-any.whl (89.3 kB view details)

Uploaded Python 3

File details

Details for the file mercuryclient-1.20.0.tar.gz.

File metadata

  • Download URL: mercuryclient-1.20.0.tar.gz
  • Upload date:
  • Size: 43.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for mercuryclient-1.20.0.tar.gz
Algorithm Hash digest
SHA256 5380f3d583661341de28c2e52582332573292dd6d7f0c23db15928ab36bf56d5
MD5 390e94de11eb61495603e23a5c363c6f
BLAKE2b-256 236de09ca3c1fd6bf737cd7d8aa80574f72875f5442a1055e0bdd42b08cba370

See more details on using hashes here.

File details

Details for the file mercuryclient-1.20.0-py3-none-any.whl.

File metadata

  • Download URL: mercuryclient-1.20.0-py3-none-any.whl
  • Upload date:
  • Size: 89.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for mercuryclient-1.20.0-py3-none-any.whl
Algorithm Hash digest
SHA256 696c293ec31e56ad1a8e1177e9bd514013df8ca0051b70afcf0d7b30253c1fb9
MD5 1654e84d8b29d250fb35133c39bdfaab
BLAKE2b-256 79537c98ccbea4cb755e98dbb868f9cd4a2f3b131a089c833c50ba37b867c122

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page