sohojpay/sohojpay-lib 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sohojpay/sohojpay-lib

最新稳定版本:v1.0.0

Composer 安装命令:

composer require sohojpay/sohojpay-lib

包简介

Automate your Payment by SohojpayBD Payment Library

README 文档

README

This is a PHP library to interact with the Sohojpay API. This library allows you to create and verify payments using the Sohojpay payment gateway.

Features

  • Easy integration with the Sohojpay payment gateway.
  • Create and verify payments.
  • Customizable headers and parameters.

Installation

To install the library, you can use Composer or manually include the library in your project.

Using Composer

composer require sohojpay/sohojpay-lib

Manual Installation: Download the library and place it in your project directory. Include the library in your project:

require_once 'path/to/Sohojpay/SohojpayLib/SohojpayApi.php';

Usage

To use the library, create a class that extends the SohojpayApi abstract class and implement any additional methods you might need.

Example:

<?php
require 'vendor/autoload.php';

use Sohojpay\SohojpayLib\SohojpayLib;

$sohojpay = new SohojpayLib();

$sohojpay->setApi('YOUR_API_KEY');


// Set request parameters
$sohojpay->setParams([
  'cus_name' => 'John Doe',
  'cus_email' => 'johndoe@example.com',
  'cus_phone' => '0123456789',
  'amount'    => 90,
  'metadata' => ['phone' => '0123456789'],
  'success_url' => 'https://yourwebsite.com/success',
  'cancel_url' => 'https://yourwebsite.com/cancel',
]);

//*** Create a payment

$response = $sohojpay->createPayment();
echo $response;


//*** Verify a payment
$sohojpay->setParams([
    'transaction_id' => 'GCAN7A410970'
]);

$response = $sohojpay->verifyPayment();
echo $response;

?>

统计信息

  • 总下载量: 60
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-27