Coder Social home page Coder Social logo

torys877 / crypto-metamask-eth-payment Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 4.0 1002 KB

Metamask & web3js Ethereum payment method extenstion for Magento 2 without any third party gateways

License: MIT License

PHP 76.49% HTML 8.11% JavaScript 15.40%
blockchain ether ethereum magento2 magento2-extension magento2-module magento2-payment metamask metamask-integration payment-methods

crypto-metamask-eth-payment's Introduction

CurrencyPrecision Magento 2 Extension

Metamask Ethereum payment method module for Magento 2

Table of contents

Description

Extension allows to receive direct payments from customer Ethereum blockchain wallet to merchant Ethereum wallet using Metamask in Ethereum cryptocurrency Ethers.

Idea

Using any gateways and third party services to make and receive payments breaks the philosophy of cryptocurrencies. If you use cryptocurrencies to pay you should be able to make it directly between wallets that no one can control, interrupt and change your transaction. But when this module was created there are only modules for Magento 2 from companies that are gateways between customer and merchant and handle the payment process, can control this process and payment processes in this case have no any differences from using bank account.

The main idea of this module is to allow you make and receive payments directly between wallets, without using any third party gateways and commission and pay only networks gas.

Features

  1. Display prices in Ether currency
  2. Pay by Ether from checkout after placing order
  3. Pay from customer accound order view page (customer can pay on checkout or, if have any troubles, later from his account)
  4. Check transaction status using web3js library
  5. Check transaction status through etherscan.io API request
  6. Check transactions by cron using etherscan.io API request
  7. Check transaction manually from admin area transaction page

Installation

To install module you need to add repositories to your composer.json:

Composer installation

    "repositories": {
        "crypto-base": {
            "type": "git",
            "url": "[email protected]:torys877/crypto-base.git"
        },
        "crypto-currency-precision": {
            "type": "git",
            "url": "[email protected]:torys877/crypto-currency-precision.git"
        },
        "crypto-metamask-eth-payment": {
            "type": "git",
            "url": "[email protected]:torys877/crypto-metamask-eth-payment.git"
        }
    }

Or add repositories from console:

composer config repositories.crypto-base git [email protected]:torys877/crypto-base.git

composer config repositories.crypto-currency-precision git [email protected]:torys877/crypto-currency-precision.git

composer config repositories.crypto-metamask-eth-payment git [email protected]:torys877/crypto-metamask-eth-payment.git

Install module:

composer require cryptom2/metamask-eth-payment:v1.0.0

And run

php bin/magento setup:upgrade

Settings

Checkout Payment Page

Live Settings

  • Enabled - enable/disable payment method
  • Title - payment method title
  • Ether Network Version - version of network (can be checked in metamask settings, by default Ethereus is 1, but testing networks have another version)
  • Merchant Ether Address - merchant ethereum address to take payment
  • Etherscan Url - url to view transactions (can be different in different networks, useful during testing)
  • Check transaction on Etherscan - if set not cron does not work and transactions are checking only on frontend on payment page using web3js
  • Etherscan Api Url - display if Check transaction on Etherscan is enabled. Api url for needed network to check transaction (can be different for different networks)
  • Etherscan Api Key - display if Check transaction on Etherscan is enabled. Api key for etherscan - can be taken on etherscan.io/apis

Test Mode

Settings are the same as for Live, but you need to use test networks (test network version, test network etherscan api url/key etc. On screen uses Ropsten network)

Display Eth Currency

To display ETH currency you also need to add it to allowed currencies and add currency rate in magento (automatically update rates will maybe included in future releases)

Screenshots

Display Prices

Display Prices

Payment Method On Checkout

Note: Payment method is displaying only if ETH currency selected 

Checkout payment method

Connect Wallet

Note: If wallet is not connected firstly customer sees 'Connect Wallet' button, then 'Pay' button

Connect Wallet

Pay by ETH

Pay By Eth

Processing Transaction

Note: After confirming transaction in Metamask wallet, customer should wait on the same page to magento confirm transaction
Magento sends request to metamask using Web3js and try to get confirmation message, after it, Magento
sends request to server and if Etherscan checking is enabled, transaction status also is checking on etherscan.

IMPORTANT: it is highly recommended to enable etherscan checking to prevent JS injection on processing page

Processing Transaction

Check transaction in admin area

Transaction ID is clickable and move you on etherscan page for this transaction

Check in admin area

Pay From Customer Account

If customer placed order but not paid it, he still can do it from his account. This button sends him to processing page and allows to do payment

Pay from customer account

Transaction Captured

When transaction is captured and approved in blockchain and magento, customer sees this message 

Pay from customer account

Author

Ihor Oleksiienko

License

Metamask Ethereum extension for Magento 2 is licensed under the MIT License - see the LICENSE file for details

crypto-metamask-eth-payment's People

Contributors

torys877 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

crypto-metamask-eth-payment's Issues

nft

Can nft product creation, management, metamask login and other modules also be developed, we can pay for it

Possibility with integrating with new ERC20 token

Dear contributors!
How are you? Hope you are well and everything is going well.

First of all, thanks for your effort and dedication to this project.
Currently I am building a project and while investigating and searching, I found your project.
And I thought your project is well-suite and is very necessary.
So I would like to use your project for it.
By the way, I would like to ask a few questions about it.
Hope you understand me and I appreciate if you answer my questions as soon as possible.

I have a magento2 project and I am gonna implement all the payments done by new made ERC20 token on private Ethereum chain.
What I mean is that I have new made ERC20 token on private Ethereum chain. It is still in test case, so I have test tokens.
So what I would like to know is that with your project, can I implement such a kind of my problem
If it is possible, it will be very great! If it possible, then can you please let me know how to do it briefly?
But if not, then what other solutions can you recommend me?

I would like to know these things.
Please read it carefully and let me know.

Thanks for again from bottom of my heart.
Kind regards

Prices are shown round up after activating the modules

We are using prices like 7.50 Euros for our product. All prices and other items like taxes are shown in the web UI as rounded (8 for 7.50 by example, 2 for 1.50, etc.). The final calculation is also rounded to the euro (but the calculation is correct, hence 8+2 = 9 because it is in fact 7.5 + 1.5).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.