asesoritech / tools
用于通过asesoritech短信服务发送短信的小型库。
这个包的规范仓库似乎已经不存在,因此该包已被冻结。
dev-master
2020-12-22 22:13 UTC
Requires
- laravel/framework: >=7.0.0
This package is not auto-updated.
Last update: 2021-06-22 06:08:28 UTC
README
为Laravel应用程序实现asesoritech服务的简单方法
安装
- 安装包依赖项
composer require asesoritech/tools
短信
安装guzzle依赖项
composer require guzzlehttp/guzzle
设置环境变量
设置提供的API密钥
ASESORITECH_API_KEY=""
用法
发送消息
$goSMS = new GoSMS();
$sent = $goSMS->sendMessage("8090000000","Exmple message");
echo $sent;
检查线路状态
$goSMS = new GoSMS();
$status = $goSMS->status();
echo $status;
Azul支付页面
设置环境变量
AZUL_MERCHANT_ID="Identification of the assigned business"
AZUL_MERCHANT_NAME="Business name"
AZUL_MERCHANT_TYPE="Business type information"
AZUL_MERCHANT_LOGO="Business logo image full url"
** Optional **
AZUL_APPROVED_URL Default: Base Url + 'azul/approved'
AZUL_DECLINED_URL Default: Base Url + 'azul/declined'
AZUL_CANCEL_URL Default: Base Url + 'azul/cancelled'
注意
如果 (APP_ENV = local),则设置Azul测试环境,否则将设置生产域和配置
用法
创建支付数据
创建一个包含所有(Azul)所需字段,包括AuthHash的数组
$azulGateway = new AzulGateway();
$data = $azulGateway->createPaymentData($orderId,$amount,$productImageUrl);
dump($data);
调用支付页面
自动创建并提交包含所有所需字段和数据的HTML表单,以便重定向到支付页面;
$azulGateway = new AzulGateway();
$htmlForm = $azulGateway->invokePaymentPage($orderId,$amount,$productImageUrl);
echo $htmlForm;