laprofessor19
15.04.2019, 11:58
Hallo, mein Shop CMS funktioniert via einer Bitcoin Node.
Die Transaktionen usw werden erfasst, aber dass System / CMS schafft es einfach nicht den Betrag umzurechnen und dem Nutzer es gutzuschreiben.
Daher suche ich einen Coder, der mir das fixen kann. Shop ist in PHP & JSON
Es klappt alles, Transaktionen werden zum passenden User erfasst und auch Wallet funktioniert ohne Probleme. Nur wird es dem User nicht gutgeschrieben, da der Kurs Wert im Backend 0€ beträgt.
Budget: 50€-100€ (da ich denke, da muss nur der Umrechnungskurs gefixt werden, da der veraltet ist oder so)
Kontakt:
PN | Discord oder Jabber (Privat per PN)
- - - - - - - - - - Beitrag nachträglich erweitert - - - - - - - - - -
Problem gefunden.
Es wird für die Umrechnung https://finance.google.co.uk/finance/converter?a=1&from=USD&to=EUR verwendet zB.
Dass müsste gefixt werden.
- - - - - - - - - - Beitrag nachträglich erweitert - - - - - - - - - -
Hier einmal aus dem Code geschnitten. Entweder ist Backend bei Google Blacklisted oder ja. Müsste jedenfalls ne Alternative her.
public static function convertCurrency($amount, $fromCurrency, $toCurrency, $inCent = true) {
$amount = urlencode($amount);
$fromCurrency = trim(strtoupper(urlencode($fromCurrency)));
$toCurrency = trim(strtoupper(urlencode($toCurrency)));
if($fromCurrency == 'TRL') $fromCurrency = 'TRY';
if($fromCurrency == 'ZWD') $fromCurrency = 'ZWL';
if($fromCurrency == 'RIAL') $fromCurrency = 'IRR';
$url = 'https://www.google.de/search?q=' . $amount . '&from=' . $fromCurrency . '&to=' . $toCurrency;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
$rawdata = curl_exec($ch);
curl_close($ch);
$data = explode('bld>', $rawdata);
$data = explode($toCurrency, $data[1]);
$rounded = round($data[0], ($toCurrency == 'BTC' ? 5 : 2));
if($toCurrency == 'BTC') {
$rounded = sprintf('%.6f', $data[0]);
}
if($toCurrency != 'BTC' && $inCent) {
if(!strpos($rounded, '.') !== false) {
return $rounded . '00';
} else if(strlen(substr(strrchr($rounded, '.'), 1)) == 2) {
return str_replace('.', '', $rounded);
} else if(strlen(substr(strrchr($rounded, '.'), 1)) == 1) {
return str_replace('.', '', $rounded . '0');
}
} else if($toCurrency != 'BTC') {
if(!strpos($rounded, '.') !== false) {
return $rounded . '.00';
} else if(strlen(substr(strrchr($rounded, '.'), 1)) == 1) {
return str_replace('.', '', $rounded . '0');
}
}
return $rounded;
}
}
}
Die Transaktionen usw werden erfasst, aber dass System / CMS schafft es einfach nicht den Betrag umzurechnen und dem Nutzer es gutzuschreiben.
Daher suche ich einen Coder, der mir das fixen kann. Shop ist in PHP & JSON
Es klappt alles, Transaktionen werden zum passenden User erfasst und auch Wallet funktioniert ohne Probleme. Nur wird es dem User nicht gutgeschrieben, da der Kurs Wert im Backend 0€ beträgt.
Budget: 50€-100€ (da ich denke, da muss nur der Umrechnungskurs gefixt werden, da der veraltet ist oder so)
Kontakt:
PN | Discord oder Jabber (Privat per PN)
- - - - - - - - - - Beitrag nachträglich erweitert - - - - - - - - - -
Problem gefunden.
Es wird für die Umrechnung https://finance.google.co.uk/finance/converter?a=1&from=USD&to=EUR verwendet zB.
Dass müsste gefixt werden.
- - - - - - - - - - Beitrag nachträglich erweitert - - - - - - - - - -
Hier einmal aus dem Code geschnitten. Entweder ist Backend bei Google Blacklisted oder ja. Müsste jedenfalls ne Alternative her.
public static function convertCurrency($amount, $fromCurrency, $toCurrency, $inCent = true) {
$amount = urlencode($amount);
$fromCurrency = trim(strtoupper(urlencode($fromCurrency)));
$toCurrency = trim(strtoupper(urlencode($toCurrency)));
if($fromCurrency == 'TRL') $fromCurrency = 'TRY';
if($fromCurrency == 'ZWD') $fromCurrency = 'ZWL';
if($fromCurrency == 'RIAL') $fromCurrency = 'IRR';
$url = 'https://www.google.de/search?q=' . $amount . '&from=' . $fromCurrency . '&to=' . $toCurrency;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
$rawdata = curl_exec($ch);
curl_close($ch);
$data = explode('bld>', $rawdata);
$data = explode($toCurrency, $data[1]);
$rounded = round($data[0], ($toCurrency == 'BTC' ? 5 : 2));
if($toCurrency == 'BTC') {
$rounded = sprintf('%.6f', $data[0]);
}
if($toCurrency != 'BTC' && $inCent) {
if(!strpos($rounded, '.') !== false) {
return $rounded . '00';
} else if(strlen(substr(strrchr($rounded, '.'), 1)) == 2) {
return str_replace('.', '', $rounded);
} else if(strlen(substr(strrchr($rounded, '.'), 1)) == 1) {
return str_replace('.', '', $rounded . '0');
}
} else if($toCurrency != 'BTC') {
if(!strpos($rounded, '.') !== false) {
return $rounded . '.00';
} else if(strlen(substr(strrchr($rounded, '.'), 1)) == 1) {
return str_replace('.', '', $rounded . '0');
}
}
return $rounded;
}
}
}