mpesa

package module
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 16 Imported by: 0

README

Mpesa

Mpesa for Mpesa

made-with-Go GitHub go.mod Go version of a Go module GoDoc reference example

Golang bindings for the Mpesa Payment API. Make your MPESA payments Ready... To... Gooo! (pun intended). Made with love for gophers.

Features

  • Customer to Business (C2B) Single Payment
  • Business to Business (B2B)
  • Business to Customer (B2C)
  • Payment Reversal
  • Query Transaction status
  • Query Beneficiary Name
  • Query Direct Debit
  • Direct Debit Create
  • Direct Debit Payment

Pre-requisites

Installation

Simply install with the go get command:

go get github.com/Golang-Tanzania/mpesa

Then import it to your main package as:

package main

import (
	mpesa "github.com/Golang-Tanzania/mpesa
)

Usage

   // NewClient returns new Client struct
   client, err := mpesa.NewClient("your-api-key", mpesa.Sandbox, 24)
   // "your-api-key" obtained at https://openapiportal.m-pesa.com
   // sandbox is environment type can either be mpesa.Sandbox or mpesa.Production
   // 24 represent hours, its session lifetime before we request another session it can be found in the 
   // https://openapiportal.m-pesa.com/applications where you set for your application,



   // use custom htttp client

   c :=  http.Client{
	      Timeout: 50 * time.Second,
	},

   client.SetHttpClient(c)

Examples

Below are examples on how to make different transactions.

Customer To Business
package main

import (
	"context"
	"fmt"
	"net/http"
	"time"

	"github.com/Golang-Tanzania/mpesa"
)

func main() {

    client, err := mpesa.NewClient("your-api-key", mpesa.Sandbox, 24) 
	if err != nil {
		panic(err)
	}

	a := mpesa.C2BPaymentRequest{
		Amount:                   "100",
		CustomerMSISDN:           "000000000001",
		Country:                  "TZN",
		Currency:                 "TZS",
		ServiceProviderCode:      "000000",
		TransactionReference:     "T12344C",
		ThirdPartyConversationID: "asv02e5958774f7ba228d83d0d689761",
		PurchasedItemsDesc:       "Test",
	}
	res, err := client.C2BPayment(context.Background(), a)

	if err != nil {
		fmt.Println(err)
	}

	fmt.Println("res", res)
}
Business To Customer
package main

import (
	"context"
	"fmt"
	"net/http"
	"time"

	"github.com/Golang-Tanzania/mpesa"
)

func main() {

	client, err := mpesa.NewClient("your-api-key", mpesa.Sandbox, 24) 
	if err != nil {
		panic(err)
	}

	c := mpesa.B2CPaymentRequest{
		Amount:                   "100",
		CustomerMSISDN:           "000000000001",
		Country:                  "TZN",
		Currency:                 "TZS",
		ServiceProviderCode:      "000000",
		TransactionReference:     "T12344C",
		ThirdPartyConversationID: "asv02e5958774f7ba228d83d0d689761",
		PaymentItemsDesc:       "Test",
	}

	res, err := client.B2CPayment(context.Background(), c)

	if err != nil {
		fmt.Println(err)
	}

	fmt.Println("res", res)

}

Business To Business
package main

import (
	"context"
	"fmt"
	"net/http"
	"time"

	"github.com/Golang-Tanzania/mpesa"
)

func main() {

	client, err := mpesa.NewClient("your-api-key", mpesa.Sandbox, 24) 
	if err != nil {
		panic(err)
	}


	b := mpesa.B2BPaymentRequest{
		Amount:            "100",
		Country:           "TZN",
		Currency:          "TZS",
		PrimaryPartyCode: "000000",
		ReceiverPartyCode: "000001",
		ThirdPartyConversationID: "8a89835c71f15e99396",
		TransactionReference: "T12344C",
		PurchasedItemsDesc: "Test",
	}

	res, err := client.B2BPayment(context.Background(), b)

	if err != nil {
		fmt.Println(err)
	}

	fmt.Println("res", res)
}
Payment Reversal
package main

