krugerdavid/laravel-pagopar
最新稳定版本:v1.0.0
Composer 安装命令:
composer require krugerdavid/laravel-pagopar
包简介
Laravel integration for Pagopar payment gateway
README 文档
README
Laravel integration for Pagopar payment gateway.
Installation
You can install the package via composer:
composer require krugerdavid/laravel-pagopar
The service provider will automatically register itself.
You can publish the config file with:
php artisan vendor:publish --tag="pagopar-config"
Configuration
Add these variables to your .env file:
PAGOPAR_PUBLIC_KEY=your_public_token PAGOPAR_PRIVATE_KEY=your_private_token
Usage
Creating a Payment
use KrugerDavid\Pagopar\Facades\Pagopar; use KrugerDavid\Pagopar\DTOs\PagoparBuyer; use KrugerDavid\Pagopar\DTOs\PagoparItem; use KrugerDavid\Pagopar\DTOs\PagoparPaymentRequest; $buyer = new PagoparBuyer( name: 'Juan Perez', email: 'juan@example.com', document: '1234567', phone: '+595981123456' ); $items = [ new PagoparItem( name: 'Producto de Prueba', price: 10000, quantity: 1 ) ]; $request = new PagoparPaymentRequest( orderId: 'ORDER-123', buyer: $buyer, items: $items, maxPaymentDate: now()->addDays(2)->format('Y-m-d H:i:s'), description: 'Descripción del pedido' ); $response = Pagopar::createPayment($request); if ($response['hash']) { $checkoutUrl = Pagopar::getCheckoutUrl($response['hash']); return redirect($checkoutUrl); }
Checking Order Status
$status = Pagopar::getOrderStatus($hash); if (!empty($status) && $status[0]['pagado']) { // El pedido ha sido pagado }
Verifying Webhook Token
public function handleWebhook(Request $request) { $hash = $request->input('resultado.0.hash_pedido'); $token = $request->input('resultado.0.token'); if (Pagopar::verifyWebhookToken($hash, $token)) { // Token válido, procesar el pago } }
Security
If you discover any security related issues, please email david.kruger@duplaa.com instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-19