I am new to PureBasic and have scoured the Help files and this Forum for a solution to the issue I am having, to no avail, so I am turning to you for some guidance.
I am using PureBasic 5.70 LTS (Windows - x64)
If I paste the below concatenated URL into any browser, I get the Response text I'm looking for, also below. If I log into the site, I can see that the transaction was successful, so I know it works. (BTW - All Data is Test Data, through a Test Account. I work for a Credit Card Processing Company and am looking to build a Simple POS system. I am using PB to prototype a Direct Post method that this Site supports. If I can get this working, which I have been able to do using App Game Kit (AGK), then I can proceed with the project. AGK doesn't have native GUI abilities, so I thought PB would be a better prototyping solution.)
The issue is that, I just can't seem to get PB to send that URL to the Site and then return a Response.
Concatenated URL sent to Site:
https://secure.nmi.com/api/transact.php ... ccexp=0319
Response From Site:
response=1&responsetext=SUCCESS&authcode=123456&transactionid=4855334505&avsresponse=N&cvvresponse=&orderid=&type=sale&response_code=100
Here is the current iteration of my code: (Taken from the Help Files)
Code: Select all
If InitNetwork() = 0
MessageRequester("Error", "Can't initialize the network !", 0)
End
EndIf
Port = 443
Path$ = "https://secure.nmi.com/api/transact.php?"
Username$ = "JPBTest"
Password$ = "08Aug2019"
firstname$ = "John"
lastname$ = "Smith"
address1$ = "45 Testing Road"
city$ = "Somewhere"
state$ = "MA"
zip$ = "02021"
Posting$ = Path$ + "username=" + Username$ + "&password=" + Password$ + "&firstname=" + firstname$ + "&lastname=" + lastname$ + "&address1=" + address1$ + "&city=" + city$ + "&state=" + state$ + "&zip=" + zip$ + "&payment=creditcard&type=sale" + "&amount=1.00&ccnumber=374245005741003&ccexp=0319"
HttpRequest = HTTPRequest(#PB_HTTP_Get, Path$, Posting$, #PB_HTTP_Asynchronous)
If HttpRequest
Debug "StatusCode: " + HTTPInfo(HTTPRequest, #PB_HTTP_StatusCode)
Debug "Response: " + HTTPInfo(HTTPRequest, #PB_HTTP_Response)
FinishHTTP(HTTPRequest)
Else
Debug "Request creation failed"
EndIf
JHAustin