All Projects → xhat → payjs-laravel

xhat / payjs-laravel

Licence: other
基于 PAYJS 微信支付个人接口开发的 Laravel Package,可直接用于生产环境

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to payjs-laravel

payjs
基于 PAYJS 微信支付个人接口开发的 Package,可直接用于生产环境
Stars: ✭ 73 (+28.07%)
Mutual labels:  payment, wepay, wechatpay, payjs
tezos-reward-distributor
Tezos Reward Distributor (TRD): A reward distribution software for tezos bakers.
Stars: ✭ 80 (+40.35%)
Mutual labels:  payment
pardakhtyari
کتابخانه ها و مستندات مربوط به روال پرداخت یاری شاپرک - طبق مستندات رسمی شاپرک
Stars: ✭ 22 (-61.4%)
Mutual labels:  payment
solidus paypal braintree
💳Integrate Solidus with Braintree, including PayPal and Apple Pay support
Stars: ✭ 30 (-47.37%)
Mutual labels:  payment
adyen-python-api-library
Adyen API Library for Python
Stars: ✭ 41 (-28.07%)
Mutual labels:  payment
Card-Tray-Demo
A clone of Apple's Wallet app
Stars: ✭ 40 (-29.82%)
Mutual labels:  payment
awesome-open-finance
A curated list of open finance and open banking resources
Stars: ✭ 92 (+61.4%)
Mutual labels:  payment
QSPay
😀安卓一行代码☕搞定微信支付、支付宝支付、银联支付
Stars: ✭ 28 (-50.88%)
Mutual labels:  payment
HiveMind
HiveMind is a project management and ERP application for services organizations. It features project/task management, request tracking, time tracking, expenses, invoices/payments, general ledger, and content management (wiki). HiveMind is based on Moqui Framework, Mantle Business Artifacts, and Simple Screens.
Stars: ✭ 40 (-29.82%)
Mutual labels:  payment
nanook
Ruby library for making and receiving payments and managing a nano currency node
Stars: ✭ 17 (-70.18%)
Mutual labels:  payment
doc
The bunq API documentation
Stars: ✭ 18 (-68.42%)
Mutual labels:  payment
payment
MoMo Payment
Stars: ✭ 114 (+100%)
Mutual labels:  payment
cashier
Cashier is an Elixir library that aims to be an easy to use payment gateway, whilst offering the fault tolerance and scalability benefits of being built on top of Erlang/OTP
Stars: ✭ 43 (-24.56%)
Mutual labels:  payment
bitcoincashjs
WARNING: This project is no longer maintained. Please, use bitcore-lib-cash instead.
Stars: ✭ 80 (+40.35%)
Mutual labels:  payment
fake-toss-payments-server
Fake Toss Payments Server with Real SDK Library
Stars: ✭ 242 (+324.56%)
Mutual labels:  payment
cashier-paystack
Cashier provides an expressive, fluent interface to Paystack's subscription billing services.
Stars: ✭ 44 (-22.81%)
Mutual labels:  payment
woocommerce-simplify-payment-gateway-plugin
WooCommerce Payment Gateway plugin from Simplify Commerce
Stars: ✭ 28 (-50.88%)
Mutual labels:  payment
payments-request-api-example
What is the Native Payments Request API?
Stars: ✭ 26 (-54.39%)
Mutual labels:  payment
adyen-salesforce-commerce-cloud
Salesforce Commerce Cloud (formerly Demandware)
Stars: ✭ 63 (+10.53%)
Mutual labels:  payment
react-native-upi
A tiny module for Adding payments via UPI in your react native apps ❤️
Stars: ✭ 41 (-28.07%)
Mutual labels:  payment

PAYJS Wechat Payment Laravel Package

Latest Stable Version Total Downloads License

简介

本项目是基于 PAYJS 的 API 开发的 Laravel Package,可直接用于生产环境

PAYJS 针对个人主体提供微信支付接入能力,是经过检验的正规、安全、可靠的微信支付个人开发接口

其它版本: PAYJS 通用开发包

