Search code examples
iosswift2alamofire

How to use Alamofire for paypal payment [iOS]


I want to add payment via PayPal in my iPhone app. When the customer orders for sticker labels by paying via PayPal, the Order will be received and Company will then send the Sticker to the Customer.

I just installed Alamofire pod in my app.

  • Is it possible to use Alamofire for PayPal payment?
  • Which HTTP request is necessary for PayPal payment?
  • Or which framework is best for PayPal payment in iOS?
  • Is it best practice to use Alamofire?

Hope some experts have a good option!


Solution

    1. Is it possible to use Alamofire for PayPal payment?

    A: Yes, it is possible.

    1. Which HTTP request is necessary for PayPal payment?

    A: As a reference Alamofire HTTP requests fails and https://github.com/contentful-labs/Wunderschnell/blob/master/Phone%20App/PayPalClient.swift both show the Alamofire.request(.Post) methods using Alamofire.

    1. Or which framework is best for PayPal payment in iOS?

    A: Paypal's SDK is likely considered best practice: https://github.com/paypal/PayPal-iOS-SDK

    1. Is it best practice to use Alamofire?

    A: See answer to Question 3 (both work, just make sure you feel comfortable from a security perspective making your own post request via Alamofire)