Note : I am aware it is not yet available for iOS, Also i am not looking for Xamarin.Forms(Obviously).
Been trying to integrate Google Pay(Tez) API into my Xamarin Application when I realised that there are no guides available for its integration to Xamarin which is fine.
So, I visited the Google Pay API page, Which seems to have a sweet looking guide for Android(Java) so I started converting the native Android code into Xamarin. And then I hit a bump where the PaymentsClient class seems to be unavailable in Xamarin, So I tried checking for its namespace so maybe I could understand if it was available or not(Xamarin.Android). But there is no mention of the namespace of this class(None that I noticed). All I could find in its info is that it inherits from com.google.android.gms.common.api.GoogleApi which did not help at all actually.
Queries
- Am I missing some package here or is there some alternative that is used in
Xamarin? - Is There some guide to integrating Google pay(Tez) API for
Xamarinapps that I have missed? - Is Google pay(Tez) integration not added in Xamarin.Android yet?
- Or is there something wrong with my current config? i.e
VS17 Proversion15.6.7,Xamarinversion4.9.0.753andXamarin.Androidversion8.2.0.16Android SDK latest with all the API versions above v 4.0
Google Pay (not Tez):
Make sure that you enable your app for Wallet processing via the
metadatain the manifest, or via your application'sMetaDataAttribute:From there it is a matter of
using Android.Gms.Wallet;and setting up and using thePaymentsClient, ie.Google Pay for India (UPI Intent-based):
To pass the transaction information to "Tez", you define an URI that includes all of your merchant information, transaction amount, etc... This URI is based upon the UNIFIED PAYMENTS INTERFACE
UPIscheme (this is not controlled by Google and thus you have refer to UPI specs for what data you need to pass).re: https://www.npci.org.in/sites/all/themes/npcl/images/PDF/UPI_Linking_Specs_ver_1.5.1.pdf
Then of course you would implement an override for
OnActivityResultand process the result: