Updated 30 April 2021
Hello guys, Today we will learn about the Conekta Payment Gateway Integration
In this blog, we are learning about How to integrate Conekta Payment Gateway Integration in the App
A Conekta Payment SDK provides a secure payment for iOS, Flutter, Android applications.
Step1:- download Conekta SDK through this link.
1 2 |
$(inherited) $(PROJECT_DIR)/Conekta |
Step 2:- You need to add the following code into your Header Bridging file
1 |
#import "Conekta.h" |
Step 3:- After this, we need to create a ConektaPaymenViewController storyboard to integrate the Conekta payment method
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
import UIKit import Firebase class ConektaPaymentViewController: UIViewController { @IBOutlet weak var proceedBtnOutlet: UIButton! @IBOutlet weak var cvvlbl: UILabel! @IBOutlet weak var expLbl: UILabel! @IBOutlet weak var cardOwnerLabel: UILabel! @IBOutlet weak var carkNumberLabel: UILabel! @IBOutlet weak var numberCardUI: UITextField! @IBOutlet weak var nameCardUI: UITextField! @IBOutlet weak var expMonthUI: UITextField! @IBOutlet weak var expYearUI: UITextField! @IBOutlet weak var cvcUI: UITextField! @IBOutlet weak var outTokenUI: UILabel! @IBOutlet weak var outUUID_UI: UILabel! var tokenId = "" var publicKey = "" override func viewDidLoad() { super.viewDidLoad() expMonthUI.placeholder = "MM" expYearUI.placeholder = "YYYY" numberCardUI.placeholder = "XXXX XXXX XXXX XXXX" nameCardUI.placeholder = "Name" cvcUI.placeholder = "CVC" } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } @IBAction func SubmitBtnClick(_ sender: UIButton) { let conekta = Conekta() conekta.delegate = self conekta.publicKey = "Enter your pubilc key " conekta.collectDevice() let card = conekta.card() card?.setNumber(numberCardUI.text, name: nameCardUI.text, cvc: cvcUI.text , expMonth: expMonthUI.text, expYear: expYearUI.text) let token = conekta.token() token?.card = card token?.create(success: { (data) -> Void in if let data = data as NSDictionary? as! [String:Any]? { self.tokenId = data["id"] as? String ?? "" //self.outUUID_UI.text = conekta.deviceFingerprint() print(data) // Success block }, andError: { (error) -> Void in print(error) }) } } |
we have successfully integrated the Conekta payment method into the app
Thanks for reading!
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.