import (
	"context"
	"fmt"
	"net/http"
	"time"

	"github.com/Golang-Tanzania/mpesa"
)

func main() {

	client, err := mpesa.NewClient("your-api-key", mpesa.Sandbox, 24) 
	if err != nil {
		panic(err)
	}


	d :=  mpesa.ReversalRequest{
		TransactionID: "0000000000001",
		Country: "TZN",
		ServiceProviderCode: "000000",
		ReversalAmount: "100",
		ThirdPartyConversationID: "asv02e5958774f7ba228d83d0d689761",
	}

	res, err := client.Reversal(context.Background(), d)

	if err != nil {
		fmt.Println(err)
	}

	fmt.Println("res", res)
}
Query Transaction status
package main

import (
	"context"
	"fmt"
	"net/http"
	"time"

	"github.com/Golang-Tanzania/mpesa"
)

func main() {
	
	client, err := mpesa.NewClient("your-api-key", mpesa.Sandbox, 24) 
	if err != nil {
		panic(err)
	}


	e := mpesa.QueryTxStatusRequest{
		QueryReference:           "000000000000000000001",
		Country:                  "TZN",
		ServiceProviderCode:      "000000",
		ThirdPartyConversationID: "asv02e5958774f7ba228d83d0d689761",
	}

	res, err := client.QueryTxStatus(context.Background(), e)

	if err != nil {
		fmt.Println(err)
	}

	fmt.Println("res", res)
}
Query Beneficiary Name
package main

import (
	"context"
	"fmt"
	"net/http"
	"time"

	"github.com/Golang-Tanzania/mpesa"
)

func main() {
	
	client, err := mpesa.NewClient("your-api-key", mpesa.Sandbox, 24) 
	if err != nil {
		panic(err)
	}


	h := mpesa.QueryBenRequest{
		Country:                  "TZN",
		ServiceProviderCode:      "000000",
		ThirdPartyConversationID: "AAA6d1f939c1005v2de053v4912jbasdj1j2kk",
		CustomerMSISDN:           "000000000001",
		KycQueryType:             "Name",
	}

	res, err := client.QueryBeneficiaryName(context.Background(), h)

	if err != nil {
		fmt.Println(err)
	}

	fmt.Println("res", res)
}
Query Direct Debit
package main

import (
	"context"
	"fmt"
	"net/http"
	"time"

	"github.com/Golang-Tanzania/mpesa"
)

func main() {
	
	client, err := mpesa.NewClient("your-api-key", mpesa.Sandbox, 24) 
	if err != nil {
		panic(err)
	}


	i := mpesa.QueryDirectDBReq{
		QueryBalanceAmount:       true,
		BalanceAmount:            "100",
		Country:                  "TZN",
		CustomerMSISDN:           "255744553111",
		MsisdnToken:              "cvgwUBZ3lAO9ivwhWAFeng==",
		ServiceProviderCode:      "112244",
		ThirdPartyConversationID: "GPO3051656128",
		ThirdPartyReference:      "Test123",
		MandateID:                "15045",
		Currency:                 "TZS",
	}

	res, err := client.QueryDirectDebit(context.Background(), i)

	if err != nil {
		fmt.Println(err)
	}

	fmt.Println("res", res)
}
Direct Debit Create
package main

import (
	"context"
	"fmt"
	"net/http"
	"time"

	"github.com/Golang-Tanzania/mpesa"
)

