PHPackages                             zea/rest-library - 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. zea/rest-library

ActiveLibrary[API Development](/categories/api)

zea/rest-library
================

Library to connect with the PlacetoPay Rest api

021PHP

Since Oct 12Pushed 3y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

PlacetoPay Api Rest PHP library
===============================

[](#placetopay-api-rest-php-library)

With this code you will be able to quickly connect with the PlacetoPay Rest 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/)

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

[](#installation)

Using composer from your project

```
composer require zea/rest-library

```

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 Zea\RestLibrary\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 get a Payment Response

[](#creating-a-new-payment-request-to-get-a-payment-response)

Simply provide the necessary payment information and you will get a Process Response if successful, for this example, are using the MINIMUM INFORMATION that must be provided, to see the complete structure, consult the documentation or the example in [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,
        ],
    ],
    'instrument' => [
        'card' => [
            'number' => '36545400000008',
            'expiration' => '12/20',
            'cvv' => '123',
            'installments' => 2
        ]
    ],
    '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->process($request);
if ($response->isSuccessful()) {
    $response->toArray()['response'];
} else {
    // There was some error so check the message and log it
    $response->status()->message();
}

```

### Obtain information about a previously made payment

[](#obtain-information-about-a-previously-made-payment)

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

if ($response->isSuccessful()) {

    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

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 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/6ef838371bc718a7efe3b94cb823f17e637adec99ed761ec1381974e8329f29d?d=identicon)[Andres Zea](/maintainers/Andres%20Zea)

---

Top Contributors

[![AndresZea2003](https://avatars.githubusercontent.com/u/89661513?v=4)](https://github.com/AndresZea2003 "AndresZea2003 (13 commits)")

### Embed Badge

![Health badge](/badges/zea-rest-library/health.svg)

```
[![Health](https://phpackages.com/badges/zea-rest-library/health.svg)](https://phpackages.com/packages/zea-rest-library)
```

###  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)
