This is an implementation of the FreePay Merchant Terminal for Android 10+. It should work on any NFC enabled Android phone or POS device.
It allows you to accept crypto payments with a single tap from a customers phone. It automatically handles negotiating chain/tokens to reduce friction.
Currently the customer must have the FreePay Customer Android App installed for this to work.
Before building and deploying the app, you must configure your Alchemy API key and merchant wallet address:
-
Copy the example configuration file:
cp local.properties.example app/src/main/assets/local.properties
-
Edit
local.properties
and add your configuration:# Alchemy API Key - Get yours at https://www.alchemy.com/ alchemy.api.key=YOUR_ALCHEMY_API_KEY_HERE # Merchant Wallet Address - Where payments will be sent merchant.address=0xYOUR_MERCHANT_WALLET_ADDRESS_HERE
-
Important:
- Never commit
local.properties
to version control. It's already in.gitignore
. - The file in the project root is for reference only. The app reads from
app/src/main/assets/local.properties
.
- Never commit
- Sign up for free at https://www.alchemy.com/
- Create a new app and select the networks you want to support
- Copy your API key from the dashboard
- Load the app in Android Studio
- Sync Gradle files (this may be done automatically)
- Plug in your phone via USB Cable + Enable developer mode if not done already
- Hit the "Run App" button
androidpos/
├── app/
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/com/freepay/pos/
│ │ │ │ ├── MainActivity.kt
│ │ │ │ ├── nfc/
│ │ │ │ │ ├── NFCService.kt
│ │ │ │ │ └── NFCPaymentHandler.kt
│ │ │ │ ├── blockchain/
│ │ │ │ │ ├── BlockchainService.kt
│ │ │ │ │ └── TransactionMonitor.kt
│ │ │ │ └── utils/
│ │ │ ├── res/
│ │ │ └── AndroidManifest.xml
│ │ └── build.gradle.kts
│ └── build.gradle.kts
├── build.gradle.kts
└── settings.gradle.kts