r/kivy • u/surfboardThrowAway06 • Jun 30 '18
Stripe Payment Processing has now been coded up for android AND IOS
I've finally got stipe working on ios!! Kivy mobile apps can now handle payment processing for selling services (maybe in app purchases too, not 100% sure on that situation).
For android you can use this https://github.com/GoBig87/KivyStripeWrapper, its a little rough at the moment I plan to polish it up in the coming month and make it work with callbacks and pop up waiting notifications. In order for it to work you will need to add stripe to your gradle templates and have an sdk high enough that supports gradle building.
For ios I have made a recipe here https://github.com/GoBig87/stripe_ios that cross compiles a cython wrapper that wraps C, which wraps obj-c (source files here https://github.com/GoBig87/Stripe_iOS_Wrapper) that then talks to the stripe framework (added by following these steps https://stripe.com/docs/mobile/ios (under static)) and creates the tokens to send to your server for payment processing.
I'm going to try and make a garden package with this all built into a simple widget that will have UI inputs for credit card inputs and inputs in the object for your developer token But for right now here are the guts that you can play with that could get you up and running if you need payment processing.
I've went down some deep rabbit holes but I came out with a greater understanding of Java, obj-c, cython, c, cross compiling, ect the list goes on and on. I'd like to compare trying to wrap native mobile os languages with kivy like trying to tackling the rubicon trail in a ford fiesta. Sure a jeep would be better suited for the task but when you get to finish and look back you really feel like you accomplished something!
Update: You'll need to put the static stripe framework in your kivy-ios/dist/frameworks folder when build the recipe (note you will most likely need to make this folder yourself.)
1
u/Fathomx1 Jul 12 '18
I'm a bit confused as to why you are using a bunch of global variables in the stripe python example.
1
u/surfboardThrowAway06 Jul 12 '18
For the android section? It's because I need to get around to adding callbacks to it. I just kinda rushed it through and haven't had a chance to fix it yet. My stripe ios uses callbacks and updates a pop up with 'authenticating' or 'failed to authenticate'. I plan to do the same with android and make a pull request for the recipe. It works at the moment but its a little rough looking. The overall structure of pyjnius is there to get your data out. It just needs callbacks implemented properly.
2
u/Fin_Aquatic_Rentals Nov 16 '18
Hey this is the original OP surfboardthrowaway06. My other account got suspended and I was unable to access the email address it was tied to so there's no way to get the old account back. So questions about my kivy work on the surfboardthrowaway06 account can be sent to this one.
1
Jul 01 '18
Wow! Very cool, good job and thanks for sharing! :) It always looked like a deep rabbit hole; I've avoided going down.. haha :)
Please post this on kivy-users mailing list, I'm sure lots of people would love it!
1
3
u/Augusto2012 Jul 09 '18
You're an awesome human being.