Download the PHP package wangchen/payment without Composer

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

Pay

StyleCI Scrutinizer Code Quality Build Status Latest Stable Version Total Downloads Latest Unstable Version License

!注意:v1.x 版本将不做新功能开发,只进行 bug 维护!请大家尽快迁移到 v2 版本!

开发了多次支付宝与微信支付后,很自然产生一种反感,惰性又来了,想在网上找相关的轮子,可是一直没有找到一款自己觉得逞心如意的,要么使用起来太难理解,要么文件结构太杂乱,只有自己撸起袖子干了。

说明,请先熟悉支付宝说明文档!!

欢迎 Star,欢迎 PR!

laravel 扩展包请 https://github.com/yansongda/laravel-pay

特点

运行环境

支持的支付网关

由于各支付网关参差不齐,所以我们抽象了两个方法 driver()gateway()

两个方法的作用如下:

driver() : 确定支付平台,如 alipay,wechat;

gateway(): 确定支付网关。通过此方法,确定支付平台下的支付网关。例如,支付宝下有 「电脑网站支付」,「手机网站支付」,「APP 支付」三种支付网关,通过传入 web,wap,app 确定。

详细思路可以查看源代码。

1、支付宝

SDK 中对应的 driver 和 gateway 如下表所示:

driver gateway 描述
alipay web 电脑支付
alipay wap 手机网站支付
alipay app APP 支付
alipay pos 刷卡支付
alipay scan 扫码支付
alipay transfer   帐户转账(可用于平台用户提现)

2、微信

SDK 中对应的 driver 和 gateway 如下表所示:

driver gateway 描述
wechat mp 公众号支付
wechat miniapp 小程序支付
wechat wap H5 支付
wechat scan 扫码支付
wechat pos 刷卡支付
wechat app APP 支付
wechat transfer 企业付款

支持的方法

所有网关均支持以下方法

安装

使用说明

0、一个完整的例子:

1、准备配置参数

2、在代码中使用

错误

使用非跳转接口(如, refund 接口,close 接口)时,如果在调用相关支付网关 API 时有错误产生,会抛出 GatewayException 错误,可以通过 $e->getMessage() 查看,同时,也可通过 $e->raw 查看调用 API 后返回的原始数据,该值为数组格式。

支付网关配置说明与返回值

由于支付网关不同,每家参数参差不齐,为了方便,我们抽象定义了两个参数:$config,$config_biz,分别为全局参数,业务参数。但是,所有配置参数均为官方标准参数,无任何差别。

「业务参数」为订单相关的参数,「全局参数」为除订单相关参数以外的全局性参数。

具体参数列表请查看每个支付网关的使用说明。

1、支付宝 - 电脑网站支付

最小配置参数

所有配置参数

所有参数均为官方标准参数,无任何差别。点击这里 查看官方文档。

返回值

2、支付宝 - 手机网站支付

最小配置参数

所有配置参数

该网关大部分参数和 「电脑支付」 相同,具体请参考 官方文档

返回值

3、支付宝 - APP 支付

最小配置参数

所有配置参数

该网关大部分参数和 「电脑支付」 相同,具体请参考 官方文档

返回值

4、支付宝 - 刷卡支付

最小配置参数

所有配置参数

该网关大部分参数和 「电脑支付」 相同,具体请参考 官方文档

返回值

5、支付宝 - 扫码支付

最小配置参数

所有配置参数

该网关大部分参数和 「电脑支付」 相同,具体请参考 官方文档

返回值

6、支付宝 - 帐户转账

最小配置参数

所有配置参数

官方文档

返回值

7、微信 - 公众号支付

最小配置参数

所有配置参数

所有参数均为官方标准参数,无任何差别。点击这里 查看官方文档。

返回值

后续调用举例:

8、微信 - 小程序支付

最小配置参数

所有配置参数

由于「小程序支付」和「公众号支付」都使用的是 JSAPI,所以,除了 APPID 一个使用的是公众号的 APPID 一个使用的是 小程序的 APPID 以外,该网关所有参数和 「公众号支付」 相同,具体请 参考这里

返回值

9、微信 - H5 支付

最小配置参数

所有配置参数

所有配置项和前面支付网关相差不大,请点击这里查看.

返回值

10、微信 - 扫码支付

这里使用「模式二」进行扫码支付,具体请参考这里

最小配置参数

所有配置参数

所有配置项和前面支付网关相差不大,请点击这里查看

返回值

11、微信 - 刷卡支付

最小配置参数

所有配置参数

该网关所有参数和其它支付网关基本相同,具体请 参考这里

返回值

12、微信 - APP 支付

最小配置参数

所有配置参数

该网关所有参数和其它支付网关相同相同,具体请 参考这里

返回值

12、微信 - 企业付款

最小配置参数

所有配置参数

具体请看 官方文档

返回值

13、微信 - 发放裂变红包

最小配置参数

所有配置参数

具体请看 官方文档

返回值

14、微信 - 发放普通红包

最小配置参数

所有配置参数

具体请看 官方文档

返回值

如果您有其它支付网关的需求,或者发现本项目中需要改进的代码,欢迎 Fork 并提交 PR!

LICENSE

MIT


All versions of payment with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
guzzlehttp/guzzle Version ^6.3
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 wangchen/payment contains the following files

Loading the files please wait ....