PHPackages                             morpara/morpos-magento2 - 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. [Payment Processing](/categories/payments)
4. /
5. morpara/morpos-magento2

ActiveMagento2-module[Payment Processing](/categories/payments)

morpara/morpos-magento2
=======================

MorPOS Payment Gateway for Magento 2 - Accept secure credit and debit card payments through MorPOS payment gateway

1.0.0(3mo ago)02MITPHPPHP &gt;=7.0.0

Since Jan 29Pushed 3mo agoCompare

[ Source](https://github.com/morpara/morpos-magento2)[ Packagist](https://packagist.org/packages/morpara/morpos-magento2)[ RSS](/packages/morpara-morpos-magento2/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

MorPOS Payment Gateway for Magento 2
====================================

[](#morpos-payment-gateway-for-magento-2)

[![Magento Version](https://camo.githubusercontent.com/95f8ab7a934298c8b145796f4eac0faaaed29e5908699c3a3ab324e79da85aaa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6167656e746f2d322e322532422d6f72616e67652e737667)](https://magento.com/)[![PHP Version](https://camo.githubusercontent.com/177b75a56905a8525233776132d6e3f931021dfe605eccb366df02e238cbfb09/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e322532422d3737376262342e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

**MorPOS Payment Gateway for Magento 2** is a secure and easy-to-use payment gateway extension that integrates the **Morpara MorPOS** payment system with Magento 2 stores. Customers can complete their orders through a secure **Hosted Payment Page (HPP)** flow or use an **Embedded Payment Form** for a seamless checkout experience.

[![MorPOS Payment Gateway](view/frontend/web/images/morpos-logo-small.png)](view/frontend/web/images/morpos-logo-small.png)

✨ Features
----------

[](#-features)

- 🛒 **Magento 2 Integration**: Seamlessly adds MorPOS as a payment method for Magento 2.2+
- 🔒 **Secure Payments**: Hosted Payment Page (HPP) and Embedded Payment Form options
- 🌍 **Multi-Currency**: Supports TRY, USD, EUR currencies
- 💳 **Multiple Payment Options**: Credit cards, debit cards, and installment payments
- 🧪 **Sandbox Mode**: Complete test environment for development
- 🔧 **Easy Configuration**: Simple admin panel setup with connection testing
- 🛡️ **Security Features**: HMAC-based signature validation, CSP compliance, encrypted credentials
- 🏪 **Multi-Store**: Configure per store/website with different settings
- 👤 **Guest Checkout**: Full support for guest orders
- 🌐 **Multi-Language**: Supports Turkish and English (extensible)

📋 Requirements
--------------

[](#-requirements)

### Server Requirements

[](#server-requirements)

ComponentMinimumRecommended**Magento**2.22.4.8**PHP**7.28.1+**TLS**1.21.3### PHP Extensions

[](#php-extensions)

- `cURL` - Required for API communication
- `json` - Required for data processing
- `hash` - Required for security signatures
- `openssl` - Required for secure connections

### Magento Features

[](#magento-features)

- **Admin Panel Access**: Required for module configuration
- **Database Access**: For conversation tracking table
- **HTTPS**: Required for production environments

🚀 Installation
--------------

[](#-installation)

### Method 1: Via Composer (Recommended)

[](#method-1-via-composer-recommended)

1. **Require the Package**

    ```
    composer require morpara/morpos-magento2
    ```
2. **Enable the Module**

    ```
    php bin/magento module:enable MorPOS_PaymentGateway
    ```
3. **Run Setup Commands**

    ```
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy
    php bin/magento cache:flush
    ```

### Method 2: Manual Installation

[](#method-2-manual-installation)

1. **Download the Module**

    - Download the latest release from [GitHub Releases](https://github.com/morpara/morpos-magento2/releases)
2. **Extract to Magento**

    ```
    # Create directory structure
    mkdir -p app/code/MorPOS/PaymentGateway

    # Extract module files
    unzip morpos-magento.zip -d app/code/MorPOS/PaymentGateway
    ```
3. **Enable the Module**

    ```
    php bin/magento module:enable MorPOS_PaymentGateway
    ```
4. **Run Setup Commands**

    ```
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy
    php bin/magento cache:flush
    ```

### Method 3: FTP Upload

[](#method-3-ftp-upload)

1. Download the module files from [GitHub](https://github.com/morpara/morpos-magento2)
2. Extract the ZIP file
3. Using your FTP client, upload the contents to `app/code/MorPOS/PaymentGateway/`
4. Connect to your server via SSH and run the setup commands from Method 2

⚙️ Configuration
----------------

[](#️-configuration)

### 1. Access Settings

[](#1-access-settings)

Navigate to **Stores** → **Configuration** → **Sales** → **Payment Methods** → **MorPOS Payment Gateway**

### 2. Required Settings

[](#2-required-settings)

Fill in the following mandatory fields:

FieldDescriptionExample**Merchant ID**Your unique merchant identifier from MorPOS`12345`**Client ID**OAuth client identifier from MorPOS`your_client_id`**Client Secret**OAuth client secret from MorPOS`your_client_secret`**API Key**Authentication key for API requests`your_api_key`> **Where to get credentials?** Contact [Morpara Support](https://morpara.com/support) or visit [MorPOS Documentation](https://docs.morpara.com/) to obtain your merchant credentials.

### 3. Environment Settings

[](#3-environment-settings)

**Sandbox Mode**

- ✅ Enable for development/testing
- Uses sandbox endpoints
- No real transactions processed
- Test card numbers accepted

**Form Type**Choose your payment interface:

- **Hosted Payment Page (Redirect)**: Redirect to MorPOS payment page (recommended)
    - More secure
    - PCI compliance handled by MorPOS
    - Professional payment interface
- **Embedded Payment Form (Modal)**: Payment form within your site
    - Seamless checkout experience
    - Requires SSL certificate

**Order Status Settings**

- **New Order Status**: Status to set when payment succeeds (e.g., "Processing")

**Advanced Settings**

- **Payment from Applicable Countries**: Choose "All Allowed Countries" or "Specific Countries"
- **Payment from Specific Countries**: Select countries if using specific countries option
- **Minimum Order Total**: Optional minimum order amount
- **Maximum Order Total**: Optional maximum order amount
- **Sort Order**: Display order in payment methods list

### 4. Connection Test

[](#4-connection-test)

After entering credentials:

1. Click **Test Connection** button in the admin panel
2. Wait for the connection test to complete
3. Verify success message appears
4. If test fails, check credentials and sandbox mode setting

### 5. Enable the Payment Method

[](#5-enable-the-payment-method)

- Set **Enabled** to **Yes**
- Click **Save Config** to activate MorPOS on your store
- Clear cache: `php bin/magento cache:flush`

🔧 Payment Flow
--------------

[](#-payment-flow)

### Customer Checkout Process

[](#customer-checkout-process)

1. **Cart Review**: Customer reviews items in cart
2. **Checkout**: Customer proceeds to checkout
3. **Payment Selection**: Customer selects MorPOS as payment method
4. **Payment Initiation**:
    - System validates cart and creates order
    - Payment session initiated with MorPOS API
    - Unique conversation ID generated for tracking
5. **Payment Processing**:
    - **Hosted Mode**: Customer redirected to MorPOS payment page
    - **Embedded Mode**: Payment form loads in modal popup
6. **Payment Completion**:
    - Customer completes payment
    - MorPOS sends callback to store
    - Order status updated automatically
7. **Confirmation**: Customer sees success/failure page

### Security Features

[](#security-features)

The module implements multiple security layers:

- **Credential Encryption**: Client Secret and API Key are encrypted in database
- **Conversation Tracking**: Each payment gets unique tracking ID with HMAC-SHA256
- **Signature Verification**: All API requests are signed
- **CSP Compliance**: Automatic Content Security Policy configuration
- **HTTPS Only**: All API communication uses secure connections
- **No Sensitive Logging**: Request/response bodies are never logged

### Content Security Policy (CSP)

[](#content-security-policy-csp)

The module automatically whitelists MorPOS domains for iframe embedding:

- **Production**: `https://sale-gateway.morpara.com`
- **Sandbox**: `https://finagopay-pf-sale-api-gateway.prp.morpara.com`

No additional CSP configuration is required.

💳 Test Cards
------------

[](#-test-cards)

**Test Cards (Sandbox Mode Only):**

Refer to [MorPOS Documentation](https://docs.morpara.com/) for test card numbers and sandbox testing guidelines.

**Testing Checklist:**

- ✅ Successful payment flow
- ✅ Failed payment handling
- ✅ Network error scenarios
- ✅ Currency conversion (if applicable)
- ✅ Installment options
- ✅ Order status updates
- ✅ Guest checkout
- ✅ Registered customer checkout

🔍 Troubleshooting
-----------------

[](#-troubleshooting)

### Common Issues

[](#common-issues)

#### Payment method not showing at checkout

[](#payment-method-not-showing-at-checkout)

**Causes &amp; Solutions:**

1. **Module Not Enabled**

    - Check that the module is enabled: **Stores → Configuration → Sales → Payment Methods**
    - Verify "Enabled" is set to "Yes"
2. **Currency Not Supported**

    - Verify currency is supported (TRY, USD, EUR only)
    - Configure your store to use one of the supported currencies
3. **Order Total Restrictions**

    - Check minimum/maximum order total settings
    - Ensure order total falls within configured range
4. **Country Restrictions**

    - Verify country restrictions in configuration
    - Check customer's billing country is allowed
5. **Cache Issues**

    - Clear cache: `php bin/magento cache:flush`
    - Clear generated files: `rm -rf generated/code/*`

#### "Unable to initialize payment" error

[](#unable-to-initialize-payment-error)

**Causes &amp; Solutions:**

1. **Incorrect Credentials**

    - Verify Merchant ID, Client ID, Client Secret, and API Key
    - Use **Test Connection** feature to validate
2. **Environment Mismatch**

    - Ensure Sandbox Mode setting matches your credentials (test vs production)
3. **TLS Requirements**

    - Server must support TLS 1.2 or higher
    - Check OpenSSL version: `php -r "echo OPENSSL_VERSION_TEXT;"`
4. **cURL Issues**

    - Verify cURL extension is installed: `php -m | grep curl`

#### Order not created after successful payment

[](#order-not-created-after-successful-payment)

**Causes &amp; Solutions:**

1. **Callback URL Issues**

    - Check callback URL is accessible from internet
    - Verify server firewall allows incoming connections from MorPOS
2. **Quote Expiration**

    - Ensure quote has not expired during payment process
3. **Server Errors**

    - Review logs for callback processing errors
    - Check `var/log/system.log` for details

#### Connection Test Fails

[](#connection-test-fails)

1. **Firewall/Network Issues**

    ```
    # Test connectivity to MorPOS API
    curl -I https://sale-gateway.morpara.com
    ```
2. **DNS Resolution**

    ```
    # Verify DNS resolution
    nslookup sale-gateway.morpara.com
    ```
3. **Server Time**

    - Ensure server time is accurate (NTP recommended)

### Logging

[](#logging)

The module logs to Magento's standard logging system:

- **File**: `var/log/system.log`
- **Level**: Info for normal operations, Error for failures
- **Content**: No sensitive data is logged (security)

**Enable Detailed Logging:**

```
php bin/magento config:set dev/debug/debug_logging 1
```

**Check Logs:**

```
tail -f var/log/system.log | grep -i morpos
```

🌐 Internationalization
----------------------

[](#-internationalization)

The module supports multiple languages:

- **Turkish (tr\_TR)**: Native support
- **English (en\_US)**: Default language

### Adding New Translations

[](#adding-new-translations)

1. **Create Language File:**

    ```
    # Copy existing translation file
    cp app/code/MorPOS/PaymentGateway/i18n/en_US.csv \
       app/code/MorPOS/PaymentGateway/i18n/de_DE.csv
    ```
2. **Translate Strings:**Edit the CSV file and translate the strings
3. **Deploy Static Content:**

    ```
    php bin/magento setup:static-content:deploy de_DE
    php bin/magento cache:flush
    ```

📁 Developer Information
-----------------------

[](#-developer-information)

### Module Structure

[](#module-structure)

```
MorPOS/PaymentGateway/
├── Api/                    # API interfaces
├── Block/                  # UI blocks
├── Controller/             # Frontend controllers
├── Gateway/                # Payment gateway infrastructure
├── Helper/                 # Helper classes
├── Model/                  # Business logic and data models
├── Plugin/                 # Magento plugins
├── Setup/                  # Database installation scripts
├── etc/                    # Configuration files
├── i18n/                   # Translations
└── view/                   # Templates, layouts, static assets

```

### Database Tables

[](#database-tables)

TableDescription`morpara_morpos_conversation`Tracks payment attempts and status### Events

[](#events)

The module integrates with Magento's standard payment events and does not dispatch custom events.

### API Endpoints

[](#api-endpoints)

EndpointMethodDescription`/morpos/payment/start`POSTInitiates payment session`/morpos/payment/callback`POSTHandles MorPOS callbacks`/morpos/payment/success`GETSuccess redirect handler`/morpos/payment/cancel`GETCancel redirect handler🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Here's how to get started:

### Development Setup

[](#development-setup)

1. **Fork the Repository**

    ```
    git clone https://github.com/your-username/morpos-magento.git
    cd morpos-magento
    ```
2. **Set Up Local Environment**

    - Install Magento 2 locally
    - Link or copy module to `app/code/MorPOS/PaymentGateway/`
    - Enable developer mode: `php bin/magento deploy:mode:set developer`
3. **Make Changes**

    - Follow Magento coding standards
    - Add PHPDoc comments
    - Test thoroughly
4. **Submit Pull Request**

    - Create feature branch: `git checkout -b feature/your-feature`
    - Commit changes: `git commit -m "Add your feature"`
    - Push to branch: `git push origin feature/your-feature`
    - Open pull request on GitHub

### Coding Standards

[](#coding-standards)

- Follow [Magento Coding Standards](https://developer.adobe.com/commerce/php/coding-standards/)
- Use PSR-4 autoloading for PHP classes
- Include PHPDoc comments for functions and classes
- Write meaningful commit messages

### Testing Guidelines

[](#testing-guidelines)

Before submitting a pull request, test:

1. **Installation/Uninstallation**

    - Clean installation works
    - Uninstallation removes all data
    - Upgrade from previous version
2. **Payment Flows**

    - Successful payment (hosted &amp; embedded)
    - Failed payment handling
    - Callback processing
    - Network errors
3. **Multi-Currency**

    - TRY, USD, EUR transactions
    - Currency display in admin and frontend
4. **Compatibility**

    - Magento 2.2, 2.3, 2.4
    - PHP 7.3, 7.4, 8.0, 8.1, 8.2

📄 License
---------

[](#-license)

This project is licensed under the **MIT** License - see the [LICENSE](LICENSE) file for details.

🆘 Support
---------

[](#-support)

### Documentation

[](#documentation)

- **MorPOS Documentation**:
- **MorPOS Dashboard**:
- **Magento Documentation**:

### Issue Reporting

[](#issue-reporting)

- **GitHub Issues**: [Report a Bug](https://github.com/morpara/morpos-magento2/issues)
- Include:
    - Magento version
    - PHP version
    - Module version
    - Error messages / logs
    - Steps to reproduce

### Commercial Support

[](#commercial-support)

- **Morpara Support**: [Contact Support](https://morpara.com/support)
- **Email**:

### Magento-Specific Issues

[](#magento-specific-issues)

- Check Magento logs: `var/log/system.log`
- Run diagnostics: `php bin/magento setup:di:compile`
- Verify module status: `php bin/magento module:status MorPOS_PaymentGateway`

🙏 Acknowledgments
-----------------

[](#-acknowledgments)

- **Adobe/Magento Team** - For the excellent e-commerce platform
- **Magento Community** - For the robust ecosystem and support
- **Morpara** - For the secure payment infrastructure

🔐 Security
----------

[](#-security)

If you discover a security vulnerability, please email  instead of using the issue tracker. All security vulnerabilities will be promptly addressed.

### Security Features

[](#security-features-1)

- ✅ TLS 1.2+ encrypted communication
- ✅ Signed API requests with HMAC-SHA256
- ✅ Encrypted credential storage
- ✅ Conversation ID tracking
- ✅ Content Security Policy (CSP) compliance
- ✅ SQL injection prevention (Magento ORM)
- ✅ XSS protection (output escaping)
- ✅ CSRF protection (Magento form keys)
- ✅ No sensitive data logging

---

📝 Changelog
-----------

[](#-changelog)

### Version 1.0.0

[](#version-100)

- Initial release
- Hosted payment page support
- Embedded payment form support
- Multi-currency support (TRY, USD, EUR)
- Sandbox mode
- Multi-store configuration
- Guest checkout support
- Turkish and English translations

---

**Made with ❤️ by [Morpara](https://morpara.com/)**

For more information about MorPOS payment solutions, visit [morpara.com](https://morpara.com/) or check the [documentation](https://docs.morpara.com/).

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance86

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

100d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/90de8a03ca2af816ede5634e1e184c7a11d290ba375b9f992e0d3faecbc8f556?d=identicon)[morpos](/maintainers/morpos)

---

Top Contributors

[![morpos](https://avatars.githubusercontent.com/u/232352470?v=4)](https://github.com/morpos "morpos (1 commits)")[![mrfade](https://avatars.githubusercontent.com/u/7377876?v=4)](https://github.com/mrfade "mrfade (1 commits)")

### Embed Badge

![Health badge](/badges/morpara-morpos-magento2/health.svg)

```
[![Health](https://phpackages.com/badges/morpara-morpos-magento2/health.svg)](https://phpackages.com/packages/morpara-morpos-magento2)
```

###  Alternatives

[mollie/magento2

Mollie Payment Module for Magento 2

1121.6M10](/packages/mollie-magento2)[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50374.2k18](/packages/dotdigital-dotdigital-magento2-extension)[amzn/amazon-pay-magento-2-module

Official Magento2 Plugin to integrate with Amazon Pay

109501.7k1](/packages/amzn-amazon-pay-magento-2-module)[paynl/magento2-plugin

Pay. Payment methods for Magento 2

30311.2k5](/packages/paynl-magento2-plugin)[o2ti/sigep-web-carrier

O2TI - Sigep Web Carrier

141.5k](/packages/o2ti-sigep-web-carrier)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
