PHPackages                             tps/paypal-bundle - 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. [API Development](/categories/api)
4. /
5. tps/paypal-bundle

ActiveLibrary[API Development](/categories/api)

tps/paypal-bundle
=================

Symfony2 wrapper-bundle for rest-api-sdk-php and classic-api from paypal

03PHP

Since Oct 29Pushed 11y agoCompare

[ Source](https://github.com/leberknecht/tpsPaypalBundle)[ Packagist](https://packagist.org/packages/tps/paypal-bundle)[ RSS](/packages/tps-paypal-bundle/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Build Status](https://camo.githubusercontent.com/04248e7e4ca352368363062869f0276e8cce469b6cfb819bd635e9ceba9e0171/68747470733a2f2f7472617669732d63692e6f72672f6c656265726b6e656368742f74707350617970616c42756e646c652e706e67)](https://travis-ci.org/leberknecht/tpsPaypalBundle)[![Coverage Status](https://camo.githubusercontent.com/af574a3cf100383cb7b0a7fd2318c101b37e66e4fddc9099192f63ad064ba9ba/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6c656265726b6e656368742f74707350617970616c42756e646c652f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/leberknecht/tpsPaypalBundle?branch=master)

tpsPaypalBundle
===============

[](#tpspaypalbundle)

This bundle intends to be a wrapper for both the RESTful-API and the classic-API. Currently in progress ^^ What we've got so far:

Installation
------------

[](#installation)

Add the following line to your composer.json:

```
require: "tps/paypal-bundle": "dev-master"
```

And run composer install

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

[](#configuration)

```
tps_paypal:
    client: HjaksuIHAsuhhamisecretKLJSisduijhdfJKHsdhiohdjklsjd90sdfjsdj
    secret: KLJsd9f0jfiammuchmoresecretindeedKJLSKdjs890dfjij2309sdujifj
    mode: live
    http:
        ConnectionTimeOut: 30
        Retry: 1
    log:
        LogEnabled: true
        FileName: PayPal.log
        LogLevel:  FINE
    classic_api:
        acct1:
            Username: yourPayPaylClassicApiUser
            Password: yourPayPaylClassicApiPass
            Signature: yourPayPaylClassicApiSignature
        mode: live
```

Usage
-----

[](#usage)

### Checkout

[](#checkout)

```
public function checkoutAction()
{
    $returnUrl = 'http://myapp/success';
    $cancelUrl = 'http://myapp/cancel/order123';

    $payment = $this->get('tps_paypal.paypal_service')->setupPayment();
    $orderItems = array(
        new TransactionItem('Something sold', 18.99, 'USD', 1)
    );
    $payment->addTransaction($orderItems, 'USD', 'Order no. 123');

    $payment->setUrls($returnUrl, $cancelUrl);
    $payment->createPaypalPayment();
    save_checkout_id($payment->getCheckoutId());

    redirect($payment->getApprovalUrl());
}
```

This will create a payment. Save the payment-id before redirecting the user, you will need this id later to actually execute the payment. Note: you can create an instance of "tps\\PaypalBundle\\Entity\\Payment" by yourself instead of calling the service, but if you do, you will have to care about the API context yourself

### Transaction execution

[](#transaction-execution)

```
public function returnAfterCheckoutUrlAction()
{
	$checkoutId = load_checkoutId(); //to be implemented elsewhere
	$paypalService = $this->get('tps_paypal.paypal_service');
	$paypalService->executeTransaction($checkoutId, $payerId);
}
```

### list payments

[](#list-payments)

```
public function paypalOverviewAction()
{
	$transactions = $this->paypalService->listTransactions();
	return $this->render('Acme:PaypalAdmin:overview.html.twig',
		array('payments' => $transactions->getPayments())
	);
}
```

Next steps
----------

[](#next-steps)

- Nicing the part

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

[![leberknecht](https://avatars.githubusercontent.com/u/1165177?v=4)](https://github.com/leberknecht "leberknecht (1 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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