Confused about adding Google Pay and Apple Pay as well as gateway to an Xamarin Cross Platform app

Hi wondered if you can help me, I have been working on a project for the last 2 and a half years just for fun thanks to all the information freely distributed on the internet I have achieved what I believe is called a Platform app for both Android and Apple that will serve multiple business and there customers within the umbrella of my Xamarin cross platform app. Now that I believe im getting to the end of that app I felt that adding a payment Gateway would be my next step but to my amazement no one is talking about it, no videos or websites with lots of people asking the question for a solution and solutions that have been given are currently deprecated or not working

So my current solution to the problem is either using Judo’s GitHub cross platform demo that is currently deprecated on the part that uses Android pay instead of Google Pay and then hopefully able to swap out the Payment Gateway of my choice later in order to move me in the right direction but looks a lot of work with a few unknowns or just building a Stripe Elements web site page and have my app speak to my web server before passing the transaction over to stripe but even through this appears to be my only solution I keep wondering why stripe or the Xamarin team have not offered a solution like Judo pay and wonder if that’s because it is assumed that the web site is the solution or is it that im just blind and not asking the right questions.

I suppose in the perfect world I would have found a site that takes the Google pay and Apple pay solution and stick them in a converted c# class sitting in there corresponding Xamarin cross platform renderer and then pulled each depending on device used and then the same for the Gateway in order to pass on the token and cost but all I am seeing is the code for Android studio in Java and Kotlin as well as Swift or objective C for Apple.

If no one has the solution I suppose I will brave the web site as this looks to have all the answers to the questions in my head I just worry as this might imply that sending the personal users data to my server first if any may cause me more issues than if I was just sending from phone to Stripe server.

Best Answers

  • Jason1975Jason1975 ✭✭
    Accepted Answer

    Well after talking to 2nd line for Stripe.com an engineer did confirm that Elements was the best solution so i suppose this is the way forwards then until Stripe or Xamarin or Google do some thing :(

    "At this time, we don't have any library for Xamarin on mobile. As we're always growing, this might be added in the near future but for now the best option is to use a web-view (like showing your website) and use the web integration with Elements. "

  • Jason1975Jason1975 ✭✭
    Accepted Answer

    OMG so i have been none stop reading on this subject for about 10 days now and i believe i have found the answer even through I dont like it. So I could not work out why Xamarin not only has not tried to answer my question or why it is that there is no spoon fed data on the internet for me to add the Google Pay to my Xamarin project and my only answer is that of Microsoft Firebase will do it all for you for a fee with Firebase payment :( Google wont re write it for you because they want you using android and stripe wont write it coz they believe you can just use there web version.

    So my options as i like to do everything for free:
    1) Try to convert the code my self, to be honest it doesn't look that hard
    2) Create the web page version and hope Android lets my app on the store :(
    3) make my cross platform app a test version and go back to the android and Apple native version :(

  • Jason1975Jason1975 ✭✭
    Accepted Answer

    So someone answered my plea and gave me the following, haven't tested it yet

    https://agileapp.co/Stripe-and-Android-GooglePay-with-Xamarin-Forms

Answers

  • Jason1975Jason1975 Member ✭✭
    Accepted Answer

    Well after talking to 2nd line for Stripe.com an engineer did confirm that Elements was the best solution so i suppose this is the way forwards then until Stripe or Xamarin or Google do some thing :(

    "At this time, we don't have any library for Xamarin on mobile. As we're always growing, this might be added in the near future but for now the best option is to use a web-view (like showing your website) and use the web integration with Elements. "

  • Jason1975Jason1975 Member ✭✭

    After talking to second line Google I didn't like there response so will go with Stripes response instead, in a perfect world i would sit there and do what Google has asked but im to much of a code copy'er rather than a code creator :(

    "You would have to work out a conversion of the code by your self. We have versions only for Tink library."

  • Jason1975Jason1975 Member ✭✭
    Accepted Answer

    OMG so i have been none stop reading on this subject for about 10 days now and i believe i have found the answer even through I dont like it. So I could not work out why Xamarin not only has not tried to answer my question or why it is that there is no spoon fed data on the internet for me to add the Google Pay to my Xamarin project and my only answer is that of Microsoft Firebase will do it all for you for a fee with Firebase payment :( Google wont re write it for you because they want you using android and stripe wont write it coz they believe you can just use there web version.

    So my options as i like to do everything for free:
    1) Try to convert the code my self, to be honest it doesn't look that hard
    2) Create the web page version and hope Android lets my app on the store :(
    3) make my cross platform app a test version and go back to the android and Apple native version :(

  • Jason1975Jason1975 Member ✭✭

    Ok so i sat down and created my self a php page that is called from my app, all working thanks

    https://stripe.com/docs/web

    Hopefully someone will bring out a helpful cross platform google pay and apple pay renderer or something one day

  • Jason1975Jason1975 Member ✭✭
    Accepted Answer

    So someone answered my plea and gave me the following, haven't tested it yet

    https://agileapp.co/Stripe-and-Android-GooglePay-with-Xamarin-Forms

  • Jason1975Jason1975 Member ✭✭
    edited October 5

    Wow got me very own email from James Montemagno i feel blessed :) unfortunately he confirms that there is no official cross-platform version out there and i will have to do it myself so will stick with the Payment gateway website for now

    Hey there Jason,

    Our component team actively maintains tons of libraries from Google, Facebook, and more on GitHub: https://github.com/xamarin/XamarinComponents. The best place to look for anything in Google Play itself would be here: https://github.com/xamarin/GooglePlayServicesComponents this is where the bindings and samples live. Here is a sample of using the Wallet NuGet package on Android: https://github.com/xamarin/GooglePlayServicesComponents/tree/af4d43bc6812315b2569d511da007cde0c2fb83c/samples/com.google.android.gms/play-services-wallet

    We don't document every single API as they are documented by Google and Apple for packages like these and walk through using them and the APIs are nearly identical, however we do usually provide samples like I pointed out.

    For Apple pay we also have a full document on how to use it as it ships with iOS itself: https://docs.microsoft.com/en-us/xamarin/ios/platform/apple-pay

    There is no official cross-platform API for this and you would just create an interface and call into the native APIs.

    Hope this helps.

    Best,

    James Montemagno

    Principal Program Manager, Mobile Developer Tools

Sign In or Register to comment.