community
community copied to clipboard
How to use Apple Pay or Google Pay in kivy?
I suggests that Kivy should have APIs for using kinds of pay solutions, such as Apple Pay, Google Pay......
Kivy is not responsible for these kinds of api. Kivy only handles the user interface. If you want to implement Google Pay you can take a look at the documentation by Google on how to do this in Java. Then it can be translated into pyjnius code so that you can call these functions directly from python.
We can all agree that Pyjnius is outrageously non-trivial and fragile. It's also clearly non-portable, because iOS.
I'm actually in agreement with @zhangxiansheng here. Wrapping low-level platform-specific mobile APIs that ultimately intersect with UI and UX concerns should ideally be in Kivy's wheelhouse. After all, Kivy already offers a plethora of non-UI API solutions covering caching, configuration, scheduling, copy-pasting, spell-checking, and more.
Payment processing is yet another such API. This obviously won't happen anytime soon. Even publishing a new stable release of Kivy is a demonstrable hardship. Still, it'd be nice to keep this sort of thing on the back-burner feature wishlist.
I understand what you mean and It does make sense in a way. The problem is that the payment libraries are updated almost every month, sometimes with breaking changes. Moreover kivy's primary goal is to remain cross-platform and as far as I know this would be an android only feature(Not exactly sure if someone got apple pay working in kivy apps). Whereas if these api's where to exist as another library that was made to be used with kivy, it would make more sense. and could be easily updated and maintained. (As you stated)
There is a payment library built into the android
module that comes with p4a. But I think it is quite outdated and would not have the latest api's features built in to it.
P4a android module
I do agree that pyjnius is quite hard to learn at first, but I do not understand what you mean by fragile. Every time I have used pyjnius to access android API's it has never failed me.
Anyhow as there are no payment libraries(that I know of) that work with google pay for android yet. @zhangxiansheng might have to bite the bullet and learn how to code pyjnius.
If you want cross-platform features, the best and easiest way is the web. You can create a WordPress + WooCommerce (or programme it on your own) website in which you integrate Apple Pay and Google Pay. Shopify already does it for you automatically. Then you would only need to sync a database to when a customer purchases to add him, and now you can check if that user has what he claims to have acquired.
It's a good solution and can be even better than having self-integrated APIs in your app (people normally trust more websites with the green lock than apps, unless you use the Google Play/App Store's payment system, which actually is more expensive since the fees).
Hope it helps.
@Guhan-SenSam pyjnius is for using the Android module. Do you know something like pyjnius for using the iOS module?
Closing as inappropriate for Kivy\Kivy.