payplug-plugin-mcp

payplug/payplug-plugin-mcp Checked 2 days ago

Description Module core for Payplug integration.

Description Module core for Payplug integration. Enables management of payments, merchants, and notifications via the Payplug API. Requirements - PHP 7.1 or higher - Composer - Payplug PHP SDK (vendor payplug/payplug-php) Features - Major features: - Merchant management (authentication, module configuration based on permissions) - Payment management (creation, cancellation, refund) on the Payplug API via the vendor payplug/payplug-php - Webhook for receiving Payplug notifications - Saved payer card management in the Payplug API

Summary extracted from the README.

Payplug Plugin Core

Description

Module core for Payplug integration. Enables management of payments, merchants, and notifications via the Payplug API.

Requirements

  • PHP 7.1 or higher
  • Composer
  • Payplug PHP SDK (vendor payplug/payplug-php)

Installation

Option 1 - Strongly recommanded via composer:

  • Get composer from the composer website_.
  • Make sure you have initialized your composer.json.
  • Run composer require payplug/payplug-php from your project directory.

_composer website: https://getcomposer.org/download/

Option 2 - clone the repository:

git clone https://github.com/payplug/payplug-plugin-core.git

Docker ?

Features

  • Major features:

    • Merchant management (authentication, module configuration based on permissions)
    • Payment management (creation, cancellation, refund) on the Payplug API via the vendor payplug/payplug-php
    • Webhook for receiving Payplug notifications
    • Saved payer card management in the Payplug API
  • Minor features:

    • Error and log management
    • Concurrence handler (queuing system, text file, ?)
    • Validation of received data
    • Multilingual support (messages, notifications)
    • HTTP response management (statuses, messages)
    • Basic user interface management (confirmation/error messages)
    • Requirements validation

Structure of the module

src  
├── actions: All actions related to a workflow  
├── gateways: All gateway  
├── utilities  
│   ├── helpers: Reusable static methods, generic, non-business  
│   ├── validators: Data validation (validator)  
│   ├── traits: Reusable methods for one or more classes/interfaces  
│   └── services: Ready-to-use object (single task)  
├── models  
│   ├── repositories: Communication with the database
│   ├── entities: Definition of an object and its attributes (getter/setter)  
│   └── classes  
│       ├── Abstract classes: Base models not instantiable (gateway, address, card)  
│       ├── Extended classes  
│       └── Final classes: Final classes not extendable (ipn, lock)  
└── interfaces: Definition of methods specific to a class

Endpoint payplug plugin

  • Merchant experience and actions:

    • user login
    • user logout
    • get user/merchant permissions
    • validate module requirements
    • configure payment features
    • create payment resource
    • abort payment resource
    • capture payment resource
    • refund payment resource
  • User experience and actions:

    • initiate payment
    • delete saved card
  • Automated actions:

    • on order creation
    • on language addition/modification/deletion
    • on order state addition/modification/deletion
    • on order history addition
  • Display hooks:

    • display customer account
    • display CTA button
    • display order statuses form
    • display validation
    • display header
    • display payment options
    • display admin order content
    • display admin plugin configuration
    • display payplug payment listing ?
  • Webhook (notifications):

    • handle payment notification use to create/update order
    • handle refund notification
    • handle merchand offer upgrade
    • handle merchand revocation

Next step Dev :

  • Develop endpoint to create a payment link

Quick start:

make install        # Build Docker image, install dependencies and git hooks

make cs-fix         # Fix code style
make cs-lint        # Check code style (dry-run)
make stan           # Run PHPStan static analysis

make test-unit      # Run all PHPUnit tests
make test-unit-units  # Run unit tests only
make test-unit-inte   # Run integration tests only

make ci             # Run all checks (stan + cs-lint + tests)

make debug          # Open a shell with Xdebug step-debug enabled