Skip to content

GoogleChromeLabs/android-web-payment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Test the Android payment App

  1. Build and run the Android app in the SamplePay folder using Android Studio (or other tools or IDEs using Gradle) or run the app-debug.apk file included in the repo.
  2. Open the Chrome browser and navigate to https://sample-pay-ss.web.app
  3. Click on "PAY" button.

SampleMerchant

The project can be deployed to Firebase Hosting.

  1. Install Firebase CLI.
  2. Create a new Firebase project.
  3. Edit SampleMerchant/.firebaserc and change the project ID to yours.
  4. Edit SampleMerchant/public/index.html and change the supportedMethods to your SamplePay's domain.
  5. Run $ firebase deploy.

SamplePay (Android)

  1. Import the project path (SamplePay/) to Android Studio.
  2. Modify SamplePay/gradle.properties and change the domain name to yours.
  3. Run

Note: This app generates invalid responses to show how the Payment Request API responds to incomplete payloads (e.g.: an empty shipping address). Make sure that your payment objects are well formed.

Screencast of a complete payment flow using the applications in this repository

SamplePay (Web)

The project can be deployed to Firebase Hosting.

  1. Install Firebase CLI.
  2. Create a new Firebase project.
  3. Edit SamplePay/.firebaserc and change the project ID to yours.
  4. Edit SamplePay/public/manifest.json and change the domain nams to yours. Also, change the fingerprint SHA256 hash to your SamplePay's app.
  5. Edit SamplePay/public/payment-manifest.json and change the domain name to yours.
  6. Edit SamplePay/firebase.json and change the domain name to yours.
  7. Run $ firebase deploy.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7