@@ -20,29 +20,6 @@ class ViewController: UIViewController, FlutterwavePayProtocol {
2020 func tranasctionSuccessful( flwRef: String ? , responseData: FlutterwaveDataResponse ? ) {
2121 print ( " DATA Returned \( responseData? . flwRef ?? " Failed to return data " ) " )
2222
23- let vc = SuccessViewController ( )
24- let amount : String = String ( responseData? . chargedAmount ?? 0.0 )
25- let currency = responseData? . currency ?? " "
26- let fee : String = String ( responseData? . merchantFee ?? 0.0 )
27- vc. fee = fee
28- vc. amount = ( currency + " " + amount)
29- vc. reference = responseData? . flwRef ?? " "
30- vc. paymentType = responseData? . paymentType ?? " "
31-
32- let date = Date ( )
33- let format = DateFormatter ( )
34- format. dateFormat = " yyyy-MM-dd HH:mm:ss "
35- let formattedDate = format. string ( from: date)
36- print ( formattedDate)
37- vc. date = formattedDate
38-
39- if #available( iOS 13 . 0 , * ) {
40- vc. isModalInPresentation = true
41- } else {
42- // Fallback on earlier versions
43- }
44- self . present ( vc, animated: true )
45-
4623 }
4724
4825 func tranasctionFailed( flwRef: String ? , responseData: FlutterwaveDataResponse ? ) {
@@ -57,7 +34,7 @@ class ViewController: UIViewController, FlutterwavePayProtocol {
5734
5835
5936 @objc func showExample( ) {
60-
37+
6138 let config = FlutterwaveConfig . sharedConfig ( )
6239 config. paymentOptionsToExclude = [ ]
6340 config. currencyCode = " NGN " // This is the specified currency to charge in.
@@ -77,10 +54,10 @@ class ViewController: UIViewController, FlutterwavePayProtocol {
7754 controller. amount = " [AMOUNT] " // This is the amount to be charged.
7855 controller. delegate = self
7956 self . present ( nav, animated: true )
80-
57+
8158 }
8259
83-
60+
8461
8562 override func viewDidLoad( ) {
8663 super. viewDidLoad ( )
0 commit comments