func main() {
	
	client, err := mpesa.NewClient("your-api-key", mpesa.Sandbox, 24) 
	if err != nil {
		panic(err)
	}


	f := mpesa.DirectDBCreateReq{
		CustomerMSISDN:         "000000000001",
		Country:                "TZN",
		ServiceProviderCode:    "000000",
		ThirdPartyReference:    "3333",
		ThirdPartyConversationID: "asv02e5958774f7ba228d83d0d689761",
		AgreedTC:               "1",
		FirstPaymentDate:       "20160324",
		Frequency:              "06",
		StartRangeOfDays:       "01",
		EndRangeOfDays:         "22",
		ExpiryDate:             "20161126",
	}

	res, err := client.DirectDebitCreate(context.Background(), f)

	if err != nil {
		fmt.Println(err)
	}

	fmt.Println("res", res)
}
Direct Debit Payment
package main

import (
	"context"
	"fmt"
	"net/http"
	"time"

	"github.com/Golang-Tanzania/mpesa"
)

func main() {

	client, err := mpesa.NewClient("your-api-key", mpesa.Sandbox, 24) 
	if err != nil {
		panic(err)
	}


	g := mpesa.DebitDBPaymentReq{
		MsisdnToken:              "AbCd123=",
		CustomerMSISDN:           "000000000001",
		Country:                  "TZN",
		ServiceProviderCode:      "000000",
		ThirdPartyReference:      "5db410b459bd433ca8e5",
		ThirdPartyConversationID: "AAA6d1f939c1005v2de053v4912jbasdj1j2kk",
		Amount:                   "10",
		Currency:                 "TZS",
		MandateID:                "15045",
	}

	res, err := client.DirectDebitPayment(context.Background(), g)

	if err != nil {
		fmt.Println(err)
	}

	fmt.Println("res", res)
}
Cancel Direct Debit
package main

import (
	"context"
	"fmt"
	"net/http"
	"time"

	"github.com/Golang-Tanzania/mpesa"
)

func main() {

    client, err := mpesa.NewClient("your-api-key", mpesa.Sandbox, 24) 
	if err != nil {
		panic(err)
	}


	j := mpesa.CancelDirectDBReq{
		MsisdnToken:              "cvgwUBZ3lAO9ivwhWAFeng==",
		CustomerMSISDN:           "000000000001",
		Country:                  "TZN",
		ServiceProviderCode:      "000000",
		ThirdPartyReference:      "00000000000000000001",
		ThirdPartyConversationID: "AAA6d1f939c1005v2de053v4912jbasdj1j2kk",
		MandateID:                "15045",
	}

	res, err := client.CancelDirectDebit(context.Background(), j)

	if err != nil {
		fmt.Println(err)
	}

	fmt.Println("res", res)
}

Authors

This package is authored and maintained by Hopertz and Mojo. A list of all other contributors can be found here.

Contributing

Contributions are welcome. Please open an issue or submit a pull request.

License

MIT License

Copyright (c) 2023 Golang Tanzania

Documentation

Index

Constants

