gapaus/php-sdk

此包的最新版本(0.1.1)没有可用的许可证信息。

DIDWW API 2 PHP SDK

此包的规范仓库似乎已丢失,因此包已被冻结。

0.1.1 2015-11-30 13:58 UTC

This package is not auto-updated.

Last update: 2023-08-05 23:29:15 UTC


README

DIDWW API 2 PHP 5.3 客户端

Build Status Coverage Status

关于 DIDWW API 2.0!

DIDWW API 对分销商免费提供,无需支付任何许可费用。此外,通过此 API 购买的 DIDWW 服务无需支付任何设置费用,从商业角度来看,增加了该模式的吸引力和灵活性。

了解更多 http://open.didww.com/index.php/DIDWW_API_2.0

使用方法

连接初始化

    $userName = "user@gmail";
    $password = "44AEIRTCH5NE2MAPDXYGKHJHH";
    $testMode = false;
    use Didww\API2\ApiCredentials, Didww\API2\ApiClient as Client;
    Client::setCredentials(new ApiCredentials($userName,$password,$testMode));
    Client::setDebug(false);

创建 DID 号码

    use Didww\API2\Order;
    use Didww\API2\MappingToGtalk;
    
    $order = new Order();
    $order->setMapData(new MappingToGtalk("googlemail@gmail.com"));
    $order->setCustomerId(81);
    $order->setCountryIso("IL");
    $order->setCityId(908);
    $order->setCityPrefix(8);
    $order->setPeriod(1);
    $number = $order->createNumber();

更改映射

    use Didww\API2\MappingToGtalk;
    $order->updateMapping(new MappingToGtalk("anothergooglemail@gmail.com"));

客户余额列表

    use Didww\API2\Balance;
    $balances =  Balance::getBalanceList();

处理余额

    $balance = new Balance();
    $balance->setCustomerId(81);
    $balance->synchronizePrepaidBalance();
    echo $balance->getPrepaidBalance();
    $balance->removeFunds(10);
    $balance->addFunds(20);

CDR 和 CDR 费用

    use Didww\API2\CDR;
    use Didww\API2\CDRInvoice;
    use Didww\API2\CDRCollection;
    
    $invoice = new CDRInvoice();
    $invoice->setCustomerId(81);
    $invoice->setFromDate('2012-01-01');
    $invoice->setToDate('2012-01-31');
    
    $invoice->load();
    echo $invoice->getAmount();
    
    
    $cdrs = new CDRCollection();
    $cdrs->setFromDate('2012-01-01');
    $cdrs->setToDate('2012-03-01');
    $cdrs->setCustomerId(85);
    $cdrs->load();

地区

    use Didww\API2\Country;
    $countries = Country::getAll();

城市

 use Didww\API2\Country;
 $country = new Country(array('country_iso'=>'US'));
 $country->loadCities()->getCities();

还有更多...