支持Laravel 5.x、Laravel 6.x、Laravel 7.x、Laravel 8.x

安装

通过 Composer 安装

$ composer require xhat/payjs-laravel

使用方法

一、发布并修改配置文件

  • 发布配置文件
php artisan vendor:publish --provider="Xhat\Payjs\PayjsServiceProvider"
  • 编辑配置文件 config/payjs.php 配置商户号和通信密钥
return [
    'mchid' => '', // 填写商户号
    'key'   => '', // 填写通信KEY
];

二、在业务中使用

首先在业务模块中引入门面

use Xhat\Payjs\Facades\Payjs;
  • 扫码支付
// 构造订单基础信息
$data = [
    'body' => '订单测试',                                // 订单标题
    'total_fee' => 2,                                   // 订单标题
    'out_trade_no' => time(),                           // 订单号
    'attach' => 'test_order_attach',                    // 订单附加信息(可选参数)
    'notify_url' => 'https://www.baidu.com/notify',     // 异步通知地址(可选参数)
];
return Payjs::native($data);
  • 收银台模式支付(直接在微信浏览器打开)
// 构造订单基础信息
$data = [
    'body' => '订单测试',                                    // 订单标题
    'total_fee' => 2,                                       // 订单金额
    'out_trade_no' => time(),                               // 订单号
    'attach' => 'test_order_attach',                        // 订单附加信息(可选参数)
    'notify_url' => 'https://www.baidu.com/notify',         // 异步通知地址(可选参数)
    'callback_url' => 'https://www.baidu.com/callback',     // 支付后前端跳转地址(可选参数)
];
$url = Payjs::cashier($data);
return redirect($url);
  • JSAPI模式支付
// 构造订单基础信息
$data = [
    'body' => '订单测试',                                    // 订单标题
    'total_fee' => 2,                                       // 订单金额
    'out_trade_no' => time(),                               // 订单号
    'attach' => 'test_order_attach',                        // 订单附加信息(可选参数)
    'openid' => 'xxxxxxxxxxxxxxxxx',                        // 订单附加信息(可选参数)
    'notify_url' => 'https://www.baidu.com/notify',         // 异步通知地址(可选参数)
];
return Payjs::jsapi($data);
  • H5支付
// 构造订单基础信息
$data = [
    'body' => '订单测试',                                    // 订单标题
    'total_fee' => 2,                                       // 订单金额
    'out_trade_no' => time(),                               // 订单号
    'attach' => 'test_order_attach',                        // 订单附加信息(可选参数)
    'notify_url' => 'https://www.baidu.com/notify',         // 异步通知地址(可选参数)
    'callback_url' => 'https://www.baidu.com',              // 前端跳转地址(可选参数)
];
return Payjs::mweb($data);
  • 投诉查询
// 构造订单基础信息
$data = [
    'mchid' => '123123',                                    // 商户号
];
return Payjs::complaint($data);
  • 查询订单
// 根据订单号查询订单状态
$payjs_order_id = '****************';
return Payjs::check($payjs_order_id);
  • 关闭订单
// 根据订单号关闭订单
$payjs_order_id = '****************';
return Payjs::close($payjs_order_id);
  • 退款
// 根据订单号退款
$payjs_order_id = '****************';
return Payjs::refund($payjs_order_id);
  • 获取商户资料
// 返回商户基础信息
return Payjs::info();
  • 获取用户资料
// 根据订单信息中的 OPENID 查询用户资料
$openid = '***************';
return Payjs::user($openid);
  • 查询银行名称
// 根据订单信息中的银行编码查询银行中文名称
$bank = '***************';
return Payjs::bank($bank);
  • 接收异步通知
// 接收异步通知,无需关注验签动作,已自动处理
$notify_info = Payjs::notify();
Log::info($notify_info);

更新日志

Version 1.5.0 增加投诉API、H5支付API

Version 1.4 修正空值参数的过滤问题

安全相关

如果您在使用过程中发现各种 bug,请积极反馈,我会尽早修复

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