Download the PHP package join/php-payment without Composer

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

PHP-JOIN-PAYMENT php 支付工程

github (最新代码) https://github.com/SantiagoFan/php-payment
gitee (定期同步) https://gitee.com/san_fan/php-paymentgit

整体框架

composer 安装

需要 composer 版本2+

包地址 https://packagist.org/packages/join/php-payment

require 依赖

php:>=7.2.0

代码结构

如何参与开发成为代码贡献人员

  1. 将项目fork到自己帐号
  2. 修改代码完成测试
  3. 提交commit push 到自己的仓库
  4. New pull request(简称pr) 合并请求到主库等待合并

使用教程

1.安装包 composer 包

2.创建数据表

复制源码文件夹的sql 脚本创建 交易流水表(此表作为所有支付进出的流水信息记录),具体业务订单信息请自己单独创建,参照下面的myorder

字段 数据类型 可空 含义
id varchar(64) not null 支付记录表
title varchar(128) null 支付项目名称 如:商品-橘子5斤
is_refund tinyint(1) null 是否为退款
state int default 0 null 支付完成状态 -1撤销 0 默认 1 交易中 2支付完成
business_name varchar(50) null 业务类别:1.商品支付
business_no varchar(128) null 内部业务 关联订单号码
pay_channel varchar(50) null 支付渠道:alipay,wxpay
pay_channel_no varchar(128) null 支付渠道 返回的外部订单号
amount decimal(10,2) null 操作金额 支付为正 退款为负
real_amount decimal(10,2) null
apply_time datetime null 下单时间
complete_time datetime null 交易完成时间
original_amount decimal(10,2) null 原订单交易金额
original_id varchar(64) null 原始交易订单

3.编写配置类(实现 IPaymentConfig 接口)

配置示例 config/payment.php

支付前注入配置

4.集成异步通知 Controller

此通知入口对应地址需要和配置类的通知地址一致

如果需要全局处理 支付成功后或者退款后的业务,notify 类覆盖父类方法PaySuccess 或者 RefundSuccess。
如果需要处理业务订单成功后的业务,请在相关业务model 里的PaySuccess方法处理

5.编写业务类 Model

6.编写业务调用支付

支付传入参数 $params

微信js 支付需要传入openid

支付宝js 支付需要传入buyer_id


All versions of php-payment with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
alipaysdk/easysdk Version ^2.2
overtrue/wechat Version ~4.0
topthink/framework Version 5.1.*
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 join/php-payment contains the following files

Loading the files please wait ....