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

ActiveLibrary[Payment Processing](/categories/payments)

joseluisald/paypal
==================

Uma biblioteca fornece a integração com o PayPal

1.00(2y ago)05MITPHP

Since May 25Pushed 2y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

JOSELUISALD | PAYPAL
====================

[](#joseluisald--paypal)

Esta biblioteca fornece a integração com o PayPal

Com está biblioteca você pode facilmente salvar um cartão para pagar depois usando um token, pode fazer um Checkout

Instalação
----------

[](#instalação)

Esta biblioteca está disponível através do composer, como você pode ver pelo seu [packagist page](https://packagist.org/packages/joseluisald/paypal).

```
composer require joseluisald/paypal

```

Crie as constantes com os dados da sua conta
--------------------------------------------

[](#crie-as-constantes-com-os-dados-da-sua-conta)

```
define('API', [
    'Type' => 'Sandbox',
    'ClientId' => '---------------',
    'ClientSecret' => '----------'
]);
```

Instanciando a Classe Payment
-----------------------------

[](#instanciando-a-classe-payment)

Primeiramente instancie a classe passando o Tipo (Sandbox ou Live), o ClientId e o ClientSecret. Obs\*. Os 3 campos são obrigatórios

```
require __DIR__.'/vendor/autoload.php';

use joseluisald\Payment\Payment;

$payment = new Payment(API['Type'], API['ClientId'], API['ClientSecret']);
```

Método para pegar o ClientID, caso necessário para usar no formulário via JavaScript
------------------------------------------------------------------------------------

[](#método-para-pegar-o-clientid-caso-necessário-para-usar-no-formulário-via-javascript)

```
$clientToken = $payment->getToken();
```

Método para Salvar um cartão e ter o seu Id para um pagamento futuro
--------------------------------------------------------------------

[](#método-para-salvar-um-cartão-e-ter-o-seu-id-para-um-pagamento-futuro)

```
$data = '{
    "payment_source": {
        "card": {
            "number": "4111111111111111",
            "expiry": "2027-02",
            "name": "Luis",
            "billing_address": {
                "address_line_1": "Maciel",
                "address_line_2": "123",
                "admin_area_1": "RS",
                "admin_area_2": "Pelotas",
                "postal_code": "98000123",
                "country_code": "BR"
            },
            "experience_context": {
                "brand_name": "brand_name",
                "locale": "en-US",
                "return_url": "https://example.com/returnUrl",
                "cancel_url": "https://example.com/cancelUrl"
            }
        }
    }
}';

$idCard = $payment->saveCard($data);
$paymentToken = $payment->paymentToken($idCard);

$idCard = $paymentToken->id; // q5734p4c
$customeId = $paymentToken->customer->id;
```

Método para criar uma order usando o token do cartão salvo
----------------------------------------------------------

[](#método-para-criar-uma-order-usando-o-token-do-cartão-salvo)

'vault\_id' é referente ao '$idCard'

```
$reference_id = uniqid() . '_' . strtotime("now") . '_' . uniqid();
$data =
'{
    "intent": "CAPTURE",
    "purchase_units": [
        {
            "reference_id": "'.$reference_id.'",
            "amount": {
                "currency_code": "USD",
                "value": "100.00"
            }
        }
    ],
    "payment_source": {
        "card": {
              "vault_id": "q5734p4c"
        }
    }
}';

$createOrder = $payment->createOrder($data);

$idPayment = $createOrder->id;
$status = $createOrder->status;
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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

1082d ago

### Community

Maintainers

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

---

Top Contributors

[![joseluisald](https://avatars.githubusercontent.com/u/46960705?v=4)](https://github.com/joseluisald "joseluisald (3 commits)")[![luismarketmedia](https://avatars.githubusercontent.com/u/220196192?v=4)](https://github.com/luismarketmedia "luismarketmedia (1 commits)")

---

Tags

paymentpaypal

### Embed Badge

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

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

###  Alternatives

[payum/payum

One million downloads of Payum already! Payum offers everything you need to work with payments. Friendly for all PHP frameworks (Symfony, Laravel, Laminas, Yii, Silex). Check more visiting site.

1.9k6.6M21](/packages/payum-payum)[payum/payum-bundle

One million downloads of Payum already! Payum offers everything you need to work with payments. Check more visiting site.

59510.3M40](/packages/payum-payum-bundle)[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[shetabit/payment

Laravel Payment Gateway Integration Package

944330.1k5](/packages/shetabit-payment)[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)[jms/payment-paypal-bundle

Payment Bundle providing access to the PayPal API

124405.8k1](/packages/jms-payment-paypal-bundle)

PHPackages © 2026

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