Download the PHP package iqianfang/yii2alipay without Composer

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

Yii2支付宝即时到帐接口组件

适用于支付宝即时到帐接口,具体使用方法如下:

安装

通过composer安装,在项目目录下运行如下代码:

或者修改composer.json的require部分,添加

配置使用

一、配置Yii2组件

在common下的全局配置文件main.php中添加组件配置,请参考如下alipay的配置:

注意:一些固定配置/不常用配置放到组件类的init里了,有用到的可以去那里改。

二、逻辑处理

1、支付请求提交

在需要发起支付请求的地方调用

其中order是你的订单实例,通过它可以获取到订单号支付总价等,如果你的逻辑用不到或者与此不同,请自行修改

2、支付结果通知

根据配置里设置的控制器及action编写代码。以上面我的配置为例,创建控制器Payment,该控制器用于接受支付宝同步/异步通知,下面两个action分别对应配置中设定的action(我的逻辑比较简单所以处理都放组件了,你的视情况自己看着办):

其他

没用curl,直接用了官方demo的现成代码,如果有需要请参考支付宝官方文档再进一步处理即可。 别忘了配置urlManager,开启url美化,否则通知url会有参数,通知会失败


All versions of yii2alipay with dependencies

PHP Build Version
Package Version
No informations.
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 iqianfang/yii2alipay contains the following files

Loading the files please wait ....