PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/API/SOAP/soap-card-client.php

https://github.com/xrg/a2billing
PHP | 114 lines | 43 code | 41 blank | 30 comment | 0 complexity | 69356ed97636170e4f5a1d0ddfecd2db MD5 | raw file
Possible License(s): AGPL-1.0
  1. <?php
  2. /***************************************************************************
  3. *
  4. * soap-card-client.php : PHP A2Billing - Test Services
  5. * Written for PHP 4.x & PHP 5.X versions.
  6. *
  7. * A2Billing -- Asterisk billing solution.
  8. * Copyright (C) 2004, 2007 Belaid Arezqui <areski _atl_ gmail com>
  9. *
  10. * See http://www.asterisk2billing.org for more information about
  11. * the A2Billing project.
  12. * Please submit bug reports, patches, etc to <areski _atl_ gmail com>
  13. *
  14. * This software is released under the terms of the GNU Lesser General Public License v2.1
  15. * A copy of which is available from http://www.gnu.org/copyleft/lesser.html
  16. *
  17. ****************************************************************************/
  18. /***************************************************************************
  19. *
  20. * USAGE : http://domainname/A2Billing_UI/api/SOAP/soap-card-client.php
  21. *
  22. * http://localhost/~areski/svn/a2billing/trunk/A2Billing_UI/api/SOAP/soap-card-client.php
  23. *
  24. ****************************************************************************/
  25. include ("../../lib/defines.php");
  26. require('SOAP/Client.php');
  27. $security_key = API_SECURITY_KEY;
  28. $endpoint = 'http://localhost/~areski/svn/asterisk2billing/trunk/A2Billing_UI/api/SOAP/soap-card-server.php';
  29. // ADD ON THE SPEC SECURITY KEY
  30. $card = new SOAP_Client($endpoint);
  31. // ############# Reservation_Card #############
  32. echo "<hr>############# Reservation_Card : $ans[2] ############# </hr>";
  33. $method = 'Reservation_Card';
  34. $params = array('security_key' => md5($security_key), 'transaction_code' => 'mytransaction_code', 'card_id' => '', 'cardnumber' => '8995713909' );
  35. $ans = $card->call($method, $params);
  36. print_r($ans);
  37. exit;
  38. // ############# Activation_Card #############
  39. echo "<hr>############# Activation_CARD : $ans[2] ############# </hr>";
  40. $method = 'Activation_Card';
  41. //Activation_Card($security_key, $transaction_code, $card_id, $cardnumber)
  42. $params = array('security_key' => md5($security_key), 'transaction_code' => 'mytransaction_code', 'card_id' => '', 'cardnumber' => '8995713909' );
  43. $ans = $card->call($method, $params);
  44. print_r($ans);
  45. exit;
  46. // ############# Batch_Activation_Card #############
  47. echo "<hr>############# Batch_Activation_Card : $ans[2] ############# </hr>";
  48. $method = 'Batch_Activation_Card';
  49. $params = array('security_key' => md5($security_key), 'transaction_code' => 'mytransaction_code', 'begin_card_id' => '2',
  50. 'end_card_id' => '4');
  51. $ans = $card->call($method, $params);
  52. print_r($ans);
  53. exit;
  54. // ############# CREATE_CARD #############
  55. echo "<hr>############# CREATE_CARD ############# </hr>";
  56. $method = 'Create_Card';
  57. $params = array('security_key' => md5($security_key), 'transaction_code' => 'mytransaction_code', 'account_number' => 'myaccount_number', 'tariff' => '1', 'uipass' => '', 'credit' => '10', 'language' => 'en',
  58. 'activated' => '1', 'status' => '2' , 'simultaccess' => '0', 'currency' => 'USD', 'runservice' => '0', 'typepaid' => '1', 'creditlimit' => '0',
  59. 'enableexpire' => '0', 'expirationdate' => '', 'expiredays' => '0', 'lastname' => 'Areski', 'firstname' => 'Areski', 'address' => 'my address',
  60. 'city' => 'mycity', 'state' => 'mystate', 'country' => 'mycoutry', 'zipcode' => '1000', 'phone' => '646486411', 'fax' => '',
  61. 'callerid_list' => '21345114', 'iax_friend' => '1', 'sip_friend' => '0');
  62. $ans = $card->call($method, $params);
  63. print_r($ans);
  64. exit;
  65. // ############# REMOVE_CARD #############
  66. echo "<hr>############# REMOVE_CARD : $ans[2] ############# </hr>";
  67. $method = 'Remove_Card';
  68. $params = array('security_key' => md5($security_key), 'transaction_code' => 'mytransaction_code', 'account_number' => 'myaccount_number',
  69. 'cardnumber' => $ans[2]);
  70. $ans = $card->call($method, $params);
  71. print_r($ans);
  72. exit;
  73. ?>