Skip to main content

Payment Gateway iPaymu Python API

Project description

Usage

Requirement

First, get your apikey & va number from iPaymu dashboard.

Install requirements:

pip install requirements.txt

Initialization

from ipaymu import Main

api_key = 'your-apikey'
va = 'your-va'
production = true

ipaymu = Main(api_key, va, production)

General

Check Balance

ipaymu.check_balance()

Check Transaction

Param: Transaction ID

status = ipaymu.check_transaction(id)

Set URL

url = {
    ureturn: "your-return-url",
    ucancel: "your-cancel-url",
    unotify: "your-notify-url",
}

ipaymu.set_url(url)

Set Buyer

buyer = {
    name: "buyer name",
    email: "buyer email",
    phone: "buyer phone",
}

ipaymu.set_buyer(buyer)

Payment

There are 2 payment methods: Payment Direct & Payment Redirect, with the following parameters:

paymentMethod
  • va => Virtual Account
  • banktransfer => Transfer Bank
  • cstore => Convenience Store
  • cod => Cash on Delivery

paymentChannel

va
  • bag => Bank Artha Graha
  • bni => Bank Negara Indonesia
  • cimb => Bank Cimb Niaga
  • mandiri => Bank Mandiri
  • bri => Bank BRI
  • bca => Bank BCA
banktransfer
  • bca => Bank Central Asia
cstore
  • indomaret
  • alfamart
cod
  • rpx

Paramaters

Parameter Request Description Type Mandatory
account VA Number numeric Y
name Customer Name string Y
email Customer E-mail string Y
phone Customer Phone numeric Y
amount Total Amount (price * qty) numeric Y
paymentMethod va, banktransfer, cstore, cod string Y
paymentChannel

"va:" bag, bni, cimb, mandiri, bri, bca

"cstore:" indomaret, alfamart

"cod:" rpx
string Y
notifyUrl Return url when payment success string Y
expired Expiration in hour numeric N
description Text description string N
referenceId Shopping cart order id string N
product Product Name [array] string Y
qty Quantity [array] numeric Y
price Product Price [array] numeric Y
weight Product Weight [array] numeric Y
length Product Length [array] numeric Y
width Product Width [array] numeric Y
height Product Height [array] numeric Y
deliveryArea Postal Code Customer numeric Y
deliveryAddress Customer Address string Y
pickupArea Postal Code Shipper (Default Merchant Postal Code) numeric N
pickupAddress Shipper Address (Default Merchant Address) string N

Add Product to Cart

First, please add product to shopping cart first before using this method

data = {
    'product': ['product 1 ', 'product2 '],
    'quantity': ['1', '2'],
    'price': ['10000', '50000'],
    'description': ['product-desc', 'product-desc 2'],
    'weight': [1, 2],       # nullable (kilogram)
    'height': [10, 10],     
    'length': [30, 40],     
    'width': [10, 50],      
}

ipaymu.add_cart(data)

# assign cart to var
cart = ipaymu.carts

IMPORTANT: The height, length, width attribute must be filled with the same dimension of array. If the one of items hasn't one of those attribute fill with 0 (zero)

Set COD (Only if COD method)

$delivery = $iPaymu->setCOD([
        'deliveryArea' => "76111",
        'deliveryAddress' => "Denpasar",
]);

Payment Direct

Payment direct method allows you to accept payment on your checkout page directly, this method works for any payment channel except for credit card.

$payment = $iPaymu->directPayment($directData);

Payment Redirect

In order accepting credit card, you must use Payment Redirect method. Upon checkout, you will be redirected to iPaymu.com payment page for further payment processing.

$payment = $iPaymu->redirectPayment($redirectData);

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

ipaymu-python-api-0.0.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ipaymu_python_api-0.0.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file ipaymu-python-api-0.0.1.tar.gz.

File metadata

  • Download URL: ipaymu-python-api-0.0.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.9

File hashes

Hashes for ipaymu-python-api-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b4298763217f40dfd07f069841d20820d93607bd7f72a3a0d80a69e8bf87925c
MD5 9312506976b23109a5d76f862fc46305
BLAKE2b-256 f1546a309a61339eb4ec3005eac9fb3762d8de989c5de0486af476b628fe23a2

See more details on using hashes here.

File details

Details for the file ipaymu_python_api-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ipaymu_python_api-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e0e77a0b6b3edaf0d1e9fd33d99833ec355baca211b7e19049cf07dabc8f9293
MD5 f5820a4bcf4be33909801eb0c657aa5e
BLAKE2b-256 a55eca9acab795bdc03f4db5dca02388d64e4b17d75017bf45d7eb6a6320c610

See more details on using hashes here.

Supported by

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