定制 fredylopezs/tpago-sdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

fredylopezs/tpago-sdk

最新稳定版本:v0.2.1

Composer 安装命令:

composer require fredylopezs/tpago-sdk

包简介

SDK para integrar paTPago

README 文档

README

Este SDK proporciona una interfaz fácil de usar para interactuar con la API de TPago en aplicaciones PHP.

Instalación

Para instalar este SDK, utiliza Composer:

composer require fredylopezs/tpago-php

Uso

Configuración

Antes de usar el SDK, debes configurar las credenciales de TPago:

use FMLS\TPago\TPagoConfig;

$config = new TPagoConfig('publicKey', 'privateKey', 'commerceCode', 'branchCode');

Alternativamente, puedes usar el entorno de pruebas con sus respectivas credenciales:

$config = new TPagoConfig('publicKey', 'privateKey', 'commerceCode', 'branchCode', true);

Generar un enlace de pago

Para generar un enlace de pago, utiliza la clase Payment:

use FMLS\TPago\TPagoClient;
use FMLS\TPago\Payment; 

$client = new TPagoClient($config);
$payment = new Payment($client);

$response = $payment->generateLink(5000, "Test Payment");

print_r($response);

Generar un enlace de suscripción

Para generar un enlace de suscripción, utiliza la clase Subscription:

use FMLS\TPago\Subscription;

$client = new TPagoClient($config);
$subscription = new Subscription($client);

$response = $subscription->generateLink([
    'amount' => 5000,
    'description' => "Test Subscription",
    'periodicity' => "monthly",
    'debit_day' => 1,
    'unlimited' => false
]);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-21