承接 shaanid/paypal-package 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

shaanid/paypal-package

最新稳定版本:v1.0.0

Composer 安装命令:

composer require shaanid/paypal-package

包简介

A PayPal integration package for Laravel.

README 文档

README

A production-standard Laravel package for PayPal REST API integration, featuring robust error handling, transaction persistence, and audit logging.

🚀 Features

  • Service-Oriented Architecture: Decoupled payment logic.
  • Database Persistence: Automatic tracking of every transaction (Pending, Completed, Canceled, Failed).
  • Audit Logging: Full traceability of API requests and responses.
  • Action Pattern: Clean, testable, and reusable business logic.
  • Ready-to-use UI: Modern, responsive checkout interface.

🛠️ Installation

  1. Install via Composer: (Since this is currently a local package, you would typically add it to your repositories in composer.json)

    "repositories": [
        {
            "type": "path",
            "url": "../path-to-your-package"
        }
    ]

    Then run:

    composer require shaanid/paypal-package
  2. Publish Configuration and Views:

    php artisan vendor:publish --provider="Shaanid\PayPal\PayPalServiceProvider"
  3. Environment Configuration: Add your PayPal credentials to your .env file:

    PAYPAL_MODE=sandbox
    PAYPAL_SANDBOX_CLIENT_ID=your_client_id
    PAYPAL_SANDBOX_CLIENT_SECRET=your_client_secret
    PAYPAL_CURRENCY=USD
  4. Run Migrations:

    php artisan migrate

📁 Usage

The package automatically registers the following routes:

  • GET /paypal: The checkout index page.
  • POST /paypal/process: Handles order creation and redirection to PayPal.
  • GET /paypal/success: Handles successful payment capture.
  • GET /paypal/cancel: Handles payment cancellation.

Overriding Logic

You can use the Actions and Services provided by the package in your own controllers:

use Shaanid\PayPal\Actions\CreatePayPalOrderAction;
use Shaanid\PayPal\DTOs\PaymentData;

public function checkout(CreatePayPalOrderAction $action)
{
    $data = new PaymentData(amount: '20.00', currency: 'USD', userId: auth()->id());
    $approvalLink = $action->execute($data->toCollection());

    return redirect()->away($approvalLink);
}

📝 License

This project is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固