Integration with iOnic apps

I am trying to integrate Square payment with my iOnic app. But it is not generating the toekns. Could you pleae help me on this? Are there any known issues regarding this?

Hi @ShirishSharma welcome to the forums!

Unfortunately, since we do not have a Ionic plugin, we do not have any examples of how to make this work (and I’m not personally familiar with Ionic). For mobile payments, we currently only have plugins for React Native and Flutter. Feel free to post more information here and we might be able to shed some light, but since we don’t formally support it, we may not have the answer.

Hi @sjosey,

Thank you for your reply. Please note iOnic framework (https://ionicframework.com/) is one of the popular mobile UI toolkit for building high quality, cross-platform native and web app experiences.

Could you please take a look and let me know how it can get supported. Please note other popular payment systems like Stripe, Authorize dot net are supporting this. I request you to please consider this feature request or help me with some alternate solution.

Thanks and Regards,
Shirish Sharma

I’ll mark this as a feature request so our PMs can see it, and we definitely appreciate the feedback. Unfortunately I can’t promise that it will happen, but it’s definitely on our radar.

1 Like

@ShirishSharma - any reason you can’t make the REST request to the Square API to generate your OAuth token? You should be able to use the Ionic framework to build your payment UI & use the REST APIs to do everything you need.

I agree an Ionic plugin from Square would make this easier in the future.

1 Like

Hi @dfurr, thanks for your reply. Let me check this solution.

Hi @sjosey, thank you for adding this as a feature request. Currently i am looking for some workaround. I really need to complete this functionality quickly with a work around.

Thanks and Regards,
Shirish Sharma

@dfurr Can i even generate " card_nonce " using direct API call? and Use that " card_nonce " to complete the transaction.

Also do you mean so that “There is no need to use PaymentForm” and i can use APIs for end to end.

Thanks and Regards,
Shirish Sharma

@ShirishSharma - if you’re wanting to use the card_nonce for recurring payments. Then you should check out the subscription api. https://developer.squareup.com/reference/square/subscriptions-api/create-subscription

@dfurr - this is not regarding the recurring. This is for the first time and single payment only. I do not see a way to create “nonce” using API. Do you know if there is a way to do it?

Thanks and Regards,
Shirish Sharma

Maybe you can share more of your use-case. A nonce is only a token representation of the card. You’d only need this if you’re going to process the card again like a recurring payment.

You can easily generate a “nonce” in JS:

const crypto = require('crypto');
let nonce = crypto.randomBytes(16).toString('base64');

Hope this helps,

@dfurr a nonce in Square’s land is actually a secure payment token that is generated via the Payment Form (it holds the card details). We don’t allow nonce creation via any other way; it would never work without the payment form at this time.

Hello @sjosey and @dfurr, how you guys are doing? Just checking in, if is there any progress or if you have any other solution to get it done on ionic app?

Hey @ShirishSharma,
I’m not sure your entire use-case, but any reason you can’t use createPayment API? It charges the card?

@dfurr Problem is how to get Nonce. The only way to get it using IFrame, which i am not able to call in iOnic framework. @sjosey any update from your side, or any other solution you can suggest.

I do not have any updates unfortunately; we currently do not have a wrapper for Ionic at this time.