可能是基于 hyperf 的最优雅的支付宝、微信支付 SDK 了

Last update: Jun 18, 2022

Logo

当前组件整体处于 beta 阶段

运行环境

  • php >= 7.3
  • composer
  • hyperf >= 2.1

安装

composer require yansongda/hyperf-pay:~1.0.0

说明

发布配置文件

php bin/hyperf.php vendor:publish yansongda/hyperf-pay

使用



declare(strict_types=1);

namespace App\Controller;

use Yansongda\HyperfPay\Pay;
use Hyperf\HttpServer\Annotation\AutoController;

/**
 * @AutoController()
 */
class IndexController extends AbstractController
{
    public function index(Pay $pay)
    {
        return $pay->alipay()->web([
            'out_trade_no' => ''.time(),
            'total_amount' => '0.01',
            'subject' => 'yansongda 测试 - 1',
        ]);
    }
}

详细文档

https://pay.yansongda.cn

GitHub

https://github.com/yansongda/hyperf-pay
You might also like...

It's a PHP Application to simplify working with Google Sheets SDK for php.

About GoogleSheetsPHP It's a PHP Application to simplify working with Google Sheets SDK for php. Note: i used Slim 3 to construct the application but

Jan 27, 2022

Explicador e2Payments PHP SDK

Explicador e2Payments PHP SDK

This package seeks to help php developers implement the e2Payments APIs without much hustle. It is based on the REST API whose documentation

Apr 27, 2022

Official PHP SDK for interacting with the Knock API.

Knock PHP library Documentation See the documentation for PHP usage examples

May 27, 2022

Laravel wrapper for the Facebook Graph PHP 8 SDK

Laravel Facebook Graph SDK Installation Getting started with Laravel Facebook Graph is easy - first, install the package via composer composer require

Jun 19, 2022

🧬 Nano is a zero-config, no skeleton, minimal Hyperf distribution that allows you to quickly build a Hyperf application with just a single PHP file.

Nano is a zero-config, no skeleton, minimal Hyperf distribution that allows you to quickly build a Hyperf application with just a single PHP file.

Jun 24, 2022

微信支付 API v3 的 PHP Library,同时也支持 API v2

微信支付 WeChatPay OpenAPI SDK [A]Sync Chainable WeChatPay v2&v3's OpenAPI SDK for PHP 概览 微信支付 APIv2&APIv3 的Guzzle HttpClient封装组合, APIv2已内置请求数据签名及XML转换器,应

Jun 24, 2022

Shopware PHP SDK is a simple SDK implementation of Shopware 6 APIs

Shopware PHP SDK is a simple SDK implementation of Shopware 6 APIs

Shopware PHP SDK is a simple SDK implementation of Shopware 6 APIs. It helps to access the API in an object-oriented way.

Jun 1, 2022

Zoho CRM API SDK is a wrapper to Zoho CRM APIs. By using this sdk, user can build the application with ease

Archival Notice: This SDK is archived. You can continue to use it, but no new features or support requests will be accepted. For the new version, refe

Apr 29, 2022

CORS (Cross-Origin Resource Sharing) middleware for Hyperf application.

CORS Middleware for Hyperf Implements fruitcake/laravel-cors for Hyperf. Features Handles CORS pre-flight OPTIONS requests Adds CORS headers to your r

Apr 13, 2022

🚀 Developing Rocketseat's Next Level Week (NLW#05) Application using PHP/Swoole + Hyperf

Inmana PHP 🚀 Developing Rocketseat 's Next Level Week (NLW#05) Application using Swoole + Hyperf. This is the app of the Elixir track. I know PHP/Swo

Jun 1, 2022

Simple user settings facade for Hyperf. Settings are stored as JSON in a single database column, so you can easily add it to an existing table.

hyperf-user-settings Simple user settings util for hyperf Settings are stored as JSON in a single database column, so you can easily add it to an exis

Oct 15, 2021

Hyperf instant messaging program based on swoole framework

Hyperf instant messaging program based on swoole framework

Hyperf instant messaging program based on swoole framework

