Download the PHP package overnic/payment without Composer

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

Payment

安装

使用命令composer require overnic/payment将包引入至项目内容

功能列表

使用

如果对微信支付或者支付宝支付不了解或不熟悉的开发人员,建议先前往对应的开发文档进行了解,本SDK仅限于对支付宝支付,微信支付等一定了解的开发人员使用。

  1. 初始化支付类

  2. 更换支付方式

对应的驱动名称可以使用PayCode类中的常量DRIVER_WECHATPAYDRIVER_ALIPAY来代wechtpay和alipay字符,避免因输入错误引发不必要的问题

用例

微信支付

  1. 请求参数中的内容,可参考支持列表中的文档地址,以下示例仅使用必须参数进行,SDK底层已经对部分必传参数进行了封装,调用方法传参时,可不传入对应的封装参数如下 appid, mch_id, nonce_str, sign, sign_type
  2. 所有的方法请求都会返回一个数组(array),数组内容为微信返回值,可根据实际情况进行处理
  3. 实例列表
1.0 公众号支付与小程序支付(v0.2.2+)
1.1 统一下单

微信支付成功通知

订单支付成功后,微信会对notify_url参数的地址进行POST提交,所以需要对微信的提交进行结果的处理

1.2 查询订单
1.3 关闭订单
1.4 订单退款
1.5 查询退款

微信退款成功通知

1.6 刷卡/扫码支付
1.7 微信内H5调起支付(v0.2.0+)
1.7.1 小程序内调起支付(v0.2.2+)
1.8 获取openid (v0.2.1+)

如果对ouath2流程不熟悉,建议先前往对应的资料页学习

接收CODE的地址需要进行以下的处理

成功请求的最终$result结果格式如下

1.8.1 小程序获取openid (v0.2.2+)
1.9 发送红包 (v0.2.3+)
1.10 企业付款 (v0.2.3+)
生成二维码

支付宝支付

  1. 所有的方法请求都会返回一个数组(array),数组内容为支付宝返回值,可根据实际情况进行处理
  2. 包内已经对请求参数的params部分进行了处理,只需要额外填写,notify_url, return_url, app_auth_token参数即可,其他请求参数请参照接口文档中的biz_content参数部分
  3. 更换支付方式

  4. 实例列表
2.1 统一下单
2.2 预创建订单
2.3 查询订单
2.4 关闭订单
2.5 创建退款
2.6 退款查询
2.7 通过声波或条码收款
2.8 PC支付
2.9 移动端支付
2.10 转账付款(v0.3.3+)
支付成功通知

扩展

增加额外的支付方式
  1. 向本项目贡献代码
  2. 通过以下方式进行拓展

License

MIT


All versions of payment with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
guzzlehttp/guzzle Version ^6.3
pimple/pimple Version ^3.2
overnic/support Version 1.2.*
bacon/bacon-qr-code Version ^1.0
symfony/http-foundation Version ^2.7|^3.0|^4.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 overnic/payment contains the following files

Loading the files please wait ....