I'm trying to use the Square POS API to enable mobile payments in a web app. I'm able to trigger the Square POS app, charge a card/take cash, and receive the callback from Square.
My problem is the flow after that - here are the questions I have
Here's the iOS callback response which includes a transaction Id. The docs say to use the Receive Transaction API to get information about the transaction. That API is deprecated :(. What is the new API to use? Neither the Payments API or the Orders API works. (BTW what's the diff between payments and transactions?)
There's no information about the fields returned in the Android callback except "the Android Point of Sale app will return to your callback URL with the same parameters set in your URL." I need a transaction Id though.
Thanks!
Currently, you still need to use Transactions API along with POS API. Even though it's deprecated, it's still guaranteed to work until September 1st, 2021. At a high level, transactions and payments are very similar. They both represent a monetary amount with the possibility of other linked objects (such as orders). The Payments API is a newer API that was built with more things in mind and what will be used for the future APIs.
The transaction id for Android should be com.squareup.pos.SERVER_TRANSACTION_ID
as a url parameter. See https://developer.squareup.com/docs/pos-api/build-mobile-web#step-4a-initialize-your-transaction-variables for more info. You're correct, though, it should be listed in the page you linked. I'll be sure to bring that up with our doc team, thanks for reporting.