PHPackages                             szwtdl/paypal - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. szwtdl/paypal

ActiveLibrary[Payment Processing](/categories/payments)

szwtdl/paypal
=============

paypal

v1.0.0(3y ago)0411MITPHP

Since Aug 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/szwtdl/paypal)[ Packagist](https://packagist.org/packages/szwtdl/paypal)[ RSS](/packages/szwtdl-paypal/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Paypal payment SDk
==================

[](#paypal-payment-sdk)

#### Installation

[](#installation)

You can add this library as a local, per-project dependency to your project using Composer:

```
composer require szwtdl/paypal
```

#### paypal

[](#paypal)

```
use Szwtdl\Paypal\Paypal

$paypal = new Paypal('client_id','client_key','dev')
```

#### laravel

[](#laravel)

在刚刚创建的应用里，我们需要更新一下配置文件 `config/services.php`，添加以下部分：

config/services.php

```
'paypal' => [
    'client_id' => '',
    'client_key' => '',
    'mode' => 'prod',
]
```

#### [ProductCreate](https://developer.paypal.com/docs/api/catalog-products/v1/#products_create)

[](#productcreate)

```
$paypal->ProductCreate("每天订购", "每天sand", 'SERVICE', 'SOFTWARE', 'https://example.com/streaming.jpg', 'https://example.com/home');
```

#### [ProductList](https://developer.paypal.com/docs/api/catalog-products/v1/#products_list)

[](#productlist)

```
$paypal->ProductList(1,20)
```

#### [ProductDetail](https://developer.paypal.com/docs/api/catalog-products/v1/#products_get)

[](#productdetail)

```
$paypal->ProductDetail("PROD-8RU94658131561729")
```

#### [ProductUpdate](https://developer.paypal.com/docs/api/catalog-products/v1/#products_patch)

[](#productupdate)

```
$paypal->ProductUpdate("PROD-8RU94658131561729", [
    'description' => 'xxx'
]);
```

#### [PlansList](https://developer.paypal.com/docs/api/subscriptions/v1/#plans_list)

[](#planslist)

```
$paypal->PlansList('PROD-8RU94658131561729', 1, 10, true);
```

#### [PlansCreate](https://developer.paypal.com/docs/api/subscriptions/v1/#plans_create)

[](#planscreate)

```
$paypal->PlansCreate([
    'product_id' => 'PROD-8RU94658131561729',
    'name' => '优酷年会员',
    'description' => '定期续费',
    'status' => 'ACTIVE',
    'billing_cycles' => [
        [
            'frequency' => [
                'interval_unit' => 'MONTH',
                'interval_count' => 3
            ],
            'tenure_type' => 'REGULAR',
            'sequence' => 1,
            'total_cycles' => 0,
            'pricing_scheme' => [
                'fixed_price' => [
                    'value' => 20.99,
                    'currency_code' => 'USD'
                ]
            ]
        ]
    ],
    'payment_preferences' => [
        'auto_bill_outstanding' => true,
        'setup_fee' => [
            'value' => 0,
            'currency_code' => 'USD'
        ],
        'setup_fee_failure_action' => 'CONTINUE',
        'payment_failure_threshold' => 3
    ],
    'taxes' => [
        'percentage' => 0,
        'inclusive' => false
    ]
]);
```

#### [PlansUpdate](https://developer.paypal.com/docs/api/subscriptions/v1/#plans_patch)

[](#plansupdate)

```
$paypal->PlansUpdate("P-0BL89979RT255525KMLQP5AA", [
    'description' => '新产品'
]);
```

#### PlansDetail

[](#plansdetail)

#### PlansActivate

[](#plansactivate)

#### PlansDeactivate

[](#plansdeactivate)

#### SubscriptionCreate

[](#subscriptioncreate)

#### SubscriptionList

[](#subscriptionlist)

#### SubscriptionDetail

[](#subscriptiondetail)

#### SubscriptionActivate

[](#subscriptionactivate)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1402d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f32de7c4cbc21d8a95efcdcaec3e2cbffeffd80c9de0232c6a3a3dcd3aa3f55b?d=identicon)[szwtdl](/maintainers/szwtdl)

---

Top Contributors

[![szwtdl](https://avatars.githubusercontent.com/u/13212946?v=4)](https://github.com/szwtdl "szwtdl (29 commits)")

---

Tags

laravelpaymentgatewaypaypalpay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/szwtdl-paypal/health.svg)

```
[![Health](https://phpackages.com/badges/szwtdl-paypal/health.svg)](https://phpackages.com/packages/szwtdl-paypal)
```

###  Alternatives

[shetabit/multipay

PHP Payment Gateway Integration Package

293361.0k4](/packages/shetabit-multipay)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4851.0k](/packages/sebdesign-laravel-viva-payments)[larabook/gateway

A Laravel package for connecting to all Iraninan payment gateways

24753.9k](/packages/larabook-gateway)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
