Skip to content

Commit 30241a7

Browse files
committed
Dark theme changes
1 parent 780b10a commit 30241a7

30 files changed

+137
-38
lines changed

Diff for: Example/FlutterwaveSDK.xcodeproj/project.pbxproj

+8-6
Original file line numberDiff line numberDiff line change
@@ -525,17 +525,18 @@
525525
baseConfigurationReference = 837CB02BB9EE2BE7C7D9A9B9 /* Pods-FlutterwaveSDK_Example.debug.xcconfig */;
526526
buildSettings = {
527527
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
528+
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
528529
CODE_SIGN_ENTITLEMENTS = FlutterwaveSDK_Example.entitlements;
529-
CURRENT_PROJECT_VERSION = 3;
530+
CURRENT_PROJECT_VERSION = 2;
530531
DEVELOPMENT_TEAM = YL4C3AS383;
531532
INFOPLIST_FILE = FlutterwaveSDK/Info.plist;
532533
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
533534
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
534-
MARKETING_VERSION = 1.3.2;
535+
MARKETING_VERSION = 1.3.3;
535536
MODULE_NAME = ExampleApp;
536537
PRODUCT_BUNDLE_IDENTIFIER = com.demo.paypal.flutterwave;
537538
PRODUCT_NAME = "$(TARGET_NAME)";
538-
SUPPORTS_MACCATALYST = YES;
539+
SUPPORTS_MACCATALYST = NO;
539540
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
540541
SWIFT_VERSION = 5.0;
541542
TARGETED_DEVICE_FAMILY = "1,2";
@@ -547,17 +548,18 @@
547548
baseConfigurationReference = 1B4629C68741D557BE1C6D39 /* Pods-FlutterwaveSDK_Example.release.xcconfig */;
548549
buildSettings = {
549550
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
551+
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
550552
CODE_SIGN_ENTITLEMENTS = FlutterwaveSDK_Example.entitlements;
551-
CURRENT_PROJECT_VERSION = 3;
553+
CURRENT_PROJECT_VERSION = 2;
552554
DEVELOPMENT_TEAM = YL4C3AS383;
553555
INFOPLIST_FILE = FlutterwaveSDK/Info.plist;
554556
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
555557
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
556-
MARKETING_VERSION = 1.3.2;
558+
MARKETING_VERSION = 1.3.3;
557559
MODULE_NAME = ExampleApp;
558560
PRODUCT_BUNDLE_IDENTIFIER = com.demo.paypal.flutterwave;
559561
PRODUCT_NAME = "$(TARGET_NAME)";
560-
SUPPORTS_MACCATALYST = YES;
562+
SUPPORTS_MACCATALYST = NO;
561563
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
562564
SWIFT_VERSION = 5.0;
563565
TARGETED_DEVICE_FAMILY = "1,2";

Diff for: Example/FlutterwaveSDK/Images.xcassets/AppIcon.appiconset/Contents.json

+54
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,60 @@
4848
"scale" : "3x",
4949
"size" : "60x60"
5050
},
51+
{
52+
"filename" : "[email protected]",
53+
"idiom" : "ipad",
54+
"scale" : "1x",
55+
"size" : "20x20"
56+
},
57+
{
58+
"filename" : "[email protected]",
59+
"idiom" : "ipad",
60+
"scale" : "2x",
61+
"size" : "20x20"
62+
},
63+
{
64+
"filename" : "[email protected]",
65+
"idiom" : "ipad",
66+
"scale" : "1x",
67+
"size" : "29x29"
68+
},
69+
{
70+
"filename" : "[email protected]",
71+
"idiom" : "ipad",
72+
"scale" : "2x",
73+
"size" : "29x29"
74+
},
75+
{
76+
"filename" : "[email protected]",
77+
"idiom" : "ipad",
78+
"scale" : "1x",
79+
"size" : "40x40"
80+
},
81+
{
82+
"filename" : "[email protected]",
83+
"idiom" : "ipad",
84+
"scale" : "2x",
85+
"size" : "40x40"
86+
},
87+
{
88+
"filename" : "[email protected]",
89+
"idiom" : "ipad",
90+
"scale" : "1x",
91+
"size" : "76x76"
92+
},
93+
{
94+
"filename" : "[email protected]",
95+
"idiom" : "ipad",
96+
"scale" : "2x",
97+
"size" : "76x76"
98+
},
99+
{
100+
"filename" : "[email protected]",
101+
"idiom" : "ipad",
102+
"scale" : "2x",
103+
"size" : "83.5x83.5"
104+
},
51105
{
52106
"filename" : "[email protected]",
53107
"idiom" : "ios-marketing",
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

Diff for: Example/FlutterwaveSDK/Info.plist

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
2222
<string>$(CURRENT_PROJECT_VERSION)</string>
23+
<key>ITSAppUsesNonExemptEncryption</key>
24+
<false/>
2325
<key>LSApplicationCategoryType</key>
2426
<string>public.app-category.finance</string>
2527
<key>LSRequiresIPhoneOS</key>
@@ -32,6 +34,8 @@
3234
<array>
3335
<string>armv7</string>
3436
</array>
37+
<key>UIRequiresFullScreen</key>
38+
<true/>
3539
<key>UISupportedInterfaceOrientations</key>
3640
<array>
3741
<string>UIInterfaceOrientationPortrait</string>

Diff for: Example/FlutterwaveSDK/ViewController.swift

+24-9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,28 @@ 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)
2345

2446
}
2547

