https://github.com/brightec/3dsecureview
https://github.com/brightec/3dsecureview
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/brightec/3dsecureview
- Owner: brightec
- License: apache-2.0
- Created: 2018-04-12T09:11:29.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-16T13:49:07.000Z (about 7 years ago)
- Last Synced: 2025-10-23T13:04:05.961Z (8 months ago)
- Language: Swift
- Size: 9.77 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ThreeDSecureView
ThreeDSecureView is primarily a WKWebView that handles the 3DSecure payment process by sending a POST request to the provided card issuer URL with the MD and PaReq parameters set. The WKWebView then intercepts the POST response from the card issuer, extracts the MD and PaRes values and passes them back to your app.
## Requirements
- iOS 9.0+
- Swift 4.0
## Installation
### CocoaPods
pod 'ThreeDSecureView', '~> 1.0.0'
## Usage
### Easy
The easiest way to use ThreeDSecureView is to instantiate ThreeDSecureViewController and present it in a UINavigationController.
let config = ThreeDSecureConfig(md: "YOUR MD", paReq: "YOUR PAREQ", cardUrl: "YOUR CARD URL")
let viewController = ThreeDSecureViewController(config: config)
viewController.delegate = self // Implement ThreeDSecureViewDelegate
let navController = UINavigationController(rootViewController: viewController)
present(navController, animated: true, completion: nil)
Handle the callbacks:
extension YourViewController: ThreeDSecureViewDelegate {
func threeDSecure(view: ThreeDSecureView, md: String, paRes: String) {
// Handle success here
}
func threeDSecure(view: ThreeDSecureView, error: Error) {
// Handle errors here
}
}
### Advanced
If you don't want to use the provided UIViewController, you can just instantiate ThreeDSecureView directly, add it to your view hierarchy and call start3DSecure() yourself.
## License
See [license](LICENSE)
## Author
This repo is maintained by the [Brightec](https://www.brightec.co.uk/) team