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

ActiveLibrary[Payment Processing](/categories/payments)

alejociro/redirection
=====================

Library to connect with PlacetoPay Checkout service

1.0.17(3mo ago)07.0k↓35.3%MITPHPPHP &gt;=7.1CI passing

Since Oct 27Pushed 3mo agoCompare

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

READMEChangelog (7)Dependencies (6)Versions (15)Used By (0)

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

44

—

FairBetter than 92% of packages

Maintenance81

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.5% 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 ~176 days

Recently: every ~248 days

Total

7

Last Release

102d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78d0b33cfa92a51f89e476b053b0c1b782d9ef4366016ffbb2e5643dc2c94ce4?d=identicon)[alejociro](/maintainers/alejociro)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[dnetix/redirection

Library to connect with PlacetoPay Checkout service

17123.3k2](/packages/dnetix-redirection)[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)
