please post some useful discussion about Microwallet having Issues regarding IP and API
This is the only temp fix I know, but it should work.
Balance Fix:
Replace:
$balance = @file_get_contents('https://www.microwallet.org/api/v1/balance?api_key=' . rawurlencode($GLOBALS['settings']['microwallet_api_key']));
With...
$balance = @file_get_contents('https://www.microwallet.org/api/v1/balance?api_key=' . rawurlencode($GLOBALS['settings']['microwallet_api_key']));
$request = '';
$request .= "GET /api/v1/balance?api_key=".rawurlencode($GLOBALS['settings']['microwallet_api_key'])." HTTP/1.0\r\n";
$request .= "Host: www.microwallet.org\r\n";
$request .= "Connection: close\r\n\r\n";
$fp = @fsockopen('ssl://104.28.0.112', 443);
if (!$fp) {
// ??
}
@fputs($fp, $request);
$response = '';
while (!@feof($fp)) {
$response .= @fgets($fp, 1024);
}
@fclose($fp);
$balance = explode("\r\n\r\n", $response);
$balance = $balance[1];
Failure to Send Fix:
Replace:
$fp = @fsockopen('ssl://www.microwallet.org', 443);
if (!$fp) {
return array(
'success' => false,
'message' => 'Failed to send.',
'html' => '
Failed to send.
',
'response' => null,
);
With...
$fp = @fsockopen('ssl://'.gethostbyname('www.microwallet.org'), 443);
if (!$fp) {
return array(
'success' => false,
'message' => 'Failed to send.',
'html' => '
Failed to send.
',
'response' => null,
);