定制 flexonexus/laravel-tap-payments 二次开发

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

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

flexonexus/laravel-tap-payments

Composer 安装命令:

composer require flexonexus/laravel-tap-payments

包简介

Laravel integration for Tap Payments (charges, refunds, webhooks).

README 文档

README

Latest Version License

🚀 Elegant Laravel integration with Tap Payments: charges, refunds, webhooks — the clean Laravel way.

✨ Features

  • 🔑 Simple Facade API: Tap::createCharge(), Tap::refundCharge(), etc.
  • ⚙️ Configurable via .env (TAP_SECRET_KEY, TAP_MODE, etc.)
  • 🔔 Built-in Webhook signature verification
  • 📦 PSR-4 autoload & Laravel auto-discovery
  • 🧪 Testbench support for easy unit testing

📦 Installation & Setup

Follow these steps to fully install and configure the package:

1. Install via Composer

composer require flexonexus/laravel-tap-payments

2. Publish the Config File

php artisan vendor:publish --tag=tap-config

This will create:

config/tap.php

3. Add Environment Variables

In your .env file:

TAP_MERCHANT_ID=your_merchant_id_here # Your Merchant ID
TAP_SECRET_KEY=sk_test_xxx   # Your Tap secret key
TAP_PUBLIC_KEY=pk_test_xxx   # Your Tap public key
TAP_WEBHOOK_SECRET=whsec_xxx # Webhook secret for signature verification
TAP_MODE=sandbox             # sandbox | live

4. Configure Webhook URL

Set the webhook endpoint in your Tap dashboard:

https://your-domain.com/tap/webhook

The package already registers this route automatically.

5. Clear Cached Configs

If your app uses config caching, run:

php artisan config:clear

6. Test the Integration

Use the Facade to create a test charge:

use Tap;

$charge = Tap::createCharge([
    'amount'   => 50,
    'currency' => 'USD',
    'customer' => [
        'first_name' => 'Test',
        'email'      => 'test@example.com',
        'phone'      => ['country_code' => '966', 'number' => '500000000'],
    ],
    'merchant' => ['id' => config('tap.merchant_id')],
    'source'   => ['id' => 'src_all'],
    'redirect' => ['url' => route('checkout.callback')],
    'description' => 'Order #1001',
    // ...any other Tap fields you need
]);

dd($charge);

If you see a JSON response with a charge_id, 🎉 the package is working.

🚀 Usage Examples

Create a Charge

$charge = Tap::createCharge([
    'amount'   => 50,
    'currency' => 'USD',
    'customer' => [
        'first_name' => 'Mohamed',
        'email'      => 'mohamed@example.com',
        'phone'      => ['country_code' => '966', 'number' => '500000000'],
    ],
    'merchant' => ['id' => config('tap.merchant_id')],
    'source'   => ['id' => 'src_all'],
    'redirect' => ['url' => route('checkout.callback')],
    'description' => 'Order #1234',
    // ...any other Tap fields you need
]);

Retrieve a Charge

$charge = Tap::retrieveCharge($charge['id']);

Refund a Charge

$refund = Tap::refundCharge($charge['id'], [
    'amount' => 50,
    'reason' => 'customer_request'
]);

🔔 Webhooks

  • The package registers /tap/webhook automatically.
  • All requests are verified with TAP_WEBHOOK_SECRET.

Example: Listen for events

Event::listen('tap::charge.succeeded', function ($payload) {
    // Update your order, mark it as paid
});

🧪 Testing

composer test

This uses PHPUnit with Orchestra Testbench.

🤝 Contributing

PRs are welcome!
Please run composer test before submitting.

💡 Credits

flexonexus/laravel-tap-payments 适用场景与选型建议

flexonexus/laravel-tap-payments 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 09 月 29 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「payments」 「gateway」 「laravel」 「tap」 「kuwait」 「ksa」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 flexonexus/laravel-tap-payments 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 flexonexus/laravel-tap-payments 我们能提供哪些服务?
定制开发 / 二次开发

基于 flexonexus/laravel-tap-payments 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-29