O'Reilly logo

iOS eCommerce App Development with Parse by Liangjun Jiang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter    12

Pay with Credit Card

In the previous chapter, I talked about capturing a user’s shipping address before checking out. In this chapter, I cover how a user can pay with a credit card. For this app, you will use the Stripe iOS SDK to make the process easier. To incorporate the Stripe iOS SDK, you need to update your Cocoapods Podfile by adding these two lines:

pod 'Stripe'pod 'Stripe/ApplePay'

Then run “Pod update.

Payment Model

You need a new PFObject model for a user’s credit card. Instead of naming it EMABCreditCard, name it EMABPaymentMethod because you might incorporate other payment methods such as PayPal in the future. Remember to register an NSString constant on the EMABConstants class and to register the model in the AppDelegate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required