Skip to content

Latest commit

 

History

History
67 lines (41 loc) · 1.26 KB

README.md

File metadata and controls

67 lines (41 loc) · 1.26 KB

Build Status GitHub Twitter Follow

Python MPG (Mastercard Payment Gateway)

MPG (Mastercard Payment Gateway) formerly MIGS python package to integrate through Virtual Payment Client Integration.

Install

Install with pip:

pip install git+https://git@github.com/glidematrix/python-mpg.git

Initialize

from mpg import Client

merchant_id = 'YOUR MERCHANT ID'
access_code = 'YOUR ACCESS CODE'
secret = 'YOUR SECRET'
currency = 'ZMW' #The currency you want to process


client = Client(
    merchant_id,
    access_code,
    secret,
    currency,
)

2-Party Transactions

payload = {
    'amount': 10,
    'cardnum': '5204740009900014', #Test card number
    'expiry': 2212, #Expiry Year and Month in format 2212
    'csc': 123, #Card Security Code[CVV etc]
}

client.load_card(payload)

res = client.process_card()

print(res)

3-Party Transactions

amount = 10

link = client.payment_link(amount)
print(link)