Android Question Paygate Payment Gateway

Jakes72

Active Member
Licensed User
Longtime User
Hi Experts,

I am trying to communicate with the Paygate Payment Gateway, it basically works like this in a nutshell:

STEP 1 - Send the Paygate Server some parameters (Merchant ID, Amount, Reference etc etc...) to Initiate a Transaction.
- Server Responds with a 'PAY_REQUEST_ID' for the transaction.

STEP 2 - Use the PAY_REQUEST_ID (Gotten in Step 1) along with some other parameters and do a Redirect to their Payment's Web page with these parameters to
accept payment.

STEP 3 - Server will redirect to a Return URL and a Query Request can be sent to see if the Transaction has succeeded.


I have STEP 1 working 100% and I get a PAY_REQUEST_ID, STEP 3 I have not done yet.

Now STEP 2 is my problem, basically I am not so sure if I am doing it the right way?
What I get from the Server Response is the RAW HTML of the Payment's page, and I just assign this RAW HTML to a Webview control.
Now this works and I can see the Payment's page and I can also see the correct amount and reference listed there, but is this the correct way of doing it?

Here is the Paygate API docs:

Here is the 'POSTMAN' docs showing Java OKHttp etc:

Basically what I am doing is this for STEP 2:

B4X:
Private mHTTPClient As HttpJob                            
mHTTPClient.Initialize("HTTPClient",Me)

Dim strChecksum As String = GenerateMD5Checksum
        
mParametersMap.Clear
mParametersMap.Put("PAY_REQUEST_ID", mReturnedPayRequestID)    
mParametersMap.Put("CHECKSUM", strChecksum)
        
mHTTPClient.PostMultipart("https://secure.paygate.co.za/payweb3/process.trans",mParametersMap,Null)
mHTTPClient.GetRequest.Timeout = mTimeout
mHTTPClient.GetRequest.SetHeader("Content-Type","text/plain")  

Dim mRequestResponseString As String
            
'Wait for the Paygate Server to Respond....
 Wait For (mHTTPClient) JobDone(mHTTPClient As HttpJob)
 If mHTTPClient.Success Then
        mRequestResponseString  = mHTTPClient.GetString      'This contains the RAW HTML of the Payment's page.
        mBrowser.LoadHtml(mRequestResponseString)             'Assign this RAW HTML to my Webview
End If


Any advice/help would be greatly appreciated.

Regards,
Jacques.
 
Top