Skip to content

Payment with PlacetoPay on Prestashop CMS

License

Notifications You must be signed in to change notification settings

freddiegar/prestashop-gateway

Repository files navigation

Prestashop Gateway to PlacetoPay

PlacetoPay Plugin Payment for Prestashop 1.5, 1.6 and 1.7 Stable

Prerequisites

  • php >= 5.6.0
  • ext-curl
  • ext-soap
  • ext-json
  • ext-mbstring
  • prestashop >= 1.5

Compatibility Version

PrestaShop Plugin Comments
1.5.x ~2.6.4 @deprecated
1.6.x >=2.6.4 From 1.6.0.5
1.7.x 3.* Until 1.7.4.4 (tested)

View releases here

Manual Installation

Create placetopaypayment folder (this is required, with this name)

mkdir /var/www/html/modules/placetopaypayment

Clone Project in modules

git clone https://github.com/freddiegar/prestashop-gateway.git /var/www/html/modules/placetopaypayment

Set permissions and install dependencies with composer

cd /var/www/html/modules/placetopaypayment \ 
    && sudo setfacl -dR -m u:www-data:rwX -m u:`whoami`:rwX `pwd` \ 
    && sudo setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX `pwd` \
    && composer install

Docker Installation

Install PrestaShop 1.6 (latest in 1.6 branch) with PHP 5.6 (and MySQL 5.7). In folder of project;

cd /var/www/html/modules/placetopaypayment
make install

Then... (Please wait few minutes, while install ALL and load Apache :D to continue), you can go to

If server return error code (400, 404, 500) you can status in docker logs until that installation process end, use:

make logs-prestashop

Preshtashop Admin Access

MySQL Access

  • user: root
  • password: admin
  • database: prestashop

See details in docker-compose.yml file or run make config command

Customize docker installation

Default versions

  • PrestaShop: 1.6
  • PHP: 5.6
  • MySQL: 5.7

Others installation options are here, You can change versions in .env file

# PrestaShop 1.7 with PHP 7.0
PS_VERSION=1.7-7.0

# PrestaShop 1.6.1.1 with PHP 5.6
PS_VERSION=1.6.1.1

# PrestaShop latest with PHP 5.6 and MySQL 5.5
PS_VERSION=latest
MYSQL_VERSION=5.5

Binding ports

Ports by default in this installation are

  • Web Server (WEB_PORT): 8787 => 80
  • Database (MYSQL_PORT): 33060 => 3306

You can change versions in .env file

Used another database in docker

You can override setup in docker, rename docker-compose.override.example.yml to docker-compose.override.yml and customize your installation, by example

version: "3.2"

services:
  # This service is shutdown
  database:
    entrypoint: "echo true"

  prestashop:
    environment:
      # IP Address or name from database to use
      DB_SERVER: my_db

Setup Module

Install and setup you login and trankey in your store!

Maybe you need to setup on shipping carriers.

Enjoy development and testing!

SMTP Email

Change email configuration to use mailtrap.io in development

USE prestashop;

UPDATE ps_configuration SET value='2' where name = 'PS_MAIL_METHOD';
UPDATE ps_configuration SET value='smtp.mailtrap.io' where name = 'PS_MAIL_SERVER';
UPDATE ps_configuration SET value='user' where name = 'PS_MAIL_USER';
UPDATE ps_configuration SET value='password' where name = 'PS_MAIL_PASSWD';
UPDATE ps_configuration SET value='off' where name = 'PS_MAIL_SMTP_ENCRYPTION';
UPDATE ps_configuration SET value='2525' where name = 'PS_MAIL_SMTP_PORT';

Error Codes

Code Description
1 Create payments table is failed
2 Add email column is failed
3 Add id_request column is failed
4 Add reference column is failed
5 Update ipaddres column is failed
6 Login and TranKey is not set
7 Payment is not allowed by pending transactions
8 Payment process is failed
9 Reference (encrypt) is not found
10 Reference (decrypt) is not found
11 Id Request (decrypt) is not found
12 Try to change payment without status PENDING
13 PlacetoPay connection is failed
14 Order related with payment not found
15 Get payment in payment table is failed
16 Command not available in this context
17 Access not allowed
18 Cart empty or already used
99 Un-known error, module not installed?
100 Install process is failed
201 Order id is not found
202 Order is not loaded
301 Customer is not loaded
302 Address is not loaded
303 Currency is not loaded
304 Currency is not supported by PlacetoPay
401 Create payment PlacetoPay is failed
501 Payload notification PlacetoPay not is valid
601 Update status payment PlacetoPay fail
801 Get order by id is failed
901 Get last pending transaction is failed
999 Un-know error

Troubleshooting

If shop is not auto-installed, then rename folder xinstall in container and installed from wizard

make bash-prestashop
mv xinstall install

This apply to last versions from PrestaShop (>= 1.7)

Compile Module

In terminal run

make compile

Or adding version number in filename use

make compile PLUGIN_VERSION=_X.Y.Z

Test Version

In terminal run

make download PRESTASHOP_VR=X.Y.Z

Previous versions available

And go: install/X.Y.Z

Quality

During package development I try as best as possible to embrace good design and development practices, to help ensure that this package is as good as it can be. My checklist for package development includes:

  • Be fully PSR1, PSR2, and PSR4 compliant.
  • Include comprehensive documentation in README.md.
  • Provide an up-to-date CHANGELOG.md which adheres to the format outlined at keepachangelog.
  • Have no phpcs warnings throughout all code, use composer test command.

About

Payment with PlacetoPay on Prestashop CMS

Resources

License

Stars

Watchers

Forks

Packages

No packages published