Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- index.php
- <?php
- require_once 'SimPay.class';
- function pre($array) {
- echo '<pre>';
- print_r($array);
- echo '</pre>';
- }
- define('API_KEY', 'f45a9e23');
- define('API_SECRET', 'ecb80d1c451c65f00036fb69b3c9c6e3');
- define('API_VERSION', '1');
- try {
- $api = new SimPay(API_KEY, API_SECRET, API_VERSION);
- $api->getStatus(array(
- 'service_id' => '2327', // identyfikator usl‚ugi premium sms
- 'number' => $_GET['snumer'], // numer na ktory wyslano sms
- 'code' => $_GET['skod'], // kod wprowadzony przez klienta
- ));
- if($api->check()) {
- echo 'Wprowadzono poprawny kod';
- } else if($api->error()) {
- // Widok tylko w wersji deweloperskiej - do wylaczenia po zakonczeniu testow
- echo 'Wystapil blad:<br/>';
- pre($api->showError());
- } else {
- print_r($api->showStatus());
- }
- }
- catch(Exception $e) {
- echo 'Error: ' .$e->getMessage();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement