0

I am trying to make this curl to cfhttp, but unable to get this done

C:\>curl -k https://api.juspay.in/order/create -u 320EABE1225D45E6B13DF5D3D2BBDB80: -d "amount=10.00"

response:

{
"status": "CREATED",
"status_id": 1,
"order_id": null
}

coldfusion script:

  <cfhttp url='https://api.juspay.in/order/create'  username="320EABE1225D45E6B13DF5D3D2BBDB80" password="" method="post" >
        <cfhttpparam name="amount" type="formField" value="10">
    </cfhttp>

Getting below response, while hitting through cfhttp

  { "status": "error", "error_code": "access_denied" }

but the curl was working fine.

nikhil reddy
  • 96
  • 1
  • 9
  • Do you have a valid username and password? The error would suggest you don't have access. – Matt Busche Jul 23 '14 at 22:14
  • yes they are correct, I got the output when I tried with curl – nikhil reddy Jul 23 '14 at 22:22
  • In the CURL example, the value of product_id is ":pid", but in the CFHTTP version it is just "pid". Missing a colon? Also, I hope that isn't your valid API key. – Adrian J. Moreno Jul 23 '14 at 22:29
  • updated the code with curl output, all the fields are not required, using the same username in both the snippets – nikhil reddy Jul 23 '14 at 22:43
  • 2
    Have you added the SSL Cert for juspay.in to the java certificate store? You can use http://certman.riaforge.org/index.cfm to make this easier to do. You should simplify your test and try a `cfhttp` request to `https://api.juspay.in/img/logo.png` too see if you have any connectivity to the site at all. – Antony Jul 23 '14 at 23:47
  • Possible duplicate - OP resolved this issue and reported as such here - http://stackoverflow.com/q/24933746/1636917 – Miguel-F Jul 24 '14 at 18:41

0 Answers0