PHPackages                             adamstacey/module-sample-payment-gateway - 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. adamstacey/module-sample-payment-gateway

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

adamstacey/module-sample-payment-gateway
========================================

Demonstrates integration with payment gateway

2.0.x-dev(9y ago)09OSL-3.0PHPPHP ~5.5.0|~5.6.0|~7.0.0

Since Feb 9Pushed 5y agoCompare

[ Source](https://github.com/adamstacey/magento-2-sample-payment-method)[ Packagist](https://packagist.org/packages/adamstacey/module-sample-payment-gateway)[ RSS](/packages/adamstacey-module-sample-payment-gateway/feed)WikiDiscussions master Synced 1mo ago

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

Magento 2 sample payment method gateway
=======================================

[](#magento-2-sample-payment-method-gateway)

[**Magento 2 Create Payment Method**](https://www.mageplaza.com/magento-2-create-payment-method/) proves that store admin has rights to generate as many payment methods as they need when your store is based on Magento 2 platform, an great era of ecommerce architecture. Depending on the customer's requirement, you probably plug it in your list of the existing payment method. The additional payment methods surely bring the diversity of customer choice when they proceed to checkout on your site. On the other's hands, multiple payment method is the great strategy to reach out the global marketplace.

In the tutorial, you will learn how to create own Payment Gateway integration in Magento 2 stores. After launching the new payment methods, you will find and configure it according the path `Admin panel > Stores > Settings > Configuration > Sales > Payment Methods`. There, admin possibly assigns a payment method to specific shipping method, this means they will work in pairs when enabling.

Step 1: Create payment method module
------------------------------------

[](#step-1-create-payment-method-module)

1. Create file [registration.php](https://github.com/mageplaza/magento-2-sample-payment-method/blob/master/registration.php)

```

```

This module have to run after the Magento\_Sales, Magento\_Payment, Magento\_Checkout, Magento\_Directory, and Magento\_Config. So we add depends (sequence) them like above block of code.

Step 2: Declare payment method module
-------------------------------------

[](#step-2-declare-payment-method-module)

1. Now we create file `payment.xml` file in `etc` folder [etc/payment.xml](https://github.com/mageplaza/magento-2-sample-payment-method/blob/master/etc/payment.xml)

```

            Offline Payment Methods

            1

```

2. Create `config.xml` file in `etc` folder.

```

                1
                Mageplaza\Payment\Model\Payment\Simple
                pending
                Simple
                0
                Offline

```

In this file, we declare Model of this payment method, we calle `Simple` model.

3. Create Simple model file

Create file [Model/Payment/Simple.php](https://github.com/mageplaza/magento-2-sample-payment-method/blob/master/Model/Payment/Simple.php)

```
