PaylevenFramework-iOS-CocoaPod

Reason

The reason for making this repo was that the Payleven InApp-SDK-iOS framework is not available to integrate it via CocoaPods. And the only option is to integrate it via vendored_frameworks as a dependency to other Podspec. But unfortunately this leads to another problem related to CocoaPods - and it mentioned in that issue. Now the framework can be integrated as a dependency in the Podspec

Original README

Prerequisites

You or your client is operating in one of the countries supported by payleven.

Code

Authenticate your app

Use the unique API key to authenticate your app

[[PLVInAppClient sharedInstance] registerWithAPIKey:@”anAPIKey”];

Add a payment instrument

Create an object of PLVCreditCardPaymentInstrument class.
If it's the first time you are trying to add a payment instrument for your user, you need to create a user token, based on the user's email address.

Get the payment instruments for a user token

Use the user token to retrieve the payment instruments associated to it and to a specific use case.
The list of payment instruments is sorted based on the order in which the payment instruments will be selected when making a payment.
Note: Before offering your business services, call getPaymentInstrumentsList to make sure that the user has at least one valid (not expired) payment instrument.

Set payment instruments order for a use case

To update the order in which the payment instruments will be used when making a payment, call setPaymentInstrumentsOrder with the ordered list of payment instruments, the user token and the use case to which they belong.
Check out PayInstTableViewController's tableView:moveRowAtIndexPath: in our sample app for a complete implementation.