Download the PHP package faysoft/faypay without Composer

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

第三方支付模块

调用代码

先放调用代码,因为调用代码很简单。如果不扩展支付方式的话,后面那一大段都不需要看。
调用代码分三步:

创建交易

发起支付

直接通过api调用发起支付。该接口根据支付方式不同,可能返回json数据,也可能直接跳转到第三方支付页面。

根据支付方式不同,有的支付方式是通过ajax等方式请求接口,有的支付方式是将页面跳转到接口。

监听支付成功事件

通过configs/events.php注册监听事件

概念陈述

支付方式(PaymentMethod)

支付方式是一个独立的模块。支付方式是独立于交易(Trade)的,可以通过其他方式构造支付参数,发起支付。本系统出于业务逻辑考虑,都是由交易(Trade)模块调起支付。

示例代码:

交易(Trade)

订单实例(TradeItem)

实现ArrayAccess接口和__get()/__set()方法。支持以数组或对象属性的方式获取或修改trades表对应字段信息。

交易服务(TradeService)

与数据库打交道的服务类。用于创建、获取交易信息。

交易状态模式

交易状态变更采用状态模式设计。每个状态对应state文件夹下的状态类。状态类均继承自StateInterface接口。StateInterface接口含以下方法:

交易支付记录(TradePayment)

支付记录实例(TradePaymentItem)

实现ArrayAccess接口和__get()/__set()方法。支持以数组或对象属性的方式获取或修改trades表对应字段信息。

支付记录服务(TradePaymentService)

与数据库打交道的服务类。用于创建、获取交易支付记录。

支付记录状态模式

支付记录状态变更采用状态模式设计。每个状态对应payment_state文件夹下的状态类。状态类均继承自PaymentStateInterface接口。PaymentStateInterface接口含以下方法:

交易(Trade)与交易支付记录(TradePayment)是一对多的关系。每发生一次支付行为,就会产生一条支付记录。当有一条支付记录变为已付款后,其他同交易的支付记录都会变为已关闭。

附录一:交易相关表结构

支付方式表

交易记录表

交易引用关系表

交易支付记录表

附录二:几种主流支付方式的主要配置参数列表

支付宝

微信支付

银联支付


All versions of faypay with dependencies

PHP Build Version
Package Version
Requires faysoft/cms Version *
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 faysoft/faypay contains the following files

Loading the files please wait ....