zalopage / zalo-sdk-php
Zalo Page PHP SDK。
dev-master
2016-02-17 07:04 UTC
Requires
- guzzle/guzzle: 3.7.*
This package is not auto-updated.
Last update: 2024-09-24 19:59:35 UTC
README
安装
使用 Composer
php composer.phar require zalopage/zalo-sdk-php
示例
try {
$factory = new ZaloServiceFactory($pageId, $secretKey);
$messageService = $factory->getZaloMessageService();
$zaloPageResult = $messageService->sendTextMessageByPhoneNum($phone, $message, $sms, $isNotify);
if ($zaloPageResult >= 0) {
echo "Success";
}
} catch (ZaloSdkException $ex) {
$error['code'] = $ex->getZaloSdkExceptionErrorCode();
$error['message'] = $ex->getZaloSdkExceptionMessage();
} catch (\Exception $ex) {
$error['code'] = 500;
$error['message'] = $ex->getMessage();
}
致谢