# Ok Google, Charge $2 for Coffee

DevFeed: [Ok Google, Charge $2 for Coffee](<https://devfeed.tech/articles/ok-google-charge-2-for-coffee-15785.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/ok-google-charge-2-for-coffee>)

Author: P-Y Ricau

Published: 2017-03-10T21:54:16Z

Content type: tutorial

Language: en

Sources: [Square Corner](<https://devfeed.tech/sources/square-corner-blog-medium.md>)

Topics: [Firebase](<https://devfeed.tech/topics/firebase.md>), [Google Cloud Platform (GCP)](<https://devfeed.tech/topics/google-cloud.md>), [Google](<https://devfeed.tech/topics/google.md>), [cURL](<https://devfeed.tech/topics/curl.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [apis](<https://devfeed.tech/tags/apis.md>), [apple-pay](<https://devfeed.tech/tags/apple-pay.md>), [bluetooth](<https://devfeed.tech/tags/bluetooth.md>), [cloud-messaging](<https://devfeed.tech/tags/cloud-messaging.md>), [coffee](<https://devfeed.tech/tags/coffee.md>), [curl](<https://devfeed.tech/tags/curl.md>), [google](<https://devfeed.tech/tags/google.md>), [google-assistant](<https://devfeed.tech/tags/google-assistant.md>), [google-home](<https://devfeed.tech/tags/google-home.md>), [http](<https://devfeed.tech/tags/http.md>), [java](<https://devfeed.tech/tags/java.md>), [json](<https://devfeed.tech/tags/json.md>)

## AI overview

The prototype lets a merchant say "Charge {amount} dollars for {note}" to trigger a Square contactless payment. An Android app calls Square's Point-of-Sale API to bring its POS app forward and activate a Bluetooth-connected Contactless Reader; the POS API does not connect directly to the reader. Firebase Cloud Messaging sends the amount and note to the Android app, while an IFTTT Google Assistant trigger and Web Request action initiate the request. Since IFTTT cannot send the authorization header required by Firebase, an App Engine servlet proxies the request to FCM. The excerpt reports that the flow processed a real Apple Pay transaction and that receipt printing worked; it describes a prototype built with public APIs.

## Source excerpt

When I received my Google Home, I immediately felt the urge to build something with it. After a good night's sleep, I had an idea: Baristas...