@@ -45,7 +67,7 @@ class ViewController: UIViewController, FlutterwavePayProtocol {
4567
config.transcationRef = "[TRANSACTION REF]" // This is a unique reference, unique to the particular transaction being carried out. It is generated when it is not provided by the merchant for every transaction.
4668
config.firstName = "[USER'S FIRST NAME]" // This is the customers first name.
4769
config.lastName = "[USER'S SECOND NAME]" //This is the customers last name.
48-
config.meta = [["metaname":"iOS-SDK-v3", "metavalue": MetaValueDetails(paymentDetails: "", recieptId: "")]] //This is used to include additional payment information
70+
config.meta = [["metavalue":["paymentDetails":"", "recieptId":""] , "metaname": "iOS-SDK-v3"]] //This is used to include additional payment information
4971
config.narration = "simplifying payments for endless possibilities"
5072
config.publicKey = "[PUB_KEY]" //Public key
5173
config.encryptionKey = "[ENCRYPTION_KEY]" //Encryption key
@@ -57,6 +79,7 @@ class ViewController: UIViewController, FlutterwavePayProtocol {
5779
self.present(nav, animated: true)
5880

5981
}
82+
6083

6184

6285
override func viewDidLoad() {
@@ -67,11 +90,3 @@ class ViewController: UIViewController, FlutterwavePayProtocol {
6790
}
6891

6992

70-
struct MetaValueDetails {
71-
var paymentDetails:String
72-
var recieptId:String
73-
}
74-
75-
76-
77-

Diff for: FlutterwaveSDK.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'FlutterwaveSDK'
11-
s.version = '1.3.2'
11+
s.version = '1.3.3'
1212
s.summary = 'FlutterwaveSDK'
1313

1414
# This description is used to generate tags and improve search results.

Diff for: FlutterwaveSDK/Classes/App/RaveCardClient.swift

+8-4
Original file line numberDiff line numberDiff line change
@@ -240,18 +240,21 @@ class FlutterwaveCardClient{
240240

241241
if replaceData {
242242
bodyParam = param
243+
243244
}
244245
if isRetryCharge{
245246
if let retryValue = self.retryChargeValue{
246247
bodyParam?.merge(["retry_charge":retryValue])
247248
}
248249
}
249-
let jsonString = bodyParam!.jsonStringify()
250-
// print("JSON SENT \(jsonString)")
250+
251+
252+
let jsonString = bodyParam?.jsonStringify()
253+
// print("JSON SENT \(jsonString)")
251254
let secret = FlutterwaveConfig.sharedConfig().encryptionKey!
252-
let data = TripleDES.encrypt(string: jsonString, key:secret)
255+
let data = TripleDES.encrypt(string: jsonString ?? "", key:secret)
253256
let base64String = data?.base64EncodedString()
254-
257+
255258
CardViewModel.sharedViewModel.saveCard = saveCard
256259
PaymentServicesViewModel.sharedViewModel.chargeCard(client: base64String!)
257260

@@ -336,3 +339,4 @@ class FlutterwaveCardClient{
336339

337340

338341
}
342+

Diff for: FlutterwaveSDK/Classes/Model/PayPalModel.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
struct PaypalRequest: Codable {
1010
let txRef, amount, currency, country: String?
1111
let email, phoneNumber, fullname, clientIP: String?
12-
let redirectURL = "https://fw-redirect-ios-jimioniay.vercel.app/"
12+
let redirectURL: String?
1313
let deviceFingerprint, billingAddress, billingCity, billingZip: String?
1414
let billingState, billingCountry, shippingName, shippingAddress: String?
1515
let shippingCity, shippingZip, shippingState, shippingCountry: String?

Diff for: FlutterwaveSDK/Classes/UI/AccountForm.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class AccountForm: UIView {
121121
lazy var goBack: UIButton = {
122122
let button = UIButton(type: .system)
123123
button.setTitle("GO BACK", for: .normal)
124-
button.setTitleColor(.black, for: .normal)
124+
button.setTitleColor(UIColor.setColor(lightColor: .black, darkColor: .white), for: .normal)
125125
button.layer.cornerRadius = 4
126126
button.heightAnchor.constraint(equalToConstant: 57).isActive = true
127127
button.translatesAutoresizingMaskIntoConstraints = false

Diff for: FlutterwaveSDK/Classes/UI/BillingAddress.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class BillingAddress: UIView {
166166
lazy var goBackButton: UIButton = {
167167
let button = UIButton(type: .system)
168168
button.setTitle("GO BACK", for: .normal)
169-
button.setTitleColor(.black, for: .normal)
169+
button.setTitleColor(UIColor.setColor(lightColor: .black, darkColor: .white), for: .normal)
170170
button.backgroundColor = UIColor.clear
171171
button.layer.cornerRadius = 0
172172
button.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .medium)

Diff for: FlutterwaveSDK/Classes/UI/FlutterwavePayViewController.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,8 @@ public class FlutterwavePayViewController: BaseViewController {
659659
closeButton.addTarget(self, action: #selector(closeView), for: .touchUpInside)
660660
self.navigationItem.rightBarButtonItem = UIBarButtonItem(customView: closeButton)
661661

662-
// self.tableView.backgroundColor = UIColor(hex: "#F2F2F2")
663-
self.tableView.backgroundColor = UIColor.white
662+
// self.tableView.backgroundColor = UIColor(hex: "#F2F2F2")
663+
// self.tableView.backgroundColor = UIColor.white
664664
self.tableView.tableFooterView = UIView(frame: .zero)
665665
configureView()
666666
configureDebitCardView()
@@ -2012,15 +2012,15 @@ public class FlutterwavePayViewController: BaseViewController {
20122012
func cardPayAction(){
20132013
self.view.endEditing(true)
20142014
flutterwaveCardClient.cardNumber = self.debitCardView.cardNumberTextField.text?.components(separatedBy:CharacterSet.decimalDigits.inverted).joined()
2015-
2015+
//
20162016
// print("SDK VALUE \(flutterwaveCardClient.cardNumber.orEmpty())")
20172017
flutterwaveCardClient.cvv = self.debitCardView.cardCVV.text
2018-
2018+
//
20192019
let seperateCardExpiry = debitCardView.cardExpiry.text?.split(separator: "/")
2020-
2020+
//
20212021
flutterwaveCardClient.expMonth = String((seperateCardExpiry![0]))
20222022
flutterwaveCardClient.expYear = String((seperateCardExpiry![1]))
2023-
2023+
//
20242024
flutterwaveCardClient.amount = self.amount
20252025
flutterwaveCardClient.chargeCard(replaceData: true)
20262026

Diff for: FlutterwaveSDK/Classes/UI/NewExtraFlutterwave/FlutterWave+UIPickerView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ extension FlutterwavePayViewController : UITextFieldDelegate,CardSelect,UIPicker
122122
//selectBankAccountView
123123
UIView.animate(withDuration: 0.6, animations: {
124124
self.accountFormContainer.alpha = 1
125-
self.accountFormContainer.backgroundColor = UIColor(hex: "#f2f2f2")
125+
// self.accountFormContainer.backgroundColor = UIColor(hex: "#f2f2f2")
126126
self.accountFormContainer.accountImageView.image = UIImage(named: imageName,in: Bundle.getResourcesBundle(), compatibleWith: nil)
127127
self.selectBankAccountView.alpha = 0
128128
}) { (succeeded) in

Diff for: FlutterwaveSDK/Classes/UI/NewExtraFlutterwave/Flutterwave+Observers.swift

+5-2
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,11 @@ extension FlutterwavePayViewController {
207207
.map { String($0.prefix(6)) }
208208
.bind(to: accountOtpContentContainer.otpTextField.rx.text)
209209
.disposed(by: disposeBag)
210+
accountFormContainer.alpha = 0
210211
self.accountOtpContentContainer.isHidden = false
211-
self.accountFormContainer.alpha = 0
212+
213+
214+
212215
accountOtpContentContainer.otpMessage.text = message
213216

214217
accountOtpContentContainer.otpButton.rx.tap.subscribe(onNext: {
@@ -222,7 +225,7 @@ extension FlutterwavePayViewController {
222225
}).disposed(by: disposableBag)
223226

224227
UIView.animate(withDuration: 0.6, animations: {
225-
self.accountOtpContentContainer.alpha = 1
228+
self.accountOtpContentContainer.alpha = 0
226229
self.accountFormContainer.alpha = 0
227230
self.selectBankAccountView.alpha = 0
228231
}) { (success) in

Diff for: FlutterwaveSDK/Classes/UI/PayPalView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class PaypalView: UIView {
4646
lazy var instructionLabel: UILabel = {
4747
let label = UILabel()
4848
label.text = "You will be redirected to Paypal to complete this payment."
49-
label.textColor = UIColor.black
49+
// label.textColor = UIColor.black
5050
label.translatesAutoresizingMaskIntoConstraints = false
5151
label.numberOfLines = 2
5252
label.textAlignment = .center

Diff for: FlutterwaveSDK/Classes/UI/SaveCardCell.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class SaveCardCell: UITableViewCell {
1212

1313
lazy var contentContainer: UIView = {
1414
let view = UIView()
15-
view.backgroundColor = .white
15+
// view.backgroundColor = .white
16+
view.backgroundColor = UIColor(hex: "#F2F2F2")
1617
view.clipsToBounds = true
1718
view.translatesAutoresizingMaskIntoConstraints = false
1819
return view

Diff for: FlutterwaveSDK/Classes/UI/SaveCardViewController.swift

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class SaveCardViewController: UIViewController {
2323
lazy var saveCardTable:UITableView = {
2424
let table = UITableView()
2525
table.backgroundColor = .clear
26+
2627
table.translatesAutoresizingMaskIntoConstraints = false
2728
table.separatorStyle = .none
2829
return table

Diff for: FlutterwaveSDK/Classes/UI/SavedCardsView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SavedCardsView: UIView {
2929

3030
lazy var useAnotherCardButton: UIButton = {
3131
let button = UIButton(type: .system)
32-
button.setTitleColor(.black, for: .normal)
32+
button.setTitleColor(UIColor.setColor(lightColor: .black, darkColor: .white), for: .normal)
3333
button.setTitle("USE ANOTHER CARD", for: .normal)
3434
button.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .semibold)
3535
button.translatesAutoresizingMaskIntoConstraints = false

Diff for: FlutterwaveSDK/Classes/UI/USSDConfirmView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class USSDConfirmView: UIView {
8282
lazy var goBackButton: UIButton = {
8383
let button = UIButton(type: .system)
8484
button.setTitle("GO BACK", for: .normal)
85-
button.setTitleColor(.black, for: .normal)
85+
button.setTitleColor(UIColor.setColor(lightColor: .black, darkColor: .white), for: .normal)
8686
button.backgroundColor = UIColor.clear
8787
button.layer.cornerRadius = 0
8888
button.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .medium)

Diff for: FlutterwaveSDK/Classes/Utils/RaveConstants.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class RaveConstants: NSObject {
2525

2626
}
2727

28-
static let flutterWaveVersion = "1.3.2"
28+
static let flutterWaveVersion = "1.3.3"
2929
static let flutterColor = UIColor(hex: "#F5A623")
3030

3131
static let bankStyle = [(code:"044",color:"#143f89",image:"rave_access2"),

Diff for: FlutterwaveSDK/Classes/Utils/RaveExtension.swift

+15
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ public extension Dictionary{
208208
}
209209
catch
210210
{
211+
print("Catch level\(error)")
211212
}
212213

213214
return str
@@ -415,3 +416,17 @@ public extension UIColor {
415416
}
416417
}
417418

419+
420+
extension UIColor {
421+
422+
static func setColor(lightColor: UIColor, darkColor: UIColor) -> UIColor {
423+
if #available(iOS 13, *) {
424+
return UIColor{ (traitCollection) -> UIColor in
425+
return traitCollection.userInterfaceStyle == .light ? lightColor : darkColor
426+
}
427+
} else {
428+
return lightColor
429+
}
430+
}
431+
432+
}

Diff for: FlutterwaveSDK/Classes/ViewModel/PayPalVielModel.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class PaypalViewModel: BaseViewModel{
2424

2525

2626
func paypal(amount: String){
27-
let request = PaypalRequest(txRef: FlutterwaveConfig.sharedConfig().transcationRef, amount: amount, currency: FlutterwaveConfig.sharedConfig().currencyCode, country: FlutterwaveConfig.sharedConfig().country, email: FlutterwaveConfig.sharedConfig().email, phoneNumber: FlutterwaveConfig.sharedConfig().phoneNumber, fullname: "\(FlutterwaveConfig.sharedConfig().firstName.orEmpty()) \(FlutterwaveConfig.sharedConfig().lastName.orEmpty())", clientIP:(getIFAddresses().first), deviceFingerprint: (UIDevice.current.identifierForVendor?.uuidString), billingAddress:"", billingCity:"", billingZip:"", billingState:"", billingCountry:"", shippingName:"", shippingAddress:"", shippingCity:"", shippingZip:"", shippingState:"", shippingCountry:"")
27+
let request = PaypalRequest(txRef: FlutterwaveConfig.sharedConfig().transcationRef, amount: amount, currency: FlutterwaveConfig.sharedConfig().currencyCode, country: FlutterwaveConfig.sharedConfig().country, email: FlutterwaveConfig.sharedConfig().email, phoneNumber: FlutterwaveConfig.sharedConfig().phoneNumber, fullname: "\(FlutterwaveConfig.sharedConfig().firstName.orEmpty()) \(FlutterwaveConfig.sharedConfig().lastName.orEmpty())", clientIP:(getIFAddresses().first), redirectURL: "",deviceFingerprint: (UIDevice.current.identifierForVendor?.uuidString), billingAddress:"", billingCity:"", billingZip:"", billingState:"", billingCountry:"", shippingName:"", shippingAddress:"", shippingCity:"", shippingZip:"", shippingState:"", shippingCountry:"")
2828
makeAPICallRx(request: request, apiRequest: payPalRepository.payPal(request:), successHandler: payPalResponse,onSuccessOperation: {[weak self] response in
2929
self?.checkAuth(response: response.data, flwRef: response.data?.flwRef ?? "", source: .paypal)
3030
}, apiName: .payPal, apiErrorName: .payPalError)

0 commit comments

Comments
 (0)