Jun 23, 2022

高性能的验证器组件(Validation),适用于 Hyperf 或 Laravel 框架,可获得数百倍的性能提升

验证器 简介 兼容 Hyperf/Laravel Validation 规则 部分场景可获得约 500 倍性能提升 验证器可多次复用不同数据,无状态设计 规则可全局复用 智能合并验证规则 安装 环境要求 PHP = 8.0 mbstring 扩展 ctype 扩展 安装命令 composer re

Jun 9, 2022

fast Framework of Hyperf(一把梭快速骨架 CRUD快速开发)

fast-framework Hyperf 的一把梭骨架 composer require yogcloud/framework 功能 提供从 Controller Request Model Service Interface 一整套生成命令 $ php bin/hyperf gen g

Jun 24, 2022

An issue tracking tool based on hyperf+reactjs for small and medium-sized enterprises, open-source and free, similar to Jira.

An issue tracking tool based on hyperf+reactjs for small and medium-sized enterprises, open-source and free, similar to Jira.

介绍 本项目以 actionview 为蓝本,使用 Hyperf 框架进行重写。 本项目为 Hyperf 框架的 DEMO 项目 原 ActionView 介绍 English | 中文 一个类Jira的问题需求跟踪工具,前端基于reactjs+redux、后端基于php laravel-frame

May 30, 2022

🚀Hyperf is an extremely performant and flexible PHP CLI framework

🚀Hyperf is an extremely performant and flexible PHP CLI framework

Hyperf is an extremely performant and flexible PHP CLI framework, powered by a state-of-the-art coroutine server and a large number of battle-tested components. Aside from decisively beating PHP-FPM frameworks in benchmarks, Hyperf is unique in its focus on flexibility and composition.

Jun 26, 2022

Hyperf is an extremely performant and flexible PHP CLI framework

🚀 A coroutine framework that focuses on hyperspeed and flexibility. Building microservice or middleware with ease.

Jul 4, 2022

🎲 This project provides an integration for the Doctrine ORM and the Hyperf framework

Hyperf 🤝 Doctrine This project provides an integration for the Doctrine ORM and the Hyperf framework. Install composer require leocavalcante/hyperf-d

Mar 24, 2022

Quick start -d/reload/restart/stop hyperf(~2.1.0 & ~2.2.0) server

hyperf-helper 1. quick start -d/reload/restart/stop server 2. support hyperf ~2.1.0 & ~2.2.0 3. support CentOS7+, Ubuntu 18.0.4+, macOS 4. support swo

