npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-prestashop-payment-module

v0.0.2

Published

Generate a PrestaShop module to handle payments

Downloads

3

Readme

#generator-prestashop-payment-module Build Statusnpm versionCoverage Status

Yeoman generator for PrestaShop - lets you quickly set up a payment module

Payment modules for PrestaShop almost always share the same architecture and it's painful to write them from scratch for each new payment provider.

This project generates a well architectured payment module which follows the PrestaShop best practices. It lets you focus on the implementation of the payment provider API and the user experience.

What you get

.
├── README.md
├── classes
│   ├── PaymentProviderApi.php
│   └── index.php
├── controllers
│   ├── front
│   │   ├── index.php
│   │   ├── notification.php
│   │   └── redirect.php
│   └── index.php
├── index.php
├── mymodule.php
├── translations
│   └── index.php
├── upgrade
│   ├── index.php
│   └── upgrade-1.1.0.php
└── views
    ├── css
    │   ├── back.css
    │   ├── front.css
    │   └── index.php
    ├── index.php
    ├── js
    │   ├── back.js
    │   ├── front.js
    │   └── index.php
    └── templates
        ├── admin
        │   └── index.php
        ├── front
        │   ├── index.php
        │   └── redirect.tpl
        ├── hooks
        │   ├── index.php
        │   └── payment.tpl
        └── index.php

Requirements

You just need Node.js and NPM installed on your machine

Getting started

Install Yeoman if you don't have it already:

npm install -g yo

Install this generator:

npm install -g generator-prestashop-payment-module

Let the magic happen :tada: :

yo prestashop-payment-module

At this stage you'll be prompted for the following details:

  • Technical Name: The module repository name. The generator will also create a PascalCase version of this string, and use it as the module main class
  • Display Name: This is the name that the merchant will see in the PrestaShop backoffice.
  • Author and Author Email: Just put your name and your email
  • Description: This text will be displayed in the PrestaShop backoffice, just under the Display Name. You can use buzzwords and marketing stuff here but keep it short ( <= 200 characters)
  • Select hooks: This is a work in progress. Just type Enter because this input will be ignored for now. By default, the module is hooked on displayBackofficeHeader, displayHeader, displayPayment, and displayPaymentReturn.
  • Confirm Uninstall Message: The message to display when the merchants uninstall the module from his store.
  • Payment provider name: There are tons of payment service providers (or PSP) out there. Just put the name of the one you want to implement.

:warning: These inputs are piped through validation functions so if you're stuck on the prompt, that probably means that you're current proposition doesn't match the expected format. Feel free to open an issue if you find a bug.

Et voilà ! A brand new payment module is born at your current location, put in in the modules folder of a PrestaShop store, and install it via its backoffice.

TODO

  • [ ] 100% code coverage
  • [ ] Hooks selection on the prompt - WIP
  • [x] Instructions for the prompt
  • [ ] Developer documentation
  • [ ] Generic logo/images
  • [ ] PHPDoc Compliancy
  • [ ] PSR-2 Compliancy