View Source
const (
	Address                         = "openapi.m-pesa.com"
	Ssl                             = true
	Port                            = 443
	ProdEndpoint                    = "/openapi/ipg/v2/vodacomTZN/"
	SandboxEndpoint                 = "/sandbox/ipg/v2/vodacomTZN/"
	SessionEndPath                  = "getSession"
	C2BPaymentPath                  = "c2bPayment/singleStage"
	B2BPaymentPath                  = "b2bPayment"
	B2CPaymentPath                  = "b2cPayment"
	ReversalPath                    = "reversal"
	QueryTxStatusPath               = "queryTransactionStatus"
	DirectDebitPath                 = "directDebitCreation"
	DebitDBPaymentPath              = "directDebitPayment"
	QueryBeneficialPath             = "queryBeneficiaryName"
	QueryDirectDBPath               = "queryDirectDebit"
	CancelDirectDBPath              = "directDebitCancel"
	SandboxPublicKey                = "" /* 736-byte string literal not displayed */
	OpenapiPublicKey                = "" /* 736-byte string literal not displayed */
	ReqNewSessionKeyBeforeExpiresIn = time.Duration(60) * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type B2BPaymentRequest

type B2BPaymentRequest struct {
	Amount                   string `json:"input_Amount"`
	ReceiverPartyCode        string `json:"input_ReceiverPartyCode"`
	Country                  string `json:"input_Country"`
	Currency                 string `json:"input_Currency"`
	PrimaryPartyCode         string `json:"input_PrimaryPartyCode"`
	TransactionReference     string `json:"input_TransactionReference"`
	ThirdPartyConversationID string `json:"input_ThirdPartyConversationID"`
	PurchasedItemsDesc       string `json:"input_PurchasedItemsDesc"`
}

type B2BPaymentResponse

type B2BPaymentResponse struct {
	ResponseCode             string `json:"output_ResponseCode"`
	ResponseDesc             string `json:"output_ResponseDesc"`
	TransactionID            string `json:"output_TransactionID"`
	ConversationID           string `json:"output_ConversationID"`
	ThirdPartyConversationID string `json:"output_ThirdPartyConversationID"`
}

type B2CPaymentRequest

type B2CPaymentRequest struct {
	Amount                   string `json:"input_Amount"`
	CustomerMSISDN           string `json:"input_CustomerMSISDN"`
	Country                  string `json:"input_Country"`
	Currency                 string `json:"input_Currency"`
	ServiceProviderCode      string `json:"input_ServiceProviderCode"`
	TransactionReference     string `json:"input_TransactionReference"`
	ThirdPartyConversationID string `json:"input_ThirdPartyConversationID"`
	PaymentItemsDesc         string `json:"input_PaymentItemsDesc"`
}

type B2CPaymentResponse

type B2CPaymentResponse struct {
	ResponseCode             string `json:"output_ResponseCode"`
	ResponseDesc             string `json:"output_ResponseDesc"`
	TransactionID            string `json:"output_TransactionID"`
	ConversationID           string `json:"output_ConversationID"`
	ThirdPartyConversationID string `json:"output_ThirdPartyConversationID"`
}

type C2BPaymentRequest

type C2BPaymentRequest struct {
	Amount                   string `json:"input_Amount"`
	CustomerMSISDN           string `json:"input_CustomerMSISDN"`
	Country                  string `json:"input_Country"`
	Currency                 string `json:"input_Currency"`
	ServiceProviderCode      string `json:"input_ServiceProviderCode"`
	TransactionReference     string `json:"input_TransactionReference"`
	ThirdPartyConversationID string `json:"input_ThirdPartyConversationID"`
	PurchasedItemsDesc       string `json:"input_PurchasedItemsDesc"`
}

type C2BPaymentResponse

type C2BPaymentResponse struct {
	ResponseCode             string `json:"output_ResponseCode"`
	ResponseDesc             string `json:"output_ResponseDesc"`
	TransactionID            string `json:"output_TransactionID"`
	ConversationID           string `json:"output_ConversationID"`
	ThirdPartyConversationID string `json:"output_ThirdPartyConversationID"`
}

type CancelDirectDBReq

type CancelDirectDBReq struct {
	MsisdnToken              string `json:"input_MsisdnToken"`
	CustomerMSISDN           string `json:"input_CustomerMSISDN"`
	Country                  string `json:"input_Country"`
	ServiceProviderCode      string `json:"input_ServiceProviderCode"`
	ThirdPartyReference      string `json:"input_ThirdPartyReference"`
	ThirdPartyConversationID string `json:"input_ThirdPartyConversationID"`
	MandateID                string `json:"input_MandateID"`
}

type CancelDirectDBRes

type CancelDirectDBRes struct {
	ResponseCode             string `json:"output_ResponseCode"`
	ResponseDesc             string `json:"output_ResponseDesc"`
	TransactionReference     string `json:"output_TransactionReference"`
	MsisdnToken              string `json:"output_MsisdnToken"`
	ConversationID           string `json:"output_ConversationID"`
	ThirdPartyConversationID string `json:"output_ThirdPartyConversationID"`
}

type Client

type Client struct {
	Client      *http.Client
	Keys        *Keys
	Environment Env
	SessionKey  string
	ExpiresAt   time.Time
	SessionLife int32
	// contains filtered or unexported fields
}

func NewClient added in v0.1.8

func NewClient(api_key string, envtype Env, sessionLife int32) (*Client, error)

NewClient returns new Client struct

func (*Client) B2BPayment

func (c *Client) B2BPayment(ctx context.Context, payload B2BPaymentRequest) (*B2BPaymentResponse, error)

A method to perform Business to Business transactions. It accepts B2bPaymentRequest payload as a parameter. It returns the B2BPaymentResponse as a pointer struct.

func (*Client) B2CPayment

func (c *Client) B2CPayment(ctx context.Context, payload B2CPaymentRequest) (*B2CPaymentResponse, error)

A method to perform Business to Customer transactions. It accepts B2CPaymentRequest payload as a parameter. It returns the B2CPaymentResponse as a pointer struct.

func (*Client) C2BPayment

func (c *Client) C2BPayment(ctx context.Context, payload C2BPaymentRequest) (*C2BPaymentResponse, error)

A method to perform Customer to Business transactions. It accepts C2BPaymentRequest request payload parameter. It returns the C2BPaymentResponse as a pointer struct.

func (*Client) CancelDirectDebit

func (c *Client) CancelDirectDebit(ctx context.Context, payload CancelDirectDBReq) (*CancelDirectDBRes, error)

Cancels a Direct Debit mandate

func (*Client) DirectDebitCreate

func (c *Client) DirectDebitCreate(ctx context.Context, payload DirectDBCreateReq) (*DirectDBCreateRes, error)

Direct Debit Create Mandate

func (*Client) DirectDebitPayment

func (c *Client) DirectDebitPayment(ctx context.Context, payload DebitDBPaymentReq) (*DebitDBPaymentRes, error)

Direct Debit Payment

func (*Client) NewReqWithQueryParams

func (c *Client) NewReqWithQueryParams(ctx context.Context, method, baseUrl string, payload interface{}) (*http.Request, error)

NewReqWithQueryParams constructs a request with query params

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, url string, payload interface{}) (*http.Request, error)

NewRequest constructs a request Convert payload to a JSON

func (*Client) QueryBeneficiaryName

func (c *Client) QueryBeneficiaryName(ctx context.Context, payload QueryBenRequest) (*QueryBenResponse, error)

Query the beneficiary's name

func (*Client) QueryDirectDebit

func (c *Client) QueryDirectDebit(ctx context.Context, payload QueryDirectDBReq) (*QueryDirectDBRes, error)

Query the Direct Debit status

func (*Client) QueryTxStatus

func (c *Client) QueryTxStatus(ctx context.Context, payload QueryTxStatusRequest) (*QueryTxStatusResponse, error)

A method to query a trasaction status. It accepts QueryTxStatusRequest payload as a parameter. It returns QueryTxStatusResponse as a pointer struct.

func (*Client) QueryValuesFromStruct

func (c *Client) QueryValuesFromStruct(payload interface{}) (url.Values, error)

QueryValuesFromStruct converts a struct to url.Values

func (*Client) Reversal

func (c *Client) Reversal(ctx context.Context, payload ReversalRequest) (*ReversalResponse, error)

A method to Perform a reversal on a transaction. It accepts ReversalRequest payload as a parameter. It returns the ReversalResponse as a pointer struct.

func (*Client) Send

func (c *Client) Send(req *http.Request, v interface{}, e interface{}) error

Send makes a request to the API, the response body will be unmarshalled into v, or if v is an io.Writer, the response will be written to it without decoding

func (*Client) SendWithAuth

func (c *Client) SendWithAuth(req *http.Request, v interface{}, e interface{}) error

