# sixshop-wechatpay **Repository Path**: sixdec-1/wechatpay ## Basic Information - **Project Name**: sixshop-wechatpay - **Description**: 微信支付相关功能封装 - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: v1.x - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-08-28 - **Last Updated**: 2026-03-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 微信支付 微信支付扩展包,为 SixShop 商城系统提供微信支付功能支持。 ## 功能特性 - 微信支付订单创建 - 支付结果异步通知处理 - 支付订单查询 - 退款申请与查询 - 发货信息上传 - 运单信息跟踪 ## 安装 ```bash composer require six-shop/wechatpay ``` ## 配置说明 在后台管理系统中配置以下参数: | 参数 | 说明 | 是否必填 | |------|------|---------| | mchid | 商户号 | 是 | | appid | 开发者ID | 否 | | apiclient_cert | 商户API证书 | 否 | | apiclient_key | 商户API私钥 | 否 | | serial_no | 商户API证书序列号 | 否 | | public_key | 微信支付公钥 | 否 | | public_key_id | 微信支付公钥ID | 否 | | api_v3_key | APIv3密钥 | 否 | | platform_no | 平台证书序列号 | 否 | | platform_cert | 平台证书 | 否 | | sandbox | 是否启用沙箱环境 | 否 | | notify_url | 支付回调地址 | 是 | | refund_notify_url | 退款回调地址 | 否 | ## 使用方法 ### 创建支付订单 ```php $provider = app(\SixShop\WechatPay\PaymentProvider::class); $response = $provider->create($orderData, PaymentBizEnum::ORDER); ``` ### 处理支付回调 ```php // 在控制器中处理微信支付回调 public function notify(PaymentManager $paymentManager): Response { $requestData = [ 'headers' => getallheaders(), 'inBody' => file_get_contents('php://input'), ]; $result = $paymentManager->getPaymentProvider('wechatpay')->notify($requestData); return success_response(msg: '回调成功'); } ``` ### 查询支付状态 ```php $provider = app(\SixShop\WechatPay\PaymentProvider::class); $result = $provider->query($recordID); ``` ### 申请退款 ```php $provider = app(\SixShop\WechatPay\PaymentProvider::class); $refundRequest = new PaymentRefundRequest($amount, $reason); $result = $provider->refund($recordID, $refundRequest); ``` ### 查询退款状态 ```php $provider = app(\SixShop\WechatPay\PaymentProvider::class); $result = $provider->refundQuery($refundID); ``` ## 技术支持 如有问题请联系: - 邮箱: runphp@qq.com - 作者: hui he