Skip to content

pnp200/mahjson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MahJson SDK for Go language

Package mahjson provides implementation of e-pay POS to Host JSON web services.

Installing

To start using mahjson, install Go and run go get:

$ go get -u github.com/pnp200/mahjson

This will retrieve the library.

Example

package main

import (
	"fmt"
	"github.com/pnp200/mahjson"
)

func main() {
	url := "your test url"
	publicKey := "your assigned public key"
	privateKey := "your private key"

	// Online PIN
	pin, err := mahjson.NewClient(url, publicKey, privateKey)
	if err != nil {
		fmt.Println(err.Error())
		return
	}
	pin.Amount = 5.00
	pin.MerchantID = "201914"
	pin.OperatorID = "SALE"
	pin.TerminalID = "10000494"
	pin.ProductCode = "TUNETALKST"
	pin.TxnTraceID = 118205
	pinResponse, err := pin.OnlinePIN()
	if err != nil {
		fmt.Println(err.Error())
	}
	fmt.Println(pinResponse)
}

Implement methods

Documentation

Documentation