Web Connection
Json Get call
Gravatar is a globally recognized avatar based on your email address. Json Get call
  Bob Hollingsworth
  All
  Nov 25, 2018 @ 05:21pm

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.

Gravatar is a globally recognized avatar based on your email address. re: Json Get call
  Rick Strahl
  Bob Hollingsworth
  Nov 26, 2018 @ 12:43pm

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 ---

Gravatar is a globally recognized avatar based on your email address. re: Json Get call
  Bob Hollingsworth
  Bob Hollingsworth
  Nov 26, 2018 @ 05:44pm

Thanks Worked a treat. I missed the password bit at the end.

Gravatar is a globally recognized avatar based on your email address. re: Json Get call
  Rick Strahl
  Bob Hollingsworth
  Nov 27, 2018 @ 12:00am

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 ---

© 1996-2024