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

ActiveLibrary[Payment Processing](/categories/payments)

webservco/paypal
================

A PHP component/library.

v1.0.1(7mo ago)045MITPHPPHP ^8.4

Since Jan 31Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/webservco/paypal)[ Packagist](https://packagist.org/packages/webservco/paypal)[ Docs](https://webserv.co)[ RSS](/packages/webservco-paypal/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (24)Versions (18)Used By (0)

webservco/paypal
================

[](#webservcopaypal)

A PayPal REST API implementation.

Implemented functionality: [Orders v2](https://developer.paypal.com/docs/api/orders/v2/).

---

Resources
---------

[](#resources)

- [Get started with PayPal REST APIs](https://developer.paypal.com/api/rest/)
- [Test credit cards](https://developer.paypal.com/tools/sandbox/card-testing/);

---

Storage
-------

[](#storage)

### Structure

[](#structure)

Both table names and field names can be customized.

#### Table `payment_order`

[](#table-payment_order)

##### Fields to add to an existing table

[](#fields-to-add-to-an-existing-table)

- Mandatory: `order_reference`: implementation specific, eg. `VARCHAR(45) NOT NULL`,
- Mandatory: `order_total`: implementation specific, eg. `DECIMAL(10,2) NOT NULL`
- Optional: `order_currency`: `CHAR(3) NOT NULL`,
    - [PayPal currency codes](https://developer.paypal.com/reference/currency-codes/)
- Mandatory: `order_payment_status` `VARCHAR(45) DEFAULT NULL`,
- Mandatory: `payment_event_date_time` `DATETIME DEFAULT NULL`,

##### New table example

[](#new-table-example)

```
CREATE TABLE payment_order (
    order_reference VARCHAR(45) NOT NULL,
    order_total DECIMAL(10,2) NOT NULL,
    order_currency CHAR(3) NOT NULL,
    order_payment_status VARCHAR(45) DEFAULT NULL,
    payment_event_date_time DATETIME DEFAULT NULL,
    PRIMARY KEY(order_reference)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
```

#### Table `payment_access_token`

[](#table-payment_access_token)

```
CREATE TABLE payment_access_token (
    token VARCHAR(100) NOT NULL,
    expire_date_time DATETIME NOT NULL,
    added_date_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,

    PRIMARY KEY(token)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
```

---

Configuration
-------------

[](#configuration)

Use environment variables (check example configuration) (app url, default currency, table and fields names);

If not using order level currency, make sure to set the `PAYMENT_DEFAULT_CURRENCY` options, and leave blank `PAYMENT_FIELD_NAME_ORDER_CURRENCY`.

If using a very specialized setup and using the configuration is not enough, you can implement `\WebServCo\Contract\Storage\Order\OrderPaymentStorageInterface` specifically for your project.

---

Usage
-----

[](#usage)

An example is located in the directory `public/payment`.

Copy the files in your local project and adapt the paths.

Note: If a custom implementation is required, check and adapt the code located in `src/example_implementation`.

---

Testing the example implementation
----------------------------------

[](#testing-the-example-implementation)

- Create `config/.env.ini`;
- Fill paypal info
- Start project: `ddev start`
- Create tables;
- Create a test order:

```
INSERT INTO `payment_order` (order_reference, order_total, order_currency) VALUES ('Test1', 123.45, 'EUR');
```

- Open payment page: `https://paypal.ddev.site/payment/pay.php?orderReference=Test1&languageCode=en`

Note: `languageCode` is optional and only used internally in implementing project. If you set it when initialize the payment, it will arrive as parameter to the `PAYMENT_RESULT_LOCATION` and the `PAYMENT_CANCEL_LOCATION`.

---

TODO
----

[](#todo)

### \[ \] Find a way to suppress Psalm "UnusedVariable" errors.

[](#--find-a-way-to-suppress-psalm-unusedvariable-errors)

Not working (generates "UnusedPsalmSuppress" error):

```
/**
 * @psalm-suppress UnusedVariable
 */
```

```
/** @psalm-suppress UnusedVariable */
```

Reference: [Docblock suppression](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#docblock-suppression)

---

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance63

Regular maintenance activity

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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

Every ~38 days

Recently: every ~133 days

Total

17

Last Release

227d ago

Major Versions

v0.10.0 → v1.0.02025-02-15

PHP version history (2 changes)v0.0.1PHP ^8.3

v1.0.0PHP ^8.4

### Community

Maintainers

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

---

Top Contributors

[![ariademur](https://avatars.githubusercontent.com/u/34913107?v=4)](https://github.com/ariademur "ariademur (64 commits)")

---

Tags

componentwebservco

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[arbor-education/arbor-sdk-php

Arbor Education PHP SDK

116.8k](/packages/arbor-education-arbor-sdk-php)

PHPackages © 2026

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