paysgator/paysgator-php 问题修复 & 功能扩展

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

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

paysgator/paysgator-php

Composer 安装命令:

composer require paysgator/paysgator-php

包简介

Paysgator API Client for PHP

README 文档

README

A PHP client library for the Paysgator API.

Installation

Install via Composer:

composer require paysgator/paysgator-php

Usage

Configuration

For most requests, you simply need to provide your API Key.

require 'vendor/autoload.php';

use Paysgator\PaysgatorClient;

$client = new PaysgatorClient([
    'api_key' => 'YOUR_API_KEY',
]);

Create Payment

Create a payment transaction.

$paymentData = [
    'amount' => 100,
    'currency' => 'MZN',
    'payment_methods' => ['MPESA', 'CARD'],
    'returnUrl' => 'https://mysite.com/return',
];

try {
    $result = $client->payments()->create($paymentData);
    echo "Payment Link: " . $result['data']['checkoutUrl'];
    echo "Transaction ID: " . $result['data']['transactionId'];
} catch (\Exception $e) {
    echo "Error: " . $e->getMessage();
}

Confirm Payment

Confirm a payment server-side.

try {
    $confirmation = $client->payments()->confirm([
        'paymentLinkId' => 'payment_uuid',
        'paymentMethod' => 'MPESA',
        'payment_fields' => ['phoneNumber' => '841234567']
    ]);
    print_r($confirmation);
} catch (\Exception $e) {
    echo "Error: " . $e->getMessage();
}

Subscriptions

Manage subscriptions.

// Pause a subscription
$client->subscriptions()->update('sub_123', 'pause');

Transactions

Retrieve transaction details.

$transaction = $client->transactions()->get('txn_123');
print_r($transaction);

Wallet

Check wallet balance.

$balance = $client->wallet()->getBalance();
echo "Balance: " . $balance['balance'] . " " . $balance['currency'];

Support

For issues and support, please contact info@paysgator.com.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固