All Projects → lokielse → Omnipay Wechatpay

lokielse / Omnipay Wechatpay

Licence: mit
(微信支付)WeChatPay driver for the Omnipay PHP payment processing library

Projects that are alternatives of or similar to Omnipay Wechatpay

Gopay
golang语言实现的支付模块,支持支付宝app,支付宝网页版,微信app,微信公众号支付
Stars: ✭ 151 (-49.67%)
Mutual labels:  payment, wechat
Pay
可能是我用过的最优雅的 Alipay 和 WeChat 的支付 SDK 扩展包了
Stars: ✭ 4,176 (+1292%)
Mutual labels:  payment, wechat
Gopay
golang支付:微信公众号,微信app,微信小程序,微信企业支付,支付宝网页版,支付宝app,支付宝企业支付
Stars: ✭ 313 (+4.33%)
Mutual labels:  payment, wechat
Laravel Pay
可能是我用过的最优雅的 Alipay 和 WeChat 的 laravel 支付扩展包了
Stars: ✭ 856 (+185.33%)
Mutual labels:  payment, wechat
Node Tenpay
微信支付 for nodejs
Stars: ✭ 947 (+215.67%)
Mutual labels:  payment, wechat
Weixin Pay
微信支付
Stars: ✭ 863 (+187.67%)
Mutual labels:  payment, wechat
Pay
个人网站即时到账收款解决方案 / Personal website instant payment solution
Stars: ✭ 558 (+86%)
Mutual labels:  payment, wechat
Wego
a wechat sdk for golang
Stars: ✭ 47 (-84.33%)
Mutual labels:  payment, wechat
Sdk3rd
第三方SDK集成库,授权/分享/支付
Stars: ✭ 249 (-17%)
Mutual labels:  payment, wechat
Wechatassistant
(放弃维护)PC端微信小工具:撤回消息备份,关键词监听,公众号签到,截图,自定义内容的自动回复,今天吃什么(fun)
Stars: ✭ 285 (-5%)
Mutual labels:  wechat
Weixin Spider
微信公众号爬虫,公众号历史文章,文章评论,文章阅读及在看数据,可视化web页面,可部署于Windows服务器。基于Python3之flask/mysql/redis/mitmproxy/pywin32等实现,高效微信爬虫,微信公众号爬虫,历史文章,文章评论,数据更新。
Stars: ✭ 287 (-4.33%)
Mutual labels:  wechat
Weixinresource
微信开发资源汇总 | WeChat Development Resources Summary
Stars: ✭ 279 (-7%)
Mutual labels:  wechat
Wechat
仿微信,注释齐全,方便初学者食用。
Stars: ✭ 286 (-4.67%)
Mutual labels:  wechat
Swiftscan
A barcode and qr code scanner( 二维码/条形码扫描、生成,仿微信、支付宝)
Stars: ✭ 293 (-2.33%)
Mutual labels:  wechat
Weapp Demo Breadtrip
基于面包旅行 API 制作的微信小程序示例
Stars: ✭ 282 (-6%)
Mutual labels:  wechat
Laravel Socialite
Social OAuth Authentication for Laravel 5. drivers: facebook, github, google, linkedin, weibo, qq, wechat and douban
Stars: ✭ 296 (-1.33%)
Mutual labels:  wechat
React Native Puti Pay
基于 React Native 的微信支付,支付宝支付插件
Stars: ✭ 277 (-7.67%)
Mutual labels:  wechat
Ijpay
IJPay 让支付触手可及,封装了微信支付、QQ支付、支付宝支付、京东支付、银联支付、PayPal 支付等常用的支付方式以及各种常用的接口。不依赖任何第三方 mvc 框架,仅仅作为工具使用简单快速完成支付模块的开发,可轻松嵌入到任何系统里。右上角点下小星星✨
Stars: ✭ 3,561 (+1087%)
Mutual labels:  payment
Crmeb
🔥🔥🔥 CRMEB打通版v4免费开源商城系统,uni-app+thinkphp6框架商城,系统可商用;包含小程序商城、H5商城、公众号商城、PC商城,支持分销、拼团、砍价、秒杀、优惠券、积分、会员等级、小程序直播、可视化设置,前后端分离,方便二开,更有详细使用文档、接口文档、数据字典、二开文档/视频教程,欢迎大家提出宝贵意见和建议
Stars: ✭ 3,447 (+1049%)
Mutual labels:  wechat
Fire Shop Lite
前端开源微信电商小程序,拼团+砍价+分销
Stars: ✭ 294 (-2%)
Mutual labels:  wechat

Omnipay: WechatPay

WechatPay driver for the Omnipay PHP payment processing library

Build Status Latest Stable Version Total Downloads

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements WechatPay support for Omnipay.

Installation

Omnipay is installed via Composer. To install:

composer require lokielse/omnipay-wechatpay

Basic Usage

The following gateways are provided by this package:

  • WechatPay (Wechat Common Gateway) 微信支付通用网关
  • WechatPay_App (Wechat App Gateway) 微信APP支付网关
  • WechatPay_Native (Wechat Native Gateway) 微信原生扫码支付支付网关
  • WechatPay_Js (Wechat Js API/MP Gateway) 微信网页、公众号、小程序支付网关
  • WechatPay_Pos (Wechat Micro/POS Gateway) 微信刷卡支付网关
  • WechatPay_Mweb (Wechat H5 Gateway) 微信H5支付网关

Usage

Create Order doc

//gateways: WechatPay_App, WechatPay_Native, WechatPay_Js, WechatPay_Pos, WechatPay_Mweb
$gateway    = Omnipay::create('WechatPay_App');
$gateway->setAppId($config['app_id']);
$gateway->setMchId($config['mch_id']);
$gateway->setApiKey($config['api_key']);

$order = [
    'body'              => 'The test order',
    'out_trade_no'      => date('YmdHis').mt_rand(1000, 9999),
    'total_fee'         => 1, //=0.01
    'spbill_create_ip'  => 'ip_address',
    'fee_type'          => 'CNY'
];

/**
 * @var Omnipay\WechatPay\Message\CreateOrderRequest $request
 * @var Omnipay\WechatPay\Message\CreateOrderResponse $response
 */
$request  = $gateway->purchase($order);
$response = $request->send();

//available methods
$response->isSuccessful();
$response->getData(); //For debug
$response->getAppOrderData(); //For WechatPay_App
$response->getJsOrderData(); //For WechatPay_Js
$response->getCodeUrl(); //For Native Trade Type

Notify doc

$gateway    = Omnipay::create('WechatPay');
$gateway->setAppId($config['app_id']);
$gateway->setMchId($config['mch_id']);
$gateway->setApiKey($config['api_key']);

$response = $gateway->completePurchase([
    'request_params' => file_get_contents('php://input')
])->send();

if ($response->isPaid()) {
    //pay success
    var_dump($response->getRequestData());
}else{
    //pay fail
}

Query Order doc

$response = $gateway->query([
    'transaction_id' => '1217752501201407033233368018', //The wechat trade no
])->send();

var_dump($response->isSuccessful());
var_dump($response->getData());

Close Order doc

$response = $gateway->close([
    'out_trade_no' => '201602011315231245', //The merchant trade no
])->send();

var_dump($response->isSuccessful());
var_dump($response->getData());

Refund doc

$gateway->setCertPath($certPath);
$gateway->setKeyPath($keyPath);

$response = $gateway->refund([
    'transaction_id' => '1217752501201407033233368018', //The wechat trade no
    'out_refund_no' => $outRefundNo,
    'total_fee' => 1, //=0.01
    'refund_fee' => 1, //=0.01
])->send();

var_dump($response->isSuccessful());
var_dump($response->getData());

QueryRefund doc

$response = $gateway->queryRefund([
    'refund_id' => '1217752501201407033233368018', //Your site trade no, not union tn.
])->send();

var_dump($response->isSuccessful());
var_dump($response->getData());

Shorten URL (for WechatPay_Native) doc

$response = $gateway->shortenUrl([
    'long_url' => $longUrl
])->send();

var_dump($response->isSuccessful());
var_dump($response->getData());
var_dump($response->getShortUrl());

Query OpenId (for WechatPay_Pos) doc

$response = $gateway->queryOpenId([
    'auth_code' => $authCode
])->send();

var_dump($response->isSuccessful());
var_dump($response->getData());
var_dump($response->getOpenId());

For general usage instructions, please see the main Omnipay repository.

Related

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

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].