Download the PHP package easyalipay/easyalipay without Composer

On this page you can find all versions of the php package easyalipay/easyalipay. 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 easyalipay

支付宝 Alipay OpenAPI SDK

[A]Sync Chainable Alipay OpenAPI SDK for PHP

GitHub actions Version PHP Version License

概览

支付宝 OpenAPI 的Guzzle HttpClient封装组合, 内置 请求签名应答验签 两个middlewares中间件,创新性地实现了链式面向对象同步/异步调用远程接口。

如果你是使用 Guzzle 的商户开发者,可以使用 EasyAlipay\Builder::factory 工厂方法直接创建一个 GuzzleHttp\Client 的链式调用封装器, 实例在执行请求时将自动携带身份认证信息,并检查应答的支付宝的返回签名。

环境要求

我们开发和测试使用的环境如下:

注:

安装

推荐使用PHP包管理工具composer引入SDK到项目中:

方式一

在项目目录中,通过composer命令行添加:

方式二

在项目的composer.json中加入以下配置:

添加配置后,执行安装

约定

本类库是以 OpenAPI 公共请求参数中的接入方法 method.做切分,映射成attributes,编码书写方式有如下约定:

  1. 请求 接入方法 method 切分后的每个attributes,可直接以对象获取形式串接,例如 alipay.trade.query 即串成 alipay->trade->query;
  2. 每个 接入方法 method 所支持的 HTTP METHOD,即作为被串接对象的末尾执行方法,例如: alipay->trade->query->post(['content' => []]);
  3. 每个 接入方法 method 所支持的 HTTP METHOD,同时支持Async语法糖,例如: alipay->trade->query->postAsync(['content' => []]);
  4. 每个 接入方法 method 可以使用PascalCase风格书写,例如: alipay.trade.query可写成 AlipayTradeQuery;
  5. 在IDE集成环境下,也可以按照内置的chain($method)接口规范,直接以接入方法 method作为变量入参,来获取OpenAPI当前接入方法的实例,驱动末尾执行方法(填入对应参数),发起请求,例如 chain('alipay.trade.query')->post(['content' => []])
  6. 末尾get/post/getAsync/postAsync请求方法语法糖,型参$options语法糖规则如下:
    1. content字典,对应的是请求参数集合(biz_content)字典,直接写原生PHP array即可;
    2. query字典,对应的是除请求参数集合(biz_content)之外的,如部分特殊公共请求参数(system_params)通知地址(notify_url)等,直接写原生PHP array即可;
    3. 一个入参时$options按需带入'content' => [] 及/或 'query' => []结构即可;
    4. 简写语法糖支持[get|post][Async](array $content, array $options)[get|post][Async](array $content, array $query, array $options)结构;
    5. 本SDK所有请求数据结构遵循官方开发文档,该是蛇型即蛇形(如:service_code),该是驼峰就驼峰(如:shopIds),看到的数据结构,即请求数据结构,原生PHP语法即可;
  7. 内置返回值验签中间件在解构原始json字符串后,直接返回*_response对应的内容,有可能是json,也可能是AesCbc加密串,按需对返回串做处理;

以下示例用法,以异步(Async/PromiseA+)同步(Sync)结合此种编码模式展开。

开始

首先,通过 EasyAlipay\Builder::factory 工厂方法构建一个实例,然后如上述约定,链式同步异步请求远端OpenAPI接口。

初始化字典说明如下:

注: OpenAPI 以及 GuzzleHttp\Clientarray $config 初始化参数,均融合在一个型参上。

统一收单线下交易查询

统一收单交易支付接口

统一收单线下交易预创建

手机网站支付接口2.0

统一收单下单并支付页面接口

上传门店照片和视频接口

敏感信息加/解密

链接

许可证

MIT


All versions of easyalipay with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.2
ext-curl Version *
ext-libxml Version *
ext-simplexml Version *
ext-openssl Version *
guzzlehttp/guzzle Version ^6.5 || ^7.0
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 easyalipay/easyalipay contains the following files

Loading the files please wait ....