} //get all conversions echo '<hr/>' . "\n"; echo '<h3 style="color:blue">All Conversions</h3>'; $conversions = GoCoin::getCurrencyConversions($token, MERCHANT_ID); var_dump($conversions); if (!empty($conversions)) { foreach ($conversions as $conversion) { showObject($conversion); } } //request a conversion $DO_CONVERSION = TRUE; if ($DO_CONVERSION) { echo '<h3 style="color:blue">Requested Conversion</h3>'; try { $conversion = GoCoin::requestCurrencyConversion($token, MERCHANT_ID, 1); showObject($conversion); } catch (Exception $e) { //var_dump($e); echo '<div style="color:#aa0000">' . $e->getMessage() . '</div>' . "\n"; } } //show a specific conversion id if (!empty(CONVERSION_ID)) { echo '<h3 style="color:blue">Specific Conversion</h3>'; $specific = GoCoin::requestCurrencyConversion($token, MERCHANT_ID, 1); showObject($specific); } //close our HTML block echo '</body></html>' . "\n";