All Projects → Instamojo → instamojo-py

Instamojo / instamojo-py

Licence: MIT License
Python library for Instamojo API

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to instamojo-py

tapi-yandex-direct
Python библиотека API Яндекс Директ
Stars: ✭ 35 (-10.26%)
Mutual labels:  wrapper
GodaddyWrapper.Net
.Net GoDaddy API Wrapper in C#
Stars: ✭ 15 (-61.54%)
Mutual labels:  wrapper
Jikan4java
Kotlin wrapper for Jikan, an myanimelist api
Stars: ✭ 27 (-30.77%)
Mutual labels:  wrapper
hanami-bootstrap
Bootstrap wrapper for hanami framework.
Stars: ✭ 13 (-66.67%)
Mutual labels:  wrapper
elixir-queue
Queue data structure for Elixir-lang
Stars: ✭ 18 (-53.85%)
Mutual labels:  wrapper
gpgme
GPGme bindings for Rust
Stars: ✭ 55 (+41.03%)
Mutual labels:  wrapper
JirAgileR
User-friendly 🔹JIRA API wrapper. Track projects & issues from within R
Stars: ✭ 22 (-43.59%)
Mutual labels:  wrapper
larafy
Larafy is a Laravel package for Spotify API. It is more like a wrapper for the Spotify API.
Stars: ✭ 53 (+35.9%)
Mutual labels:  wrapper
Dis-Snek
A Python API wrapper for Discord
Stars: ✭ 71 (+82.05%)
Mutual labels:  wrapper
MojangSharp
A C# wrapper library for Mojang API (no longer actively maintained)
Stars: ✭ 38 (-2.56%)
Mutual labels:  wrapper
ffmpeg-progressbar-cli
A colored progress bar for FFmpeg.
Stars: ✭ 140 (+258.97%)
Mutual labels:  wrapper
node-latex
🧾 A utility for running LaTeX subprocesses in Node.
Stars: ✭ 31 (-20.51%)
Mutual labels:  wrapper
Scrython
A python wrapper for the Scryfall API
Stars: ✭ 87 (+123.08%)
Mutual labels:  wrapper
laravel-mjml
Laravel MJML offers support for rendering MJML syntax into in-line HTML that can be sent within mails.
Stars: ✭ 26 (-33.33%)
Mutual labels:  wrapper
deno-keyv
A simple, easy to use key-value database wrapper for Deno
Stars: ✭ 16 (-58.97%)
Mutual labels:  wrapper
hugo-wrapper
The universal way to include Hugo binary to your project.
Stars: ✭ 27 (-30.77%)
Mutual labels:  wrapper
SoundCloud-API
SoundCloud API wrapped into a bunch of classes. Built with Retrofit2 and RxJava2.
Stars: ✭ 63 (+61.54%)
Mutual labels:  wrapper
BootstraPHP
A Bootstrap wrapper for PHP
Stars: ✭ 24 (-38.46%)
Mutual labels:  wrapper
Redshift-Tray
A no-frills GUI for the excellent Redshift, with some optional OS hotkeys
Stars: ✭ 34 (-12.82%)
Mutual labels:  wrapper
acinerella
FFmpeg wrapper library for audio/video decoding
Stars: ✭ 18 (-53.85%)
Mutual labels:  wrapper

Instamojo API

Note: If you're using this wrapper with our sandbox environment https://test.instamojo.com/ then you should pass 'https://test.instamojo.com/api/1.1/' as third argument to the Instamojo class while initializing it. API key and Auth token for the same can be obtained from https://test.instamojo.com/developers/ (Details: Test Or Sandbox Account).

api = Instamojo(api_key=API_KEY, auth_token=AUTH_TOKEN, endpoint='https://test.instamojo.com/api/1.1/');

Installation

pip install instamojo_wrapper

Authentication Keys

You can find your API_KEY and AUTH_TOKEN at the API Documentation Page. Create an account on Instamojo, log in and visit this link: https://www.instamojo.com/developers/

Usage

Create a new Payment Request

from instamojo_wrapper import Instamojo
api = Instamojo(api_key=API_KEY,
                auth_token=AUTH_TOKEN)

# Create a new Payment Request
response = api.payment_request_create(
    amount='3499',
    purpose='FIFA 16',
    send_email=True,
    email="[email protected]",
    redirect_url="http://www.example.com/handle_redirect.py"
    )
# print the long URL of the payment request.
print response['payment_request']['longurl']
# print the unique ID(or payment request ID)
print response['payment_request']['id']

Get the status or details of a Payment Request

from instamojo_wrapper import Instamojo
api = Instamojo(api_key=API_KEY,
                auth_token=AUTH_TOKEN)

# Create a new Payment Request
response = api.payment_request_status('[PAYMENT REQUEST ID]')

print response['payment_request']['shorturl']  # Get the short URL
print response['payment_request']['status']    # Get the current status
print response['payment_request']['payments']  # List of payments

Get the status of a Payment related to a Payment Request

from instamojo_wrapper import Instamojo
api = Instamojo(api_key=API_KEY,
                auth_token=AUTH_TOKEN)

# Create a new Payment Request
response = api.payment_request_payment_status('[PAYMENT REQUEST ID]', '[PAYMENT ID]')

print response['payment_request']['purpose']             # Purpose of Payment Request
print response['payment_request']['payment']['status']   # Payment status

Get a list of Payment Requests

from instamojo_wrapper import Instamojo
api = Instamojo(api_key=API_KEY,
                auth_token=AUTH_TOKEN)

# Create a new Payment Request
response = api.payment_requests_list()

# Loop over all of the payment requests
for payment_request in response['payment_requests']:
    print payment_request['status']

payment_requests_list() also accepts optional arguments like max_created_at, min_created_at, min_modified_at, max_modified_at, page and limit for filtering as well as paginating the reponse.

response = api.payment_requests_list(max_created_at="2015-11-19T10:12:19Z",
                                    min_created_at="2015-10-29T12:51:36Z", page=1, limit=50)

For details related to supported datetime format supported by these arguments check the documentation: https://www.instamojo.com/developers/request-a-payment-api/#toc-filtering-payment-requests

Available Request a Payment Functions

  • payment_request_create(purpose, amount) => Payment Request
  • payment_request_status(id) => Payment Request
  • payment_requests_list() => List of Payment Requests
  • payment_request_payment_status(id, payment_id) => Payment Request with Payment details

Payment Request Creation Parameters

Required

  • purpose: Purpose of the payment request. (max-characters: 30)
  • amount: Amount requested (min-value: 9 ; max-value: 200000)

Optional

  • buyer_name: Name of the payer. (max-characters: 100)
  • email: Email of the payer. (max-characters: 75)
  • phone: Phone number of the payer.
  • send_email: Set this to True if you want to send email to the payer if email is specified. If email is not specified then an error is raised. (default value: False)
  • send_sms: Set this to True if you want to send SMS to the payer if phone is specified. If phone is not specified then an error is raised. (default value: False)
  • redirect_url: set this to a thank-you page on your site. Buyers will be redirected here after successful payment.
  • webhook: set this to a URL that can accept POST requests made by Instamojo server after successful payment.
  • allow_repeated_payments: To disallow multiple successful payments on a Payment Request pass false for this field. If this is set to false then the link is not accessible publicly after first successful payment, though you can still access it using API(default value: True).

Further documentation is available at https://www.instamojo.com/developers/request-a-payment-api/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].