# dedemao/alipay

一个PHP文件搞定支付宝支付系列，包括电脑网站支付，手机网站支付，现金红包、消费红包、扫码支付，JSAPI支付、单笔转账到支付宝账户、交易结算（分账、分润）、网页授权获取用户信息等

Repository: https://github.com/dedemao/alipay
Canonical: https://ross.abutalabs.com/products/dedemao-alipay
Homepage: https://www.dedemao.com/alipay/demo.html
Language: PHP
License: MIT
License Family: permissive
Last push: 2025-08-14T06:07:47+00:00

## Health v2 (maintenance only)
Score: 48/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 36, release rhythm 35, longevity 100
- inputs: {"age_days": 3204, "days_push": 384, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1392, forks 642 (observed 2026-08-28T04:04:36.040934+00:00)

## What it is
A collection of standalone single-file PHP scripts (~200 lines each) for integrating Alipay payments, covering PC and mobile web payments, QR/barcode payments, JSAPI, refunds, transfers, profit sharing, red envelopes, and OAuth user authorization. Each file runs independently with no external dependencies, requiring only PHP 5+ with CURL and SSL.

## Use cases
- accept alipay payments on a php website
- integrate alipay qr code payment without composer dependencies
- add alipay wap payment to a mobile site
- send cash red packets via alipay
- transfer money to an alipay account from php
- implement alipay refund in a single php file
- get alipay user info via web authorization
- split payments and settle transactions with alipay

## When to choose
- you need a dead-simple, dependency-free Alipay integration in PHP
- you only need one or two specific Alipay payment flows
- you want readable example code to learn the Alipay API quickly

## When to avoid
- you use a framework and prefer a maintained SDK with composer packages and tests
- you need payment gateways beyond Alipay/WeChat
- you require enterprise-grade error handling, logging, or PSR compliance

## Facets
- artifact type: library
- maturity: active
- function: sdk, http-client, developer-tools
- domain: fintech, e-commerce, web-development, backend
- platform: php, self-hosted
- tags: alipay, payment-integration, single-file, china, red-envelope, refund, transfer, web-server

## Member repositories
- dedemao/alipay (main) score 48

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:36.040934+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:39:32.359556+00:00, confidence not recorded.
  - readme: https://github.com/dedemao/alipay (fetched 2026-08-28T04:04:36.040934+00:00, sha c353bba12c32)
  - homepage: https://www.dedemao.com/alipay/demo.html (fetched 2026-08-29T11:54:25.154287+00:00, sha 84977f148ee8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
