This is an Android payment app sample that works with Web PaymentRequest API.
- SamplePay
- An Android payment app
- A web payment app (The implementation is empty; it can only delegate to the Android app)
- SampleMerchant
- A web merchant site
- Download and install app-debug.apk
- Open the Chrome browser and navigate to https://sample-pay-ss.firebaseapp.com
- Click on "PAY" button.
The project can be deployed to Firebase Hosting.
- Install Firebase CLI.
- Create a new Firebase project.
- Edit
SamplePay/.firebasercand change the project ID to yours. - Edit
SamplePay/public/manifest.jsonand change the domain nams to yours. Also, change the fingerprint SHA256 hash to your SamplePay's app. - Edit
SamplePay/public/payment-manifest.jsonand change the domain name to yours. - Edit
SamplePay/firebase.jsonand change the domain name to yours. - Run
$ firebase deploy.
- Import the project path (
SamplePay/) to Android Studio. - Modify these files and change the domain name to yours.
- SamplePay/app/src/main/AndroidManifest.xml
- SamplePay/app/src/main/res/values/arrays.xml
- SamplePay/app/src/main/java/com/example/android/samplepay/PaymentActivity.kt
- SamplePay/app/src/main/java/com/example/android/samplepay/SampleIsReadyToPayService.kt
- Run
The project can be deployed to Firebase Hosting.
- Install Firebase CLI.
- Create a new Firebase project.
- Edit
SampleMerchant/.firebasercand change the project ID to yours. - Edit
SampleMerchant/public/index.htmland change thesupportedMethodsto your SamplePay's domain. - Run
$ firebase deploy.