GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - alejobit/placetopay-pse-php: Use PlacetoPay PSE service in your PHP project

BranchesTags
Open more actions menu

Latest commit

 

History

22 Commits
22 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

PlacetoPay PSE SDK for PHP

Build Status StyleCI

Use PlacetoPay PSE service in your PHP project

Requirements

  • XML and SOAP extensions must be enabled

Installattion

Add alejobit/placetopay-pse-php as a require dependency in your composer.json file:

composer require alejobit/placetopay-pse-php

For the best operation of the client it is necessary to implement a caching library compatible with the standard PSR-6.

If your project does not have a compatible implementation, you can proceed to install the following library:

composer require symfony/cache

Usage

Create a PSE client instance, note that the $login and $tranKey are given by PlacetoPay to be able to perform transactions on behalf of a collection site

use PlacetoPay\PSE\PSE;

$pse = new PSE($login, $tranKey);

Setting the PSR-6 cache adapter instance (which must implement Psr\Cache\CacheItemPoolInterface)

$pse->setCacheAdapter(CacheItemPoolInterface $cacheAdapter);

Obtains the list of banks available for the trading establishment in the PSE system of ACH Colombia

This method returns a PlacetoPay\PSE\Struct\ArrayOfBanks object (which implements \Iterator and \Countable interfaces)

$bankList = $pse->getBankList();

Create transactions with the createTransaction() and createTransactionMultiCredit() methods:

$transaction = $pse->createTransaction();
$multiCreditTransaction = $pse->createTransactionMultiCredit();

Load the transaction information as follows:

$transaction->setBankCode($bank->getCode());
$transaction->setBankInterface(Bank::PERSONAL_INTERFACE);
$transaction->setReturnURL('https://www.placetopay.com');
$transaction->setReference(md5('reference'));
$transaction->setDescription('Description of transaction');
$transaction->setLanguage('ES');
$transaction->setCurrency('COP');
$transaction->setTotalAmount(12345.6);
$transaction->setTaxAmount(0.0);
$transaction->setDevolutionBase(0.0);
$transaction->setTipAmount(0.0);
$transaction->setPayer(array(
    'documentType' => 'CC',
    'document' => '123456789',
    'firstName' => 'Foo',
    'lastName' => 'Bar',
    'company' => 'PlacetoPay',
    'emailAddress' => '[email protected]',
    'address' => 'Calle 53 No. 45 – 112 OF. 1901',
    'city' => 'Medellín',
    'province' => 'Antioquia',
    'country' => 'CO',
    'phone' => '+57 (4) 444 2310',
    'mobile' => '+57 (4) 444 2310',
));
$transaction->setIpAddress('127.0.0.1');
$transaction->addAdditionalData('name', 'value');

MultiCredit transactions have an additional method to add credit concepts of the same as follows

$multiCreditTransaction->addCreditConcept(array(
    'entityCode'=> '123456',
    'serviceCode' => '654321',
    'amountValue' => 12345.6,
    'taxValue' => 0.0,
    'description' => 'Description of credit concept',
));

Once loaded all the necessary data is sent the transaction with the method send()

The send() method return a PlacetoPay\PSE\Struct\PSETransactionResponse with the result of the operation

$response = $transaction->send()

To obtain the information of a specific transaction can use the method getTransactionInformation($id) passing the unique identifier of the transaction to consult

$transactionInfo = $pse->getTransactionInformation($response->getTransactionId());

Related project

  • PlacetoPay PSE Pimple Service Provider, this library is compatible with Pimple based projects, such as the Silex micro-framework

About

Use PlacetoPay PSE service in your PHP project

Resources

Readme
License
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.