Search Unity

Any free way to make an IAP with paypal?

Discussion in 'Scripting' started by peq42, May 1, 2022.

  1. peq42

    peq42

    Joined:
    Mar 4, 2022
    Posts:
    74
    Is there any free asset, script, tutorial or otherwise to help making an IAP system using paypal?

    I've been searching for a way to add paypal IAP on my project, but all assets are paid(and I can't spend money right now) and unity's IAP solution depends on platform specific stores, which usually also require payment. Tutorials for paypal C# integration are mostly only compatible with .net(and don't work on unity).
     
  2. Dextozz

    Dextozz

    Joined:
    Apr 8, 2018
    Posts:
    493
    You'll probably have to do some heavy server-side work to make this possible. You'll have to add this to your own backend, and then do the communication through it. Try looking at PayPal APIs here

    Keep in mind that you probably aren't allowed to do this on apps delivered through Google Play Store or Apple's App Store until this whole Epic vs. Apple thing is resolved properly.
     
  3. peq42

    peq42

    Joined:
    Mar 4, 2022
    Posts:
    74
    That looks interesting, but I'm still new to C#. Is there any tutorials or good documentations on how to work with paypal's restful API?
     
  4. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,925
    Probably not as it's a good way to get your app taken down.
     
  5. peq42

    peq42

    Joined:
    Mar 4, 2022
    Posts:
    74
    I want it to run on PC/browser...?
     
  6. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,925
    Apologies, for some reason the above posts made me think this was for a mobile app for some reason. Ignore me.
     
  7. peq42

    peq42

    Joined:
    Mar 4, 2022
    Posts:
    74
    I plan on using unity ADS for getting items on android, and paypal on PC/browser. But because I have no money, I need a free way to make an IAP that works on linux, windows and on a browser
     
  8. Dextozz

    Dextozz

    Joined:
    Apr 8, 2018
    Posts:
    493
    If you're still new to C#, I'd avoid getting into this at all. It's quite complex, to be honest. If you still decide to get into this, you'll probably want to find a way to create a REST Webservice and host it somewhere (probably AWS). You're looking at weeks/months of work if it's your first time dealing with this (I know it took me that long the first time).

    Here's one of the first things that show up when googling for REST Webservice with C#:


    Here's some of the steps I'd take:
    - Get into Unity's Web Request class. Try making a call to ipfy.org and try to get a value from it
    - Get into the tutorial above and try to make the simplest GET request from your own server (mind you, hosting this somewhere usually requires payment, but I guess you could find some free alternatives if you look hard enough)
    - Then get into PayPal and their APIs, if you make it this far.
     
  9. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
  10. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, Google requires a $25 developer fee, but you need to pay that anyway to publish to their platform. There are no additional fees for Unity IAP (which does not support PayPal). The fee for a developer license on Apple is $100/year. I'm not sure Apple would allow PayPal for IAP. Developing your own IAP system, even with PayPal, would likely take hundreds of hours to develop. You need to handle refunds, subscriptions and a host of others.
     
  11. Deleted User

    Deleted User

    Guest

    This might be useful.

    https://docs.unity3d.com/Packages/com.unity.purchasing@4.1/manual/WhatCustomStore.html

    "A custom store is a store that the In-App Purchasing package doesn't support out of the out of the box. It allows developers to create their own stores and build on top of the existing infrastructure of the package."


    Code (CSharp):
    1. using UnityEngine.Purchasing.Extension;
    2.  
    3. public class MyStore : IStore
    4. {
    5.     private IStoreCallback callback;
    6.     public void Initialize (IStoreCallback callback)
    7.     {
    8.         this.callback = callback;
    9.     }
    10.  
    11.     public void RetrieveProducts (System.Collections.ObjectModel.ReadOnlyCollection<UnityEngine.Purchasing.ProductDefinition> products)
    12.     {
    13.         // Fetch product information and invoke callback.OnProductsRetrieved();
    14.     }
    15.  
    16.     public void Purchase (UnityEngine.Purchasing.ProductDefinition product, string developerPayload)
    17.     {
    18.         // Start the purchase flow and call either callback.OnPurchaseSucceeded() or callback.OnPurchaseFailed()
    19.     }
    20.  
    21.     public void FinishTransaction (UnityEngine.Purchasing.ProductDefinition product, string transactionId)
    22.     {
    23.         // Perform transaction related housekeeping
    24.     }
    25. }
    https://developer.paypal.com/docs/api/payments/v2/

    "Call the Payments API to authorize payments, capture authorized payments, refund payments that have already been captured, and show payment information."
     
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    DungDajHjep likes this.
  13. peq42

    peq42

    Joined:
    Mar 4, 2022
    Posts:
    74
    thats... exactly what I said I didn't want...
    I'll take a look into that
     
  14. LoopIssuer

    LoopIssuer

    Joined:
    Jan 27, 2020
    Posts:
    109
    Hi,
    @JeffDUnity3D I have question about integration with PayPal, Stripe and similar.
    There is info on Simple IAP site (https://flobuk.gitlab.io/assets/docs/sis/stores/paypal-native), that Google Play or iTunes, would not allow apps with PayPal integration.
    But when I installed Badoo (from Google Play store), and start purchasing a subscription, I see the PayPal option.
    Please explain to me, apparently, I don't understand it correctly - is somehow Badoo privileged?
     
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I'm not familiar with Badoo. We have no plans at this time to support PayPal
     
  16. LoopIssuer

    LoopIssuer

    Joined:
    Jan 27, 2020
    Posts:
    109
    Question is - is there a way to implement PayPal in Android/iOS application and have this application submitted to Google/Apple store?
     

    Attached Files: