Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 10 Next »

Overview

The Moniepoint Communication Library provides a C# implementation for seamless communication with Moniepoint payment terminals through a serial port. This library facilitates developers in interacting with Moniepoint devices by enabling the sending of payment requests.

ea5-Ez8Ze1lGq57Mw2sPT4ztDZ7bQhxoblZr_OLbXYL4Gdfv4TxU1rCZHjVhUabvfU2Hlr_dLCGBk2bxaacpkexhVa_FpmS8mXKgmONoejtp_p5wAy0BvqcNNKV54CfH9YUfC1wc2w9Yg5GsMR3ojms (1).jpg

DLL Name

The DLL associated with the Moniepoint Communication Library is named moniepoint.dll

You need the DLL file to enable communication

Constructor 

public MoniepointCommunicationService(string portName, int baudRate, int timeoutMilliseconds)

Methods

  1. GetVersion()

Returns the version of the Moniepoint Communication Library.

2. PaymentSendAndReceive(out response, transactionRequest)

Sends a payment request to the Moniepoint payment terminal and get response.

Usage Example

using System;
using MoniepointLibrary;

namespace MoniepointApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            string response;

            try
            {
                string portName = "COM1";
                int baudRate = 115200;
                int timeoutMilliseconds = 90000; //90 seconds

                using (var communicationService = new MoniepointCommunicationService(portName, baudRate, timeoutMilliseconds))
                {
                    var transactionRequest = new PaymentRequest
                    {
                        TransactionType = "1",
                        Amount = "100.00",
                        MerchantReference = "ABC123"
                    };

                    int paymentStatus = communicationService.PaymentSendAndReceive(out response, transactionRequest);

                    if (paymentStatus == MoniepointCommunicationService.SuccessStatus)
                    {
                        Console.WriteLine("Payment Response Data: " + response);
                    }
                    else
                    {
                        Console.WriteLine("Error code: {0}, description: {1}", paymentStatus, communicationService.GetErrorMessage(paymentStatus));
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: " + ex.Message);
            }

            Console.WriteLine("Press Enter to exit...");
        }
    }
}

Transaction Type

1 - Credit Card Purchase

2 - Debit Card Purchase

3 - Debit / Credit Cash Out

4 - Debit / Credit Card Void

5 - Credit Card Return

6 - Debit Card Return

7 - Credit / Debit Card Balance

8 - Gift Card Purchase

9 - Gift Card Void

10 - Gift Card Add Money

11 - Gift Card Balance

Response Code

00 - Approved or completed successfully 

01 - Refer to card issuer

02 - Refer to card issuer, special condition 

03 - Invalid merchant

04 - Pick-up card

05 - Do not honour

06 - Error

07 - Pick-up card, special condition 

08 - Honor with identification

09 - Request in progress

10 - Approved, partial

11 - Approved, VIP

12 - Invalid transaction

13 - Invalid amount

14 - Invalid card number

15 - No such issuer

16 - Approved, update track 3

17 - Customer cancellation

18 - Customer dispute

19 - Re-enter transaction

20 - Invalid response

21 - No action taken

22 - Suspected malfunction

23 - Unacceptable transaction fee 

24 - File update not supported

25 - Unable to locate record

26 - Duplicate record

27 - File update edit error

28 - File update file locked

29 - File update failed

30 - Format error

31 - Bank not supported

32 - Completed partially

33 - Expired card, pick-up

34 - Suspected fraud, pick-up

35 - Contact acquirer, pick-up

36 - Restricted card, pick-up

37 - Call acquirer security, pick-up 

38 - PIN tries exceeded, pick-up

39 - No credit account

40 - Function not supported

41 - Lost card

42 - No universal account

43 - Stolen card

44 - No investment account

51 - Not sufficient funds

52 - No check account

53 - No savings account

54 - Expired card

55 - Incorrect PIN

56 - No card record

57 - Transaction not permitted to cardholder

58 - Transaction not permitted on terminal

59 - Suspected fraud

60 - Contact acquirer

61 - Exceeds withdrawal limit

62 - Restricted card

63 - Security violation

64 - Original amount incorrect

65 - Exceeds withdrawal frequency

66 - Call acquirer security

67 - Hard capture

68 - Response received too late

75 - PIN tries exceeded

77 - Intervene, bank approval required

78 - Intervene, bank approval required for partial amount 

90 - Cut-off in progress

91 - Issuer or switch inoperative

92 - Routing error

93 - Violation of law

94 - Duplicate transaction

95 - Reconcile error

96 - System malfunction

98 - Exceeds cash limit

Sample Response

<Response>
<MaskedPan>418745******6913</MaskedPan>
<ResponseCode>00</ResponseCode>
<AuthorizeCode>187127</AuthorizeCode>
<CardHolderName>CUSTOMER/INSTANT</CardHolderName>
<Amount>10000</Amount>
<RetrievalRefNo>000000000003</RetrievalRefNo>
<TerminalID>2057ILZS</TerminalID>
<TransTime>2024-03-04T17:47:12.000000000</TransTime>
<PaymentMethod>CARD_PURCHASE</PaymentMethod>
<CardScheme>VISA</CardScheme>
</Response>

Error codes

 public const int SuccessStatus = 0;
 public const int PortNotOpenStatus = -1;
 public const int SendErrorStatus = -2;
 public const int ReceiveErrorStatus = -3;
 public const int ReceiveTimeoutStatus = -4;
        public const int InvalidResponseLengthStatus = -5;
        public const int InvalidAcknowledgeResponseStatus = -6;
        public const int InvalidConnectionStatusResponse = -7;
        public const int  ReceiveConnectionErrorStatus = -8;
        public const int ReceiveTimeoutStatusWithPartialResponse = -9;

  • No labels