Skip to content

Commit

Permalink
Merge branch 'master' of ssh://icode.baidu.com:8235/baidu/duer/bot-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanpeng01 authored and yuanpeng01 committed Jul 1, 2019
2 parents cdb26a6 + 7ca88f1 commit 58fb023
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@

#2.1.18
* 增加权限api请求接口

#2.1.19
* 增加Buy指令
37 changes: 37 additions & 0 deletions src/Directive/Pay/Buy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* Copyright (c) 2017 Baidu, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @desc 用于生成Buy指令的类
**/
namespace Baidu\Duer\Botsdk\Directive\Pay;

class Buy extends \Baidu\Duer\Botsdk\Directive\BaseDirective{

/**
* @param [type] $productId [description]
* @param [type] $token [description]
*/
public function __construct($productId, $token = '') {
parent::__construct('Connections.SendRequest.Buy');

if (empty($token)) {
$token = $this->genToken();
}

$this->data['token'] = $token;
$this->data['payload']['productId'] = $productId;
}
}

0 comments on commit 58fb023

Please sign in to comment.