Using CocoaPods
Edit your Podfile
and specify the dependency:
pod 'MLCardForm'
- Easy to integrate
- PCI compliance (We do not save anything)
import MLCardForm
2 - Create an instance of MLCardFormBuilder with your PublicKey
or PrivateKey
, your siteId
and your flowId
let builder = MLCardFormBuilder(publicKey: yourPublicKey, siteId: yourSiteId, flowId: yourFlowId, lifeCycleDelegate: self)
extension YourViewController: MLCardFormLifeCycleDelegate {
func didAddCard(cardID: String) {
// The card has been added. You can pop the `MLCardFormViewController` here.
}
func didFailAddCard() {
// There was an error adding the card.
}
}
let cardFormVC = MLCardForm(builder: builder).setupController()
navigationController?.pushViewController(cardFormVC, animated: true)
We provide MLCardFormTrackerDelegate
protocol to notify each tracking event. You can subscribe to this protocol using MLCardFormConfiguratorManager
@objc public protocol MLCardFormTrackerDelegate: NSObjectProtocol {
func trackScreen(screenName: String, extraParams: [String: Any]?)
func trackEvent(screenName: String?, extraParams: [String: Any]?)
}
- Bitrise integration
- UI XCtest
- SwiftLint
This project include an example project using MLCardForm
.
Enter to path: card-form-ios/Example
and run pod install command. After that, you can open Example_CardForm.xcworkspace
- iOS 10.0+
- Swift 5
- xCode 10+
- @Objc full compatibility
This is an open source project, so feel free to contribute. How? -> Fork this project and propose your own fixes, suggestions and open a pull request with the changes.
- Esteban Boffa
- Eric Ertl
- Juan Sanzone
Copyright 2019 Mercadolibre Developers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.