Trying to get a response from EWAY Payment Gateway. The example they give is as follows.
curl --request GET \
--user 60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR:API-P4ss \
https://api.sandbox.ewaypayments.com/AccessCode/44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2
I can not workout how to use Web Connect to achieve this.
Any help would be appreciated.
Should be easy enough:
loHttp = CREATEOBJECT("wwHttp")
loHttp.cUserName = "60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR"
loHttp.cPassword = "API-P4ss"
loHttp.HttpGet("https://api.sandbox.ewaypayments.com/AccessCode/44DD7aVwPYUPemGRf7pcWxyX2FJS-0Wk7xr9iE7Vatk_5vJimEbHveGSqX52B00QsBXqbLh9mGZxMHcjThQ_ITsCZ3JxKOY88WOVsFTLPrGtHRkK0E9ZDVh_Wz326QZlNlwx2")
You may have to explicitly send the username and password though if the service doesn't force authentication (ie. reject the request with a 401 that prompts for authentication conversation). In that case you can do (assuming it's using basic authentication) to replace the username and password properties:
lcAuth = STRCONV(lcUsername,13) + ":" + STRCONV(lcPassword)
loHttp.AddHeader("Authorization",lcAuth)
+++ Rick ---
Thanks Worked a treat. I missed the password bit at the end.
Yeah that's terrible documentation. Unless you're familiar with how authorization (or curl) works you wouldn't know that you have to split the string at the :
...
It's common but I always think it's bad form because it makes some assumptions of what you should know which is never a good idea to get people started.
+++ Rick ---