承接 tiagof2/integration-callback-feedback 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tiagof2/integration-callback-feedback

Composer 安装命令:

composer require tiagof2/integration-callback-feedback

包简介

Makes a request to the given URL passing the result of the requested action

README 文档

README

Using

use Tiagof2\IntegrationCallback\Feedback;

$request_url = 'http://fake-url.com/notify_status';

$callback_data = new Feedback($callback_data_values = [
    'protocol'          => 'my-protocol-id', //'required',
    'url'               => $request_url,     //'required|url|min:5',
    'method'            => 'post',           //HTTP verbs (get/post/put/patch)
]);

$success            = true; //bool
$optional_message   = 'The account has been created successfuly';

if($callback_data->isValid())
{
    $callback_data->makeRequest($success, $optional_message);
}

Tests

To use ins test, just pass to second parameter true or call the fake() method

use Tiagof2\IntegrationCallback\Feedback;

$fake_url = 'http://fake-url.com/notify_status';
$is_fake  = true;//default false

$callback_data = new Feedback($callback_data_values = [
    'protocol'          => 'my-protocol-id', //'required',
    'url'               => $fake_url,        //'required|url|min:5',
    'method'            => 'post',           //HTTP verbs (get/post/put/patch)
], $is_fake);

//Using the fake() method
$callback_data->fake();

// Check if is a test
$this->assertTrue($callback_data->isFake());

//Setting assert return value to true
$callback_data->assertValue(true);//bool

$success            = true; //bool
$optional_message   = 'The account has been created successfuly';
$this->assertTrue($callback_data->makeRequest($success, $optional_message));//returns true (will not make the realy request)

//Setting assert return value to false
$callback_data->assertValue(false);//bool
$this->assertFalse($callback_data->makeRequest($success, $optional_message));//returns false (will not make the realy request)

统计信息

  • 总下载量: 46
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固