SendWithAuth makes a request to the API and apply authentication automatically.

func (*Client) SendWithSessionKey

func (c *Client) SendWithSessionKey(req *http.Request, v interface{}, e interface{}) error

SendWithSessionKey makes a request to the API using generated sessionkey as bearer token.

func (*Client) SetHttpClient

func (c *Client) SetHttpClient(client *http.Client)

SetHTTPClient sets *http.Client to current client

type DebitDBPaymentReq

type DebitDBPaymentReq struct {
	MsisdnToken              string `json:"input_MsisdnToken,omitempty"`
	CustomerMSISDN           string `json:"input_CustomerMSISDN,omitempty"`
	Country                  string `json:"input_Country"`
	ServiceProviderCode      string `json:"input_ServiceProviderCode"`
	ThirdPartyReference      string `json:"input_ThirdPartyReference"`
	ThirdPartyConversationID string `json:"input_ThirdPartyConversationID"`
	Amount                   string `json:"input_Amount"`
	Currency                 string `json:"input_Currency"`
	MandateID                string `json:"input_MandateID,omitempty"`
}

type DebitDBPaymentRes

type DebitDBPaymentRes struct {
	ResponseCode             string `json:"output_ResponseCode"`
	ResponseDesc             string `json:"output_ResponseDesc"`
	TransactionID            string `json:"output_TransactionID"`
	MsisdnToken              string `json:"output_MsisdnToken,omitempty"`
	ConversationID           string `json:"output_ConversationID"`
	ThirdPartyConversationID string `json:"output_ThirdPartyConversationID,omitempty"`
}

type DirectDBCreateReq

type DirectDBCreateReq struct {
	CustomerMSISDN           string `json:"input_CustomerMSISDN"`
	Country                  string `json:"input_Country"`
	ServiceProviderCode      string `json:"input_ServiceProviderCode"`
	ThirdPartyReference      string `json:"input_ThirdPartyReference"`
	ThirdPartyConversationID string `json:"input_ThirdPartyConversationID"`
	AgreedTC                 string `json:"input_AgreedTC"`
	FirstPaymentDate         string `json:"input_FirstPaymentDate,omitempty"`
	Frequency                string `json:"input_Frequency,omitempty"`
	StartRangeOfDays         string `json:"input_StartRangeOfDays,omitempty"`
	EndRangeOfDays           string `json:"input_EndRangeOfDays,omitempty"`
	ExpiryDate               string `json:"input_ExpiryDate,omitempty"`
}

type DirectDBCreateRes

type DirectDBCreateRes struct {
	ResponseCode             string `json:"output_ResponseCode"`
	ResponseDesc             string `json:"output_ResponseDesc"`
	TransactionReference     string `json:"output_TransactionReference"`
	MsisdnToken              string `json:"output_MsisdnToken,omitempty"`
	ConversationID           string `json:"output_ConversationID"`
	ThirdPartyConversationID string `json:"output_ThirdPartyConversationID"`
}

type Env added in v0.1.9

type Env int
const (
	Sandbox Env = iota
	Production
)

type Keys

type Keys struct {
	PublicKey string
	ApiKey    string
}

type QueryBenRequest

type QueryBenRequest struct {
	CustomerMSISDN           string `json:"input_CustomerMSISDN"`
	Country                  string `json:"input_Country"`
	ServiceProviderCode      string `json:"input_ServiceProviderCode"`
	ThirdPartyConversationID string `json:"input_ThirdPartyConversationID"`
	KycQueryType             string `json:"input_KycQueryType"`
}

type QueryBenResponse

type QueryBenResponse struct {
	ResponseCode             string `json:"output_ResponseCode"`
	ResponseDesc             string `json:"output_ResponseDesc"`
	CustomerFirstName        string `json:"output_CustomerFirstName"`
	CustomerLastName         string `json:"output_CustomerLastName"`
	ConversationID           string `json:"output_ConversationID"`
	ThirdPartyConversationID string `json:"output_ThirdPartyConversationID"`
}

