Code Monkey home page Code Monkey logo

petkapay-api's Introduction

PetkaPay API

License: MIT

PetkaPay API is a free and open-source crypto payment processor. Start accepting and processing Bitcoin payments with 0 fees.

Deploy on your own Amazon AWS account or use a free hosted service provided by petkapay.com The software is built in Javascript and uses AWS Lambda, Gateway API and DynamoDb. AWS offers generous free tier.

Released under the terms of the MIT licence.

Requirements

Instalation

Duplicate 'secrets.v1.template.yml' and rename to secrets.v1.yml. Update file with your secrets.

Run

npm install -g serverless  
serverless config credentials --provider aws --key YOUR_KEY --secret YOUR_SECRET  
serverless deploy --stage v1 --region eu-central-1  

Usage, Integration

Use prepared PetkaPay WooCommerce plugin

or

  1. Get the all endpoints as an output to 'serverless deploy' command.

Endpoints:
GET - https://xxxx.execute-api.eu-central-1.amazonaws.com/v1/html/paymentFrame.html
GET - https://xxxx.execute-api.eu-central-1.amazonaws.com/v1/html/test.html
GET - https://xxxx.execute-api.eu-central-1.amazonaws.com/v1/html/register.html
POST - https://xxxx.execute-api.eu-central-1.amazonaws.com/v1/payment/start
GET - https://xxxx.execute-api.eu-central-1.amazonaws.com/v1/payment/getDetails
GET - https://xxxx.execute-api.eu-central-1.amazonaws.com/v1/payment/getStatus
POST - https://xxxx.execute-api.eu-central-1.amazonaws.com/v1/paymentProcess/processOpen
POST - https://xxxx.execute-api.eu-central-1.amazonaws.com/v1/merchant/create

Replace 'xxxx' with your Gateway API path. Replace 'v1' with your stage.

  1. Navigate to https://xxxx.execute-api.eu-central-1.amazonaws.com/v1/html/register.html

  2. Enter your address and click create. Copy Merchant ID.

** Use testnet address for testing purpuse!! **

https://en.bitcoin.it/wiki/List_of_address_prefixes

  1. Update staticFiles/test.html. Set variable merchantId.

  2. Redeploy service

    serverless deploy --stage v1 --region eu-central-1 
  1. Navigate to https://xxxx.execute-api.eu-central-1.amazonaws.com/v1/html/test.html
    Click 'Pay 20 EUR' and follow on screen instructions.

Custom domain

https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html

  • Log into your AWS account.
  • Go to API Gateway panel.
  • Click on 'Custom domain names'
  • Click 'Create'
  • Fill in details
  • Configure 'API mappings'
  • Select API, select Stage, enter stage as Path
  • Create CNAME record in your DNS for 'API Gateway domain name:'

Contributing

Pull requests are welcome.

License

License: MIT

petkapay-api's People

Contributors

baso10 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.