@@ -20,29 +20,6 @@ class ViewController: UIViewController, FlutterwavePayProtocol {
20
20
func tranasctionSuccessful( flwRef: String ? , responseData: FlutterwaveDataResponse ? ) {
21
21
print ( " DATA Returned \( responseData? . flwRef ?? " Failed to return data " ) " )
22
22
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
-
46
23
}
47
24
48
25
func tranasctionFailed( flwRef: String ? , responseData: FlutterwaveDataResponse ? ) {
@@ -57,7 +34,7 @@ class ViewController: UIViewController, FlutterwavePayProtocol {
57
34
58
35
59
36
@objc func showExample( ) {
60
-
37
+
61
38
let config = FlutterwaveConfig . sharedConfig ( )
62
39
config. paymentOptionsToExclude = [ ]
63
40
config. currencyCode = " NGN " // This is the specified currency to charge in.
@@ -77,10 +54,10 @@ class ViewController: UIViewController, FlutterwavePayProtocol {
77
54
controller. amount = " [AMOUNT] " // This is the amount to be charged.
78
55
controller. delegate = self
79
56
self . present ( nav, animated: true )
80
-
57
+
81
58
}
82
59
83
-
60
+
84
61
85
62
override func viewDidLoad( ) {
86
63
super. viewDidLoad ( )
0 commit comments