Jun 3, 2022
Comments
  • 1. 公众号支付,预下单,log出现预下单失败:响应缺少 prepay_id 参数

    按提示与微信官方提示报错,在使用_force强制替换了config配置,如下 weixin => [default=>[ 'mp_app_id' => 'xxx', 'mch_secret_key' => 'xxx', 'mch_secret_cert' => '/Users/lianka/Project/payCenter/app/Core/Cert/apiclient_key.pem', 'mch_public_cert_path' => '/Users/lianka/Project/payCenter/app/Core/Cert/apiclient_cert.pem', 'mch_id' => 'xx', 'sub_mch_id' => 'xx', 'notify_url' => 'https://yansongda.cn/wechat/notify',

    ]]

    增加参数sub_mch_id后,此报错依旧。想知道是传参方式有问题还是sub_mch_id字段名问题

    Reviewed by qchat-cloud at 2021-11-29 06:44
  • 2. [ERROR] Object of class Yansongda\Pay\Rocket could not be converted to string[136]

    hyperf版本:2.2 hyperf-pay版本: v1.0.0-beta.0

    [INFO] [AbstractProvider] 即将进行 pay 操作
    [ERROR] Object of class Yansongda\Pay\Rocket could not be converted to string[136] in /mnt/e/workspace/test/vendor/hyperf/framework/src/Logger/StdoutLogger.php
    [ERROR] #0 /mnt/e/workspace/test/vendor/hyperf/framework/src/Logger/StdoutLogger.php(136): str_replace()
    
    Reviewed by micross at 2021-07-26 06:36
  • 3. hyperf里面调用什么都不提示都报错这个咋回事

    [ERROR] Yansongda\Pay\Exception\InvalidResponseException: (5003) in /www/wwwroot/wash/apiadminHf/vendor/yansongda/pay/src/Functions.php:204 Stack trace: #0 /www/wwwroot/wash/apiadminHf/vendor/yansongda/pay/src/Plugin/Wechat/LaunchPlugin.php(32): verify_wechat_sign() #1 /www/wwwroot/wash/apiadminHf/vendor/yansongda/supports/src/Pipeline.php(126): Yansongda\Pay\Plugin\Wechat\LaunchPlugin->assembly() #2 /www/wwwroot/.com/wash/apiadminHf/vendor/yansongda/pay/src/Plugin/Wechat/SignPlugin.php(49): Yansongda\Supports\Pipeline->Yansongda\Supports{closure}() #3 /www/wwwroot/.com/wash/apiadminHf/vendor/yansongda/supports/src/Pipeline.php(126): Yansongda\Pay\Plugin\Wechat\SignPlugin->assembly()

    Reviewed by fengyikang88 at 2022-04-29 06:59
  • 4. https://pay.yansongda.cn/docs/v3/wechat/callback.html#%E5%8F%82%E6%95%B0

    https://pay.yansongda.cn/docs/v3/wechat/callback.html#%E5%8F%82%E6%95%B0

    最初由 yansongda 在 https://github.com/yansongda/hyperf-pay/issues/8#issuecomment-966932813 发布

    Reviewed by MidnightDJ at 2021-11-13 06:47
Mailgun's Official SDK for PHP

Mailgun PHP client This is the Mailgun PHP SDK. This SDK contains methods for easily interacting with the Mailgun API. Below are examples to get you s

Jun 17, 2022
A Laravel package to help integrate Shopware PHP SDK much more easier

Shopware 6 Laravel SDK A Laravel package to help integrate Shopware PHP SDK much more easier Installation Install with Composer composer require sas/s

May 17, 2022
Minter Blockchain PHP SDK

About This is a pure PHP SDK for working with Minter blockchain Installation Minter Api Methods: getBalance getNonce send getAddresses getStatus getVa

Mar 24, 2022
The official PHP SDK for Webmarketer (app.webmarketer.io)
The official PHP SDK for Webmarketer (app.webmarketer.io)

PHP SDK for Webmarketer The official PHP SDK for Webmarketer (app.webmarketer.io). Install To add this package, your project must meet several require

Dec 13, 2021
SDK for latest version of Telegram bots API

SDK for latest version of Telegram bots API (from April 24, 2020) Using Examples Installing composer require "DiyorbekUz/Telelib: dev-master" Init bot

Sep 5, 2021
A PHP SDK for the GlobalSmartOTP API.
A PHP SDK for the GlobalSmartOTP API.

GlobalSmartOTP PHP SDK A PHP SDK for the GlobalSmartOTP API. Requirements PHP 7.4 or higher cURL Installation $ git clone [email protected]:GlobalSmartOT

Apr 19, 2022
Fatture in Cloud SDK (Software Development Kit) for PHP

FattureInCloud PHP SDK Request informations In every request description you will be able to find some additional informations about context, permissi

Apr 28, 2022
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.

Telegram Bot API - PHP SDK Telegram Bot PHP SDK lets you develop Telegram Bots in PHP easily! Supports Laravel out of the box. Telegram Bot API is an

Jul 3, 2022
API SDK for OpenTrade Commerce API: Taobao, Alibaba, JD, 1688, Aliexpress, Ebay.

OtapiPhpClient Create Client $client = new OtClient($key, $secret, $lang); key (Access Key) secret (Secret for access key) language (2 symbol lang id

Dec 13, 2021
Laravel SDK for Sentry
Laravel SDK for Sentry

Sentry for Laravel Laravel integration for Sentry. Laravel Version Compatibility Laravel <= 4.2.x is supported until 0.8.x Laravel <= 5.7.x on PHP <=

Jun 29, 2022