type QueryDirectDBReq

type QueryDirectDBReq struct {
	QueryBalanceAmount       bool   `json:"input_QueryBalanceAmount"`
	BalanceAmount            string `json:"input_BalanceAmount,omitempty"`
	Country                  string `json:"input_Country"`
	CustomerMSISDN           string `json:"input_CustomerMSISDN,omitempty"`
	MsisdnToken              string `json:"input_MsisdnToken,omitempty"`
	ServiceProviderCode      string `json:"input_ServiceProviderCode"`
	ThirdPartyConversationID string `json:"input_ThirdPartyConversationID"`
	ThirdPartyReference      string `json:"input_ThirdPartyReference"`
	MandateID                string `json:"input_MandateID,omitempty"`
	Currency                 string `json:"input_Currency"`
}

type QueryDirectDBRes

type QueryDirectDBRes struct {
	ResponseCode             string `json:"output_ResponseCode"`
	ResponseDesc             string `json:"output_ResponseDesc"`
	TransactionReference     string `json:"output_TransactionReference"`
	ConversationID           string `json:"output_ConversationID"`
	ThirdPartyConversationID string `json:"output_ThirdPartyConversationID"`
	SufficientBalance        bool   `json:"output_SufficientBalance"`
	MsisdnToken              string `json:"output_MsisdnToken,omitempty"`
	MandateID                string `json:"output_MandateID"`
	MandateStatus            string `json:"output_MandateStatus"`
	AccountStatus            string `json:"output_AccountStatus"`
	FirstPaymentDate         string `json:"output_FirstPaymentDate,omitempty"`
	Frequency                string `json:"output_Frequency,omitempty"`
	PaymentDayFrom           string `json:"output_PaymentDayFrom,omitempty"`
	PaymentDayTo             string `json:"output_PaymentDayTo,omitempty"`
	ExpiryDate               string `json:"output_ExpiryDate,omitempty"`
}

type QueryTxStatusRequest

type QueryTxStatusRequest struct {
	QueryReference           string `json:"input_QueryReference"`
	Country                  string `json:"input_Country"`
	ServiceProviderCode      string `json:"input_ServiceProviderCode"`
	ThirdPartyConversationID string `json:"input_ThirdPartyConversationID"`
}

type QueryTxStatusResponse

type QueryTxStatusResponse struct {
	ResponseCode              string `json:"output_ResponseCode"`
	ResponseDesc              string `json:"output_ResponseDesc"`
	ResponseTransactionStatus string `json:"output_ResponseTransactionStatus"`
	ConversationID            string `json:"output_ConversationID"`
	ThirdPartyConversationID  string `json:"output_ThirdPartyConversationID"`
	OriginalTransactionID     string `json:"output_OriginalTransactionID"`
}

type ReversalRequest

type ReversalRequest struct {
	ReversalAmount           string `json:"input_ReversalAmount,omitempty"`
	Country                  string `json:"input_Country"`
	TransactionID            string `json:"input_TransactionID"`
	ServiceProviderCode      string `json:"input_ServiceProviderCode"`
	ThirdPartyConversationID string `json:"input_ThirdPartyConversationID"`
}

type ReversalResponse

type ReversalResponse struct {
	ResponseCode             string `json:"output_ResponseCode"`
	ResponseDesc             string `json:"output_ResponseDesc"`
	TransactionID            string `json:"output_TransactionID"`
	ConversationID           string `json:"output_ConversationID"`
	ThirdPartyConversationID string `json:"output_ThirdPartyConversationID"`
}

type SessionKeyResponse

type SessionKeyResponse struct {
	OutputResponseCode string `json:"output_ResponseCode"`
	OutputResponseDesc string `json:"output_ResponseDesc"`
	OutputSessionID    string `json:"output_SessionID"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL