Skip to content

API Methods

Mtabe edited this page Jul 16, 2024 · 1 revision

The Library class exposes the following methods

  • Submiting Requests

    • submitBill(String signedRequestXml) This method submits a bill to the GePG API, the method takes a signed xml string as a parameter and returns an instance of the GepgBillSubReqAck` class

    • reuseControlNumber(String signedRequest) This method submits a control number reuse request to the GePG API and respond by returning an instance of the GepgBillSubReqAck class

    • updateBill(String signedRequest) This method submits a bill change/update request to the GePG API and respond by returning an instance of the GepgBillSubReqAck class

    • cancelBill(String signedRequest) This method submits a bill change/update request to the GePG API and responds by returning an instance of the GepgBillSubReqAck class

    • submitPayment(String signedRequest) This method Submits a payment to the GePG API and responds by returning an instance of the GepgPmtSpInfoAck class

    • requestReconciliation(String signedRequest) This method Submits a reconciliation request to the GePG API and responds by returning an instance of the GepgSpReconcRespAck class

  • Receiving Responses

    • receivePaymentNotification(String gepgSignedResponse) This method receives the payment notification Info as xml and returns an instance of the GepgPmtSpInfo class mapped to the received response

    • receiveControlNumber(String gepgSignedResponse) This method receives the control number as an xml response and returns an instance of the GepgBillSubResp class mapped to the response received

    • receiveReconciliationResponse(String gepgSpReconcResp) This method receives the reconciliation response and returns an instance of the GepgSpReconcResp class mapped to the response received

  • Generating Acknowledgements

    • generateResponseAck(T instance): This method takes an instance of one of the Ack classes and generate a signed Ack and returns it back to Gepg, Here are the ack class instances that can be passed
      • GepgBillSubRespAck
      • GepgPmtSpInfoAck
      • GepgOlPmtNtfSpInfoAck
      • GepgSpReconcRespAck
  • Helpers

    • signMessage(String xmlString, Class<T> clazz) This method takes an xml mapped to a clazz, signs it and returns a signed xml string of the clazz type.

    • convertToJavaObject(String xmlString, Class<T> clazz) This method converts an xml string into a JAXB-annotated object of the clazz type and returns it

    • parseToXml(Object object) This method takes a java JAXB-annotated object and converts it into an xml string and returns it without xml declaration

    • parseToXml(Object object, Boolean addXmlDeclaration) This method takes a java JAXB-annotated object and a boolean flag for adding xml declaration, converts it into an xml string and returns it with an xml declaration, this is the example of how the xml declartion will look like <?xml version="1.0" encoding="UTF-8" standalone="yes"?>, if the boolean flag is set to false, it will return the xml without the declaration

    • generatePayload(Object object) This method takes a java JAXB-annotated object converts it into an xml string, signs it and returns it, It is a combination of the parseToXml and the signMessage methods

  • DateTime Helpers

    • getFutureDateTimeInDays(int daysInTheFuture) This method takes number of days in the future and returns a datetime string in the future (days) from now in the format (2017-03-25T14:30:12)

    • getPastDateTimeInDays(int daysInThePast) This method takes number of (days) in the past and returns a datetime string in the past (days) from now in the format (2017-03-25T14:30:12)

    • getCurrentDateTime() This method returns current datetime string in in the format (2017-03-25T14:30:12)

Clone this wiki locally