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.
- nodejs download node
- AWS account, Access Key, Access Secret
- https://www.blockcypher.com API token
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
Use prepared PetkaPay WooCommerce plugin
or
- 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/createReplace 'xxxx' with your Gateway API path. Replace 'v1' with your stage.
-
Navigate to https://xxxx.execute-api.eu-central-1.amazonaws.com/v1/html/register.html
-
Enter your address and click create. Copy Merchant ID.
** Use testnet address for testing purpuse!! **
-
Update staticFiles/test.html. Set variable merchantId.
-
Redeploy service
serverless deploy --stage v1 --region eu-central-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.
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:'
Pull requests are welcome.