Download the PHP package nizerin/alipay-sdk without Composer

On this page you can find all versions of the php package nizerin/alipay-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package alipay-sdk

Alipay SDK for PHP

🐜 支付宝开放平台(又称:蚂蚁金服开放平台)第三方 PHP SDK,基于官方 3.3.1 版本。

❤️ 本项目 GitHub ,目前已在公司产品应用,运行在数百台客户服务器内。

🎉 百度小程序第三方 PHP SDK

为什么不用官方

官方 SDK 本 SDK 链接
无 Composer 集成,自动加载依赖第三方 PHP 框架 lotusphp 集成 Packagist
代码不严谨,各种 Warning 持续构建,Notice 也不放过 Build Status
零单元测试 99% 测试覆盖率 Coverage Status
代码风格、命名风格鱼龙混杂 PSR1 + PSR2 StyleCI
弃用特性残留 已根据官方文档移除
奇葩测试文件残留 已移除 讨论帖
几乎零 PHPDoc 持续补充中 对比图
请求类居然没有抽象基类或接口 抽象基类,公共方法统一化 AbstractAlipayRequest
异常和错误处理不统一 所有错误都将以异常的形式抛出,确保返回数据可靠 Exceptions
需手动根据接口名拼接请求类名 请求类工厂,根据 API 名直接创建请求类 AlipayRequestFactory
耦合度高,难以升级或替换 几乎完全解耦,任意替换签名 / 密钥 / 响应 甚至 HTTP 客户端 AopClient

主要目的

目前,开源圈内已有不少质量不错的支付宝「支付」相关扩展包;而支付宝「小程序」推出不久,目前仍处于公测阶段。此项目的初衷并不是 Yet another,而是填补小程序 API 的空缺,文档和示例也将会有所侧重。

小试牛刀

如何使用

  1. Composer 安装。

    Composer 中国镜像近期处于维护状态;若无法安装,建议使用原版 Packagist 或使用 Laravel-China 镜像

  2. 创建 AlipayKeyPair 实例。

    AlipayKeyPair 用于存储应用私钥、支付宝公钥;两份密钥将分别用于与支付宝服务器通信时,生成请求签名、验证响应签名等。

  3. 创建 AopClient 实例。

    AopClient 通常情况会贯穿整条业务,除非你须要在同一套代码内处理多个商户号/小程序,否则只需在初始化阶段创建一次即可。

  4. 根据业务需要,创建 AlipayRequest 实例。

    另外,你也可以不使用请求类工厂,就像官方文档那样,手动创建请求类。

    例如:

  5. 发送请求,获得响应数据。

    所有错误(包括但不限于网络通信异常、数据格式异常、支付宝服务器返回的错误)都会被转换为异常,请注意捕捉。

  6. 更多实例,请移步 examples 目录。

    最后,官方 SDK 内 AopClient::pageExecute() 被分离为 pageExecuteUrlpageExecuteFormAopClient::sdkExecute()AopClient::execute() 方法名保持不变,参数和返回值有所改动。

注意事项

实用工具

可执行文件位于 详细说明。

其它资源

已知 Issue

OpenSSL 在 Win32 平台需要配置 openssl.cnf 路径,参见 OpenSSL 安装 - PHP 手册

在本 SDK 内,也可通过自定义 $configargs 参数来自定义此文件路径,而不需要配置环境变量;参见 examples/keys/generate.php。

目前已知以下方法依赖于此配置文件:

感谢

感想

最后,一点感想。

作为一个名不见经传的小白,不敢妄言阿里的工程师技术欠佳;但可以确定的是,官方提供的 PHP SDK 绝对不是用心之作。

做开放平台,对待第三方开发者是这样的态度,怎能做到与微信比肩?

硬广,欢迎关注我们的产品:


All versions of alipay-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
ext-openssl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nizerin/alipay-sdk contains the following files

Loading the files please wait ....