4

We are developing a web app using HTML5, Angular JS, Jquery. We will then use PhoneGap wrapper to convert it to a native iPad app.

We are trying to integrate Square POS with our application for processing payments. However from the iPad app (web app wrapped using PhoneGap) we are not able to fetch the price of an order (shopping cart) and pass it on to Square. (We have integrated Square with a native mobile app and that works fine).

Any pointers how we can achieve this?

Is it possible to integrate square POS payments with a web based application (i.e. our application without the phonegap wrapper)?

Please Note: Backend is in PHP and database is mySQL.

Jeet Roy
  • 37
  • 3

1 Answers1

3

I've found some documentation that seems to be fruitful, haven't tested yet but it seems straight forward:

https://docs.connect.squareup.com/articles/point-of-sale-api-ios#initiating-a-payment

From this I get that your Cordova/Phonegap app is meant to be installed on the same device the Square POS app is installed on, you then have to redirect the user to Square's deeplink:

square-commerce-v1://payment/create?data=PARAMETERS

with some uri encoded data about the payment in the 'data' param of your query string, including an callback url for the Square POS to redirect to once Square has processed the request.

Once Square has processed the request it redirects to your callback url with a single 'data' parameter with url encoded data that describes the outcome of your payment request.

Note your hybrid app should (ideally) have registered a deeplink rather than an url to redirect back to.

MikeyBeLike
  • 813
  • 1
  • 9
  • 15
  • 1
    A better link would be [this one for web](https://docs.connect.squareup.com/articles/web-api-ios) – Ryan K May 17 '18 at 19:13