Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ipaymu-python-api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipaymu-python-api

Payment Gateway iPaymu Python API

  • 0.0.1
  • PyPI
  • Socket score

Maintainers
1

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 RequestDescriptionTypeMandatory
accountVA NumbernumericY
nameCustomer NamestringY
emailCustomer E-mailstringY
phoneCustomer PhonenumericY
amountTotal Amount (price * qty)numericY
paymentMethodva, banktransfer, cstore, codstringY
paymentChannel

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

"cstore:" indomaret, alfamart

"cod:" rpx
stringY
notifyUrlReturn url when payment successstringY
expiredExpiration in hournumericN
descriptionText descriptionstringN
referenceIdShopping cart order idstringN
productProduct Name[array] stringY
qtyQuantity[array] numericY
priceProduct Price[array] numericY
weightProduct Weight[array] numericY
lengthProduct Length[array] numericY
widthProduct Width[array] numericY
heightProduct Height[array] numericY
deliveryAreaPostal Code CustomernumericY
deliveryAddressCustomer AddressstringY
pickupAreaPostal Code Shipper (Default Merchant Postal Code)numericN
pickupAddressShipper Address (Default Merchant Address)stringN
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);

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc