PHPackages                             nattreid/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. nattreid/paypal

ActiveLibrary[Payment Processing](/categories/payments)

nattreid/paypal
===============

Paypal for Nette Framework

1.0.2(5y ago)099MITPHPPHP &gt;= 7.1

Since Jan 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/nattreid/paypal)[ Packagist](https://packagist.org/packages/nattreid/paypal)[ RSS](/packages/nattreid-paypal/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (7)Versions (4)Used By (0)

PayPal pro Nette Framework
==========================

[](#paypal-pro-nette-framework)

Nastavení v **config.neon**

```
extensions:
    payPal: NAttreid\PayPal\DI\PayPalExtension

payPal:
	clientId: xxxXXXxXXXXxxxx
	secret: xxxXXXxXXXXxxxx
	experienceProfileId: xxxXXXxXXXXxxxx
	sdkConfig:
		mode: sandbox
		log.Enabled: true
		log.FileName: '%logDir%/PayPal.log'
		log.LogLevel: DEBUG
		validation.level: log
		cache.enabled: true
		cache.FileName: '%tempDir%/paypal/auth.cache'
		http.CURLOPT_CONNECTTIMEOUT: 30
```

sdkConfig je nastavení [paypal/PayPal-PHP-SDK](https://github.com/paypal/PayPal-PHP-SDK), [sdk-config-sample](https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/sdk_config.ini)

### Použití

[](#použití)

```
/** @var \Nattreid\PayPal\Control\IPayPalControlFactory @inject */
public $payPalControlFactory;

/** @var \Nattreid\PayPal\PayPalClient @inject */
public $payPalClient;

protected function createComponentButton(): \Nattreid\PayPal\Control\PayPalControl
{
    $control = $this->payPalControlFactory->create();
    $control->setCurrency('CZK');

    foreach ($this->order->items as $item) {
        $control->addItem(
            $item->name,
            $item->count,
            $item->price
        );
    }

    $discount = $this->order->discount;
    if ($discount) {
        $control->addItem(
            'Discount',
            1,
            -$discount
        );
    }

    $control->onSuccess[] = function (Payment $paid, Sale $sale, bool $pending) {
        $this->order->paypalTransactionId = $sale->getId();

        if ($pending) {
            $this->order->setState(Pending::class);
        } else {
            $this->order->setState(Payed::class);
        }
        $this->redirect($this->link('success'));
    };

    $control->onError[] = function (PayPalException $exception) {
        Debugger::log($exception->getMessage(), 'paypal');
        $this->redirect($this->link('error'));
    };

    $control->onCancel[] = function () {
        $this->order->setState(Cancel::class);
        $this->redirect($this->link('cancel'));
    };

    return $control;
}

public function paypalCheckPayments(): void
{
    foreach ($this->orders as $order) {
        if ($order->paypalTransactionId !== null) {
            try {
                $status = $this->payPalClient->checkPayment($order->paypalTransactionId);

                if ($status === true) {
                    $order->setState(Payed::class);
                } elseif ($status === false) {
                    $order->setState(Cancel::class);
                }
            } catch (PayPalException $ex) {

            }
        }
    }
}

public function refund(): void
{
    $this->payPalClient->refund(
        'paypalPaymentId'
        5.55,
        'USD'
    );
}
```

###  Health Score

26

—

LowBetter than 40% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Every ~378 days

Total

3

Last Release

2006d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a388aeb3f00b15a3af1c1a5d3a2107c94af1730c6043dd30ce32a63f95ea290?d=identicon)[attreid](/maintainers/attreid)

### Embed Badge

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

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

###  Alternatives

[nette/web-project

Nette: Standard Web Project

11093.7k](/packages/nette-web-project)[metisfw/paypal

PayPal SDK integration for Nette Framework

109.8k](/packages/metisfw-paypal)

PHPackages © 2026

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