PaymentKit Pod issues

40 views
Skip to first unread message

Seth Siegler

unread,
Feb 25, 2015, 10:10:31 PM2/25/15
to rubym...@googlegroups.com
Does anyone have any tips on how to integrate PaymentKit into an RM app? 

I'm using ProMotion so I have Screens but any tips would be appreciated. 

My goal is to get Stripe up and I'm trying to feel my way through this tutorial (obj-c): https://stripe.com/docs/mobile/ios#paymentkit

My issue is mostly in this very first section:


// PaymentViewController.m

#import "PaymentViewController.h"
#import "PTKView.h"

@interface PaymentViewController ()<PTKViewDelegate>
@property(weak, nonatomic) PTKView *paymentView;
@end


I can't seem to figure out where I would put something like this in my app. (And how to format it for RM) 

I think I can probably figure out the rest of this (I think) but this first part is just a little confusing. 

Thanks in advance!

Colin T.A. Gray

unread,
Feb 25, 2015, 10:39:53 PM2/25/15
to rubym...@googlegroups.com
This is just a standard class declaration, but the “weak” part *is* important… except in this case they’re recommending a weak ref where I don’t think it’s necessary.  I don’t know of a formal name, but I call this the “timid reference”.

                     +----------> paymentView
PaymentViewController              ^
                     +---> view ---/

Since paymentView doesn’t have a reference to the controller (and if it did, it should be a weak reference *anyway*) there is no risk of a circular reference here.  So, in this case, ignore that “weak” part.  We’re left with this:

class PaymentViewController < UIViewController
  attr_accessor :paymentView
end

So far so good! :-D

Things to note:

- no need to declare that PaymentVC implements the protocol.  Implement the required methods and RubyMotion will take care of the rest.
- no need to import / require anything


Colin T.A. Gray
Community Manager
HipByte



--
You received this message because you are subscribed to the Google Groups "RubyMotion - Ruby for iOS, OS X, and Android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubymotion+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubymotion/5e55c085-9cc8-40ca-93bc-5c18e90839bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Seth Siegler

unread,
Feb 26, 2015, 11:59:45 AM2/26/15
to rubym...@googlegroups.com
Thanks Colin,

That definitely makes it look way easier! 

And it works like a charm. Loaded the library without issue. Now I'll try to wrap up the Stripe part tonight. 

Thanks for the help!

--Seth
Reply all
Reply to author
Forward
0 new messages