Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. index.php
  2.  
  3. <?php
  4.  
  5. require_once 'SimPay.class';
  6.  
  7. function pre($array) {
  8. echo '<pre>';
  9. print_r($array);
  10. echo '</pre>';
  11. }
  12.  
  13. define('API_KEY', 'f45a9e23');
  14. define('API_SECRET', 'ecb80d1c451c65f00036fb69b3c9c6e3');
  15. define('API_VERSION', '1');
  16.  
  17. try {
  18.  
  19. $api = new SimPay(API_KEY, API_SECRET, API_VERSION);
  20. $api->getStatus(array(
  21. 'service_id' => '2327', // identyfikator usl‚ugi premium sms
  22. 'number' => $_GET['snumer'], // numer na ktory wyslano sms
  23. 'code' => $_GET['skod'], // kod wprowadzony przez klienta
  24. ));
  25.  
  26. if($api->check()) {
  27. echo 'Wprowadzono poprawny kod';
  28. } else if($api->error()) {
  29. // Widok tylko w wersji deweloperskiej - do wylaczenia po zakonczeniu testow
  30. echo 'Wystapil blad:<br/>';
  31. pre($api->showError());
  32. } else {
  33. print_r($api->showStatus());
  34. }
  35. }
  36.  
  37. catch(Exception $e) {
  38. echo 'Error: ' .$e->getMessage();
  39. }
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement