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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...