Giter Site home page Giter Site logo

payment-server's Introduction

Example Micropayment Payment Server

This is an example Payment Server for the Hedera Hashgraph public network. It acts as a payment gateway, allowing developers to more easily monetize of any type of content on the web via micropayments.

Background

Hedera's example payment server was originally built for Hedera's community testing program, alongside example mobile wallets (iOS, Android), a WordPress plugin, and a chrome browser extension.

You can read a technical deep dive on Hedera's community testing program, written by Calvin Cheng, if you're curious to learn more.

How it works

We implemented a socketio based server that listens to a socketio event, in this case a CRYPTOTRANSFER from our Hedera Browser Extension.

Next it will receive a cryptographically signed CryptoTransfer transaction object passed from the Hedera Browser Extension.

On receipt of the signed transaction object from the Hedera Browser Extension, this payment server will then proxy the transaction object to a node in Hedera Network, via a gRPC network call.

The gRPC response from Hedera Network will then be handled and pushed back to listening socketio clients via the CRYPTOTRANSFER_RESPONSE event, in our example's case, a WordPress website and plugin.

Technology Stack

While this Payment Server could be implemented in any language of your choosing, for our purposes, we choose to implement with node.js using the very popular express.js framework.

It also uses socket.io for persistent connections between the Hedera Browser Extension, this payment server, and clients wishing to interact with both.

Hedera Hashgraph's APIs are implemented in protobufs are used in this project, which you can learn more about here.

Set Up

# node dependencies
npm install
# set up config/index.js by using the sample config/index.js.sample as reference

How to get involved

Hedera welcomes open source contributions to this respotitory, but please file an issue and discuss the improvements with one of the maintainers before beginning work.

We also suggest joining Hedera's Discord or Telegram chats, if you haven't already!

To learn more, visit Hedera Hashgraph's documentation at docs.hedera.com.

payment-server's People

Contributors

calvinchengx avatar enerestar avatar cooper-kunz avatar kotharthar avatar dependabot[bot] avatar

Watchers

James Cloos avatar

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.