Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse
Wklejka 9x1uszgzmcm dodana przez DarkGL, 04.04.2014 10:02
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102.
<?php defined('SYSPATH') or die('No direct script access.'); class Payments_CsSetti { /** * 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 cssetti_id -- numer ID zarejestrowanego klienta */ public function check($sms, $numer = NULL, $code = NULL) { $shop = $this->smsAPI($sms, Core::setting()->get('cssetti_id')); $odp = $shop[0]; $value = $shop[1]; switch ($odp){ 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 cssetti', 'cost' => $rate[1], 'amount' => $rate[2] ); } return $_return; } private 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://www.cssetti.pl/api.php"); $res = curl_exec($ch); curl_close($ch); $res = explode('|', $res); return $res; } } ?>
Dodanych wklejek: 4031
Powered By (Pav32) Pastebin © 2011