All Projects → imaxwen → Yii2 Easy Wechat

imaxwen / Yii2 Easy Wechat

Licence: mit
WeChat SDK for yii2 , based on overtrue/wechat.

Projects that are alternatives of or similar to Yii2 Easy Wechat

Cordova Plugin Wechat
A cordova plugin, a JS version of Wechat SDK
Stars: ✭ 1,198 (+537.23%)
Mutual labels:  wechat-sdk, wechat
Rageframe2
一个基于Yii2高级框架的快速开发应用引擎
Stars: ✭ 1,553 (+726.06%)
Mutual labels:  yii, wechat
Wechat
API, command and message handling for WeChat in Rails
Stars: ✭ 1,251 (+565.43%)
Mutual labels:  wechat-sdk, wechat
Gopay
QQ、微信(WeChat)、支付宝(AliPay)的Go版本SDK。【微信支付V3已支持,推荐使用微信V3接口】
Stars: ✭ 1,034 (+450%)
Mutual labels:  wechat-sdk, wechat
Wechat Api
🗯 wechat-api by java7.
Stars: ✭ 1,813 (+864.36%)
Mutual labels:  wechat-sdk, wechat
Wechat
Wechat API wrapper in Elixir
Stars: ✭ 70 (-62.77%)
Mutual labels:  wechat-sdk, wechat
Weixin Java Cp Demo
基于Spring Boot 和 WxJava 实现的微信企业号/企业微信 后端Demo
Stars: ✭ 175 (-6.91%)
Mutual labels:  wechat-sdk, wechat
Weixin Java Miniapp Demo
基于Spring Boot 和 WxJava 实现的微信小程序Java后端Demo
Stars: ✭ 779 (+314.36%)
Mutual labels:  wechat-sdk, wechat
Yii2 Wx
这可能是yii2中最好用的微信SDK🔥🔥🔥
Stars: ✭ 148 (-21.28%)
Mutual labels:  wechat-sdk, wechat
Gochat
🔥 微信 Go SDK 🚀🚀🚀
Stars: ✭ 141 (-25%)
Mutual labels:  wechat-sdk, wechat
Tom Vpr
how does voiceprint recognition work in wechat page
Stars: ✭ 37 (-80.32%)
Mutual labels:  wechat-sdk, wechat
Go Workwx
a sensible Work Weixin(企业微信, Wechat Work) SDK for Go
Stars: ✭ 181 (-3.72%)
Mutual labels:  wechat-sdk, wechat
Entwechat
📦 WeChat Enterprise SDK based on EasyWeChat 3.X
Stars: ✭ 12 (-93.62%)
Mutual labels:  wechat-sdk, wechat
Weixinsdk
微信开发SDK。
Stars: ✭ 177 (-5.85%)
Mutual labels:  wechat-sdk, wechat
Weixinmpsdk
微信全平台 SDK Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 6.0。已支持微信公众号、小程序、小游戏、企业号、企业微信、开放平台、微信支付、JSSDK、微信周边等全平台。 WeChat SDK for C#.
Stars: ✭ 7,098 (+3675.53%)
Mutual labels:  wechat-sdk, wechat
Easyopenwechat
微信公众号第三方平台SDK
Stars: ✭ 105 (-44.15%)
Mutual labels:  wechat-sdk, wechat
Diplomat
整合第三方 SDK 微信、微博、 QQ 等为统一的 Diplomat 接口。
Stars: ✭ 672 (+257.45%)
Mutual labels:  wechat-sdk, wechat
Python Weixin
微信(weixin|wechat) Python SDK 支持开放平台和公众平台 支持微信小程序云开发
Stars: ✭ 746 (+296.81%)
Mutual labels:  wechat-sdk, wechat
Oss.clients.sns
社交网站sdk(标准库),微信公众号(订阅号,服务号,小程序)接口sdk-包含消息回复(明文和安全模式),Oauth2.0授权等
Stars: ✭ 136 (-27.66%)
Mutual labels:  wechat-sdk, wechat
Caswechat
caswechat 微信全接口SDK封装
Stars: ✭ 155 (-17.55%)
Mutual labels:  wechat-sdk, wechat

yii2-easy-wechat

WeChat SDK for yii2 , based on overtrue/wechat.
This extension helps you access overtrue/wechat application in a simple & familiar way: Yii::$app->wechat.

Latest Stable Version Total Downloads License

Installation

composer require maxwen/yii2-easy-wechat

Configuration

Add the SDK as a yii2 application component in the config/main.php:

'components' => [
	// ...
	'wechat' => [
		'class' => 'maxwen\easywechat\Wechat',
		// 'userOptions' => []  # user identity class params
		// 'sessionParam' => '' # wechat user info will be stored in session under this key
		// 'returnUrlParam' => '' # returnUrl param stored in session
	],
	// ...
]

Usage

// here are two representative examples that will help you:

// 微信网页授权:
if(Yii::$app->wechat->isWechat && !Yii::$app->wechat->isAuthorized()) {
	return Yii::$app->wechat->authorizeRequired()->send();
}

// 微信支付(JsApi):
$orderData = [ 
	'openid' => '.. '
	// ... etc. 
];
$order = new WechatOrder($orderData);
$payment = Yii::$app->wechat->payment;
$prepayRequest = $payment->prepare($order);
if($prepayRequest->return_code = 'SUCCESS' && $prepayRequest->result_code == 'SUCCESS') {
	$prepayId = $prepayRequest->prepay_id;
}else{
	throw new yii\base\ErrorException('微信支付异常, 请稍后再试');
}

$jsApiConfig = $payment->configForPayment($prepayId);

return $this->render('wxpay', [
	'jsApiConfig' => $jsApiConfig,
	'orderData'   => $orderData
]);

How to load Wechat configures?

the overtrue/wechat application always constructs with a $options parameter. I made the options as a yii2 param in the params.php:

recomended way:

// in this way you need to create a wechat.php in the same directory of params.php
// put contents in the wechat.php like:
// return [ 
// 		// wechat options here 
// ];
'WECHAT' => require(__DIR__.'/wechat.php'),

OR

'WECHAT' => [ // wechat options here ]

Wechat options configure help docs.

More documentation

see EasyWeChat Docs.

Thanks to overtrue/wechat , realy a easy way to play with wechat SDK 😁.

More repos for Yii2:

yii2-ckeditor-widget
yii2-adminlte-gii
yii2-curl

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].