webtopay/libwebtopay

Paysera支付网关集成的PHP库

3.0.1 2024-05-15 07:36 UTC

This package is auto-updated.

Last update: 2024-09-15 08:26:03 UTC


README

结账API(支付网关API)允许通过多种支付方式收集在线支付。结账API易于集成 - 只需使用我们的方法之一,结账流程将自动执行。该库可用于检查传输和接收数据的所有必要安全参数。更多详细信息请参阅 文档

安装

使用库的最简单方法是包含所有合一的文件。它位于基本libwebtopay目录中,名为"WebToPay.php"。在这种情况下,您只需要这个文件。示例

<?php

require_once('WebToPay.php');

或者,您可以使用"src"目录中的文件。要么设置自动加载器,要么在"src"目录中包含"includes.php"文件。示例

<?php

require_once('libwebtopay/src/includes.php');
// Your code goes here

安装库的另一种方法是使用composer

// to install the latest version
"composer require webtopay/libwebtopay

// to install the oldest supported version (in some projects)
"composer require webtopay/libwebtopay "^1.6"

// to install version with new interface
"composer require webtopay/libwebtopay "^2.0"

然后

<?php

use WebToPay;

请注意,^3.0版本的接口与^2.0版本相同,但最新的版本已提升到PHP 7.4标准,并采用类似strict_types、类型提示等代码风格。

测试

$ bash runt_tests.sh