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.”
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 ...