PHPackages                             dnetix/redirection - 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. dnetix/redirection

ActiveLibrary[Payment Processing](/categories/payments)

dnetix/redirection
==================

Library to connect with PlacetoPay Checkout service

2.1.3(2mo ago)17123.3k—7.6%232MITPHPPHP &gt;=7.4CI passing

Since Oct 26Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/dnetix/redirection)[ Packagist](https://packagist.org/packages/dnetix/redirection)[ RSS](/packages/dnetix-redirection/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (45)Used By (2)

PlacetoPay Redirection PHP library
==================================

[](#placetopay-redirection-php-library)

[![codecov](https://camo.githubusercontent.com/f7cd00c5b0ad2bb673d2234792eff82c38b8bc8cd0b9adfd38db1ba74f0879d6/68747470733a2f2f636f6465636f762e696f2f67682f646e657469782f7265646972656374696f6e2f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d37514231325856535447)](https://codecov.io/gh/dnetix/redirection)

With this code you will be able to quickly connect with the PlacetoPay Checkout service.

In order to see more comprehensive examples of how it works, please refer to the examples and the [documentation](https://docs-gateway.placetopay.com/)

### Migration from version 1

[](#migration-from-version-1)

- Change the settings parameter `url` for `baseUrl`
- If you have set the `timeout` for rest then change it to the root of the settings
- `PlacetoPayServiceException` is thrown instead of returning an ERROR status response

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

[](#installation)

Using composer from your project

```
composer require dnetix/redirection

```

Or If you just want to run the examples contained in this project run "composer install" to load the vendor autoload

Usage
-----

[](#usage)

Create an object with the configuration required for that instance

```
$placetopay = new Dnetix\Redirection\PlacetoPay([
    'login' => 'YOUR_LOGIN', // Provided by PlacetoPay
    'tranKey' => 'YOUR_TRANSACTIONAL_KEY', // Provided by PlacetoPay
    'baseUrl' => 'https://THE_BASE_URL_TO_POINT_AT',
    'timeout' => 10, // (optional) 15 by default
]);
```

### Creating a new Payment Request to obtain a Session Payment URL

[](#creating-a-new-payment-request-to-obtain-a-session-payment-url)

Just provide the information of the payment needed and you will get a process url if its successful, for this example we are using the MINIMUM INFORMATION that needs to be provided, to see the full structure refer to the documentation or the example on [examples/basic/payment.php](examples/basic/payment.php)

```
$reference = 'COULD_BE_THE_PAYMENT_ORDER_ID";
$request = [
    'payment' => [
        'reference' => $reference,
        'description' => 'Testing payment',
        'amount' => [
            'currency' => 'USD',
            'total' => 120,
        ],
    ],
    'expiration' => date('c', strtotime('+2 days')),
    'returnUrl' => 'http://example.com/response?reference=' . $reference,
    'ipAddress' => '127.0.0.1',
    'userAgent' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36',
];

$response = $placetopay->request($request);
if ($response->isSuccessful()) {
    // STORE THE $response->requestId() and $response->processUrl() on your DB associated with the payment order
    // Redirect the client to the processUrl or display it on the JS extension
    $response->processUrl();
} else {
    // There was some error so check the message and log it
    $response->status()->message();
}

```

### Obtain information about a previously created session

[](#obtain-information-about-a-previously-created-session)

```
$response = $placetopay->query('THE_REQUEST_ID_TO_QUERY');

if ($response->isSuccessful()) {
    // In order to use the functions please refer to the Dnetix\Redirection\Message\RedirectInformation class

    if ($response->status()->isApproved()) {
        // The payment has been approved
    }
} else {
    // There was some error with the connection so check the message
    print_r($response->status()->message() . "\n");
}

```

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance86

Actively maintained with recent releases

Popularity44

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 92% 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 ~83 days

Recently: every ~309 days

Total

42

Last Release

69d ago

Major Versions

0.6.1 → 1.0.02019-11-02

1.0.10 → 2.0.42021-09-23

PHP version history (3 changes)0.1.1PHP &gt;=5.4

1.0.0PHP &gt;=7.0

2.0.4PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/03d2682a1a3738e26a24c2233b17f57a902d930b534dab3898a7d43616410580?d=identicon)[dnetix](/maintainers/dnetix)

---

Top Contributors

[![dnetix](https://avatars.githubusercontent.com/u/4644865?v=4)](https://github.com/dnetix "dnetix (185 commits)")[![freddiegar](https://avatars.githubusercontent.com/u/8710491?v=4)](https://github.com/freddiegar "freddiegar (7 commits)")[![mmp2p](https://avatars.githubusercontent.com/u/35037225?v=4)](https://github.com/mmp2p "mmp2p (2 commits)")[![eduarguz](https://avatars.githubusercontent.com/u/14934055?v=4)](https://github.com/eduarguz "eduarguz (2 commits)")[![andrextor](https://avatars.githubusercontent.com/u/26684203?v=4)](https://github.com/andrextor "andrextor (1 commits)")[![shixzie](https://avatars.githubusercontent.com/u/21351290?v=4)](https://github.com/shixzie "shixzie (1 commits)")[![cruedam](https://avatars.githubusercontent.com/u/118549357?v=4)](https://github.com/cruedam "cruedam (1 commits)")[![herodez](https://avatars.githubusercontent.com/u/9168620?v=4)](https://github.com/herodez "herodez (1 commits)")[![sgodoy17](https://avatars.githubusercontent.com/u/9864705?v=4)](https://github.com/sgodoy17 "sgodoy17 (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/dnetix-redirection/health.svg)

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

###  Alternatives

[buckaroo/sdk

Buckaroo payment SDK

12189.1k9](/packages/buckaroo-sdk)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[amazonpaymentservices/aps-php-sdk

Amazon Payment Services PHP SDK

3114.6k](/packages/amazonpaymentservices-aps-php-sdk)[contica/facturador-electronico-cr

Un facturador de código libre para integrar facturación electrónica en Costa Rica a un proyecto PHP

2128.8k](/packages/contica-facturador-electronico-cr)

PHPackages © 2026

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