Properties

$instance

$instance : 

Type

Methods

options()

options() 

application()

application(  $cache = false) 

Parameters

$cache

serve()

serve() 

transfer()

transfer(string  $account = '') : \EasyWeChat\Message\Transfer

多客服消息转发

Parameters

string $account

Returns

\EasyWeChat\Message\Transfer

materialTemporaryService()

materialTemporaryService() : \EasyWeChat\Material\Temporary

上传临时素材接口

Returns

\EasyWeChat\Material\Temporary

staffService()

staffService() 

客服消息接口

menuService()

menuService() : \EasyWeChat\Menu\Menu

微信公众号菜单接口

Returns

\EasyWeChat\Menu\Menu

urlService()

urlService() : \EasyWeChat\Url\Url

短链接生成接口

Returns

\EasyWeChat\Url\Url

sendTemplate()

sendTemplate(  $openid,   $templateId, array  $data,   $url = null,   $defaultColor = null) 

Parameters

$openid
$templateId
array $data
$url
$defaultColor

downloadBill()

downloadBill(  $day,   $type = 'ALL') 

Parameters

$day
$type

userTagService()

userTagService() 

userGroupService()

userGroupService() 

paymentPrepare()

paymentPrepare(  $openid,   $out_trade_no,   $total_fee,   $attach,   $body, string  $detail = '', string  $trade_type = 'JSAPI', array  $options = array()) : mixed

获得下单ID

Parameters

$openid
$out_trade_no
$total_fee
$attach
$body
string $detail
string $trade_type
array $options

Returns

mixed

jsPay()

jsPay(  $openid,   $out_trade_no,   $total_fee,   $attach,   $body, string  $detail = '', string  $trade_type = 'JSAPI', array  $options = array()) : array|string

获得jsSdk支付参数

Parameters

$openid
$out_trade_no
$total_fee
$attach
$body
string $detail
string $trade_type
array $options

Returns

array|string

refund()

refund(  $orderNo,   $refundNo,   $totalFee, null  $refundFee = null, null  $opUserId = null, string  $refundReason = '', string  $type = 'out_trade_no', string  $refundAccount = 'REFUND_SOURCE_UNSETTLED_FUNDS') 

使用商户订单号退款

Parameters

$orderNo
$refundNo
$totalFee
null $refundFee
null $opUserId
string $refundReason
string $type
string $refundAccount

payOrderRefund()

payOrderRefund(  $orderNo, array  $opt) 

Parameters

$orderNo
array $opt

handleNotify()

handleNotify() 

微信支付成功回调接口

jsSdk()

jsSdk(  $url = '') 

Parameters

$url

textMessage()

textMessage(string  $content) : \EasyWeChat\Message\Text

回复文本消息

Parameters

string $content

文本内容

Returns

\EasyWeChat\Message\Text

imageMessage()

imageMessage(string  $media_id) : \EasyWeChat\Message\Image

回复图片消息

Parameters

string $media_id

媒体资源 ID

Returns

\EasyWeChat\Message\Image

videoMessage()

videoMessage(string  $media_id, string  $title = '', string  $description = '...', null  $thumb_media_id = null) : \EasyWeChat\Message\Video

回复视频消息

Parameters

string $media_id

媒体资源 ID

string $title

标题

string $description

描述

null $thumb_media_id

封面资源 ID

Returns

\EasyWeChat\Message\Video

voiceMessage()

voiceMessage(string  $media_id) : \EasyWeChat\Message\Voice

回复声音消息

Parameters

string $media_id

媒体资源 ID

Returns

\EasyWeChat\Message\Voice

newsMessage()

newsMessage(string|array  $title, string  $description = '...', string  $url = '', string  $image = '') 

回复图文消息

Parameters

string|array $title

标题

string $description

描述

string $url

URL

string $image

图片链接

articleMessage()

articleMessage(string|array  $title, string  $thumb_media_id, string  $source_url, string  $content = '', string  $author = '', string  $digest = '', integer  $show_cover_pic, integer  $need_open_comment, integer  $only_fans_can_comment = 1) : \EasyWeChat\Message\Article

回复文章消息

Parameters

string|array $title

标题

string $thumb_media_id

图文消息的封面图片素材id(必须是永久 media_ID)

string $source_url

图文消息的原文地址,即点击“阅读原文”后的URL

string $content

图文消息的具体内容,支持HTML标签,必须少于2万字符,小于1M,且此处会去除JS

string $author

作者

string $digest

图文消息的摘要,仅有单图文消息才有摘要,多图文此处为空

integer $show_cover_pic

是否显示封面,0为false,即不显示,1为true,即显示

integer $need_open_comment

是否打开评论,0不打开,1打开

integer $only_fans_can_comment

是否粉丝才可评论,0所有人可评论,1粉丝才可评论

Returns

\EasyWeChat\Message\Article

materialMessage()

materialMessage(string  $type, string  $media_id) : \EasyWeChat\Message\Material

回复素材消息

Parameters

string $type

[mpnews、 mpvideo、voice、image]

string $media_id

素材 ID

Returns

\EasyWeChat\Message\Material

staffTo()

staffTo(  $to,   $message) : boolean

作为客服消息发送

Parameters

$to
$message

Returns

boolean

getUserInfo()

getUserInfo(array|string  $openid) : \EasyWeChat\Support\Collection

获得用户信息

Parameters

array|string $openid

Returns

\EasyWeChat\Support\Collection

paymentOrder()

paymentOrder(  $openid,   $out_trade_no,   $total_fee,   $attach,   $body, string  $detail = '', string  $trade_type = 'JSAPI', array  $options = array()) : \EasyWeChat\Payment\Order

生成支付订单对象

Parameters

$openid
$out_trade_no
$total_fee
$attach
$body
string $detail
string $trade_type
array $options

Returns

\EasyWeChat\Payment\Order