Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Sends a payment request to the Moniepoint payment terminal.

Usage Example

Code Block
using (var moniepointService = new MoniepointCommunicationService("COM1", 9600, 5000))

...



{

...



    if (moniepointService.CheckConnection())

...



    {

...



        var paymentRequest = new PaymentRequest

...



        {

...



            TransactionType = "Sale",

...



            Amount = "100.00",

...



            MerchantReference = "123456"

...



        };

...





        var paymentResponse = moniepointService.SendPaymentRequest(paymentRequest);

...





        if (paymentResponse.Status == "success")

...



        {

...



            var responseData = paymentResponse.ResponseData;

...



            var responseObject = paymentResponse.ResponseDataObject as Response;

...



        }

...



        else

...



        {

...



            // Handle error or timeout

...



        }

...



    }

...



}

Transaction Types

1 - Credit Card Purchase

...

The Response class represents the response data structure received from the Moniepoint payment terminal.

Code Block
public class ResponseObject

...



{

...



    public string MaskedPan { get; set; }

...



    public string ResponseCode { get; set; }

...



    public int Amount { get; set; }

...



    public string AuthorizeCode { get; set; }

...



    public string RetrievalRefNo { get; set; }

...



    public string TerminalID { get; set; }

...



    public string TransDate { get; set; }

...



    public string TransTime { get; set; }

...



}