Jump to content
  • 0

Problem With Currency Conversion


Question

Posted

Hi,

when i try to convert currency using following code,

 

 $response= $api->put("currencies", "convert", array("amount" => $_POST['amount'], "from_currency" => $_POST['from_currency'], "to_currency" => $_POST['to_currency'], "company_id" => 1));

 

i get the following error

Internal error: Failed to retrieve the default values
stdClass Object(    [error] => stdClass Object        (            [message] => An unexpected error occured.            [response] => Internal error: Failed to retrieve the default value        ))

also tried with another code,

$data = array(
                'vars' => array(
                       'amount' => $_POST['amount'],
                    'from_currency' => $_POST['from_currency'],
                    'to_currency' => $_POST['to_currency'],
                    'company_id' => 1
                )
            );

 $response = $api->put("currencies", "convert", $data);

this also results the same error.

 

please help me

2 answers to this question

Recommended Posts

  • 0
Posted
  On 8/29/2014 at 7:12 AM, aiswarya said:

$response= $api->put("currencies", "convert", array("amount" => $_POST['amount'], "from_currency" => $_POST['from_currency'], "to_currency" => $_POST['to_currency'], "company_id" => 1)

 

I believe you want to call get, not put.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...