API zabijaka.pl w sklepie ghosta nie działa.
BeMM
01.06.2014
Witam, od kilku dni przestało działać API Zabijaka.pl w sklepie ghosta.
Ma ktoś może aktualne api?
Pomager'ek 01.06.2014
- <?php defined('SYSPATH') or die('No direct script access.');
- class Payments_amxx
- {
- /**
- * Sprawdza poprawność kodu sms...
- *
- * @param $sms string kod sms
- * @param $numer string opcjonalnie, numer na który został wysłany sms
- * @param $code string opcjonalnie, treść smsa jaką wysłał użytkownik
- *
- * @access public
- * @return float Kwota jaką ma zostać zasilony portfel
- */
- public function check($sms, $numer = NULL, $code = NULL)
- {
- $shop = $this->smsAPI($sms, Core::setting()->get('id_uzytkownika'));
- $response = $shop[0];
- $value = $shop[1];
- switch ($response){
- case 1:{
- return array($value, 'Konto zostało doładowane');
- break;
- }
- case 2:
- {
- return array(0.0, 'Kod niepoprawny');
- break;
- }
- case 3:
- {
- return array(0.0, 'Kod został juz wykożystany');
- break;
- }
- case 4:
- {
- return array(0.0, 'Nie można nawiązać połączeni');
- break;
- }
- }
- }
- /**
- * Stawki sms
- *
- *
- * @access public
- * @return array zwraca tablice ze stawkami sms(numer, koszt, tresc)
- */
- public function rates()
- {
- $rates = array();
- //Numer | koszt | do portfela trafi...
- $rates[] = array(71480, 1.23, 0.5);
- $rates[] = array(72480, 2.46, 1.0);
- $rates[] = array(73480, 3.69, 1.5);
- $rates[] = array(74480, 4.92, 2.0);
- $rates[] = array(75480, 6.15, 2.5);
- $rates[] = array(76480, 7.38, 3.0);
- $rates[] = array(79480, 11.07, 4.5);
- $rates[] = array(91400, 17.22, 7.0);
- $rates[] = array(91900, 23.37, 9.5);
- $rates[] = array(92550, 30.75, 12.5);
- $_return = array();
- foreach($rates as $rate)
- {
- $_return[] = array(
- 'numer' => $rate[0],
- 'text_sms' => 'ag msamxx',
- 'cost' => $rate[1],
- 'amount' => $rate[2]
- );
- }
- return $_return;
- }
- function smsAPI($kod, $id)
- {
- $ch = curl_init();
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
- curl_setopt( $ch, CURLOPT_POST, 1);
- curl_setopt( $ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
- curl_setopt( $ch, CURLOPT_POSTFIELDS, array(
- 'kod' => $kod,
- 'id' => $id
- ));
- curl_setopt( $ch, CURLOPT_URL, "http://serwery.amxx.pl/api.php");
- $res = json_decode( curl_exec( $ch ) , true );
- curl_close($ch);
- return $res;
- }
- }
- ?>
Scorpion Flail
07.06.2014
Przejrzałem na szybko aktualną paczkę sklepiku ghosta i api zabijaka jest aktulane, tj pokrywa się z tym: