Skip to content

Commit

Permalink
fix send rate issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-AbdulRaouf committed Dec 18, 2023
1 parent 1e6c07a commit 8a13f89
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ PODS:
- SwinjectStoryboard (2.2.2):
- Swinject (~> 2.7.1)
- TextFieldEffects (1.6.0)
- WDFrameWorkIOS (3.3.5):
- WDFrameWorkIOS (3.3.6):
- AcceptCardSDK (= 5.5.1)
- Alamofire (~> 5.6.4)
- Bond
Expand Down Expand Up @@ -286,7 +286,7 @@ SPEC CHECKSUMS:
Swinject: ddf78b8486dd9b71a667b852cad919ab4484478e
SwinjectStoryboard: 240ce371396da09a4c43c72ee5c148108500e184
TextFieldEffects: 529b8aff706fb40f82c41c780c0777941a893796
WDFrameWorkIOS: 108afb2c042e09f39dd1d7edbebbc725d0955c90
WDFrameWorkIOS: 7c12abb3d77ba21bf2b78ed3e9f381b096323674

PODFILE CHECKSUM: 3ed71ff6d7b4335c6f24b6c4f9586f321dd86290

Expand Down
7 changes: 6 additions & 1 deletion Example/WDFrameWorkIOS/Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ class K{

//MARK: - CONFIGURATION
class Config {
// Debug Base Url
// https://wdorderonlineapitest.azurewebsites.net
// Pro
// https://wdorderonlineapi.azurewebsites.net

static var TestUserPhoneNumber: String {
return "01004276126"
}
Expand All @@ -39,7 +44,7 @@ class Config {
}

static var PayMobIntegrationID: Int {
return 3694576
return 3694576 // debug 3694576 // production 4371443
}

static var PayMobApiKey: String {
Expand Down
2 changes: 1 addition & 1 deletion Example/WDFrameWorkIOS/Configurations.plist
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<key>Debug</key>
<dict>
<key>serverURL</key>
<string>https://wdorderonlineapi.azurewebsites.net/</string>
<string>https://wdorderonlineapitest.azurewebsites.net/</string>
</dict>
<key>Release</key>
<dict>
Expand Down
3 changes: 2 additions & 1 deletion Example/WDFrameWorkIOS/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class ViewController: UIViewController {
let vc = WDStoryboard.instantiateViewController(withIdentifier: "TestViewController") as! TestViewController
// simple tech aacount
// let firstScreenWDframework = vc.create(firstName: "Mohamed",lastName: "Abdulraouf", mobile: "+201224660704", email: "mohamed.a.raouf@icloud.com", membershipNumber: "0040071777", language: language)
let firstScreenWDframework = vc.create(firstName: "Mohamed",lastName: "Abdulraouf", mobile: "+201226372125", email: "mohamed.a.raouf@icloud.com", membershipNumber: "0040071777", language: language)
// +201224660704
let firstScreenWDframework = vc.create(firstName: "Mohamed",lastName: "Abdulraouf", mobile: "+201002002829", email: "mohamed.a.raouf@icloud.com", membershipNumber: "0040071777", language: language)
// set app delegate to push view controller
let appDelegate = UIApplication.shared.delegate as? AppDelegate
let rootViewController = appDelegate?.window?.rootViewController as? UINavigationController
Expand Down
2 changes: 1 addition & 1 deletion WDFrameWorkIOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |spec|
spec.name = 'WDFrameWorkIOS'
spec.version = '3.3.5'
spec.version = '3.3.6'
spec.summary = 'A short description of WDFrameWorkIOS.'


Expand Down
21 changes: 11 additions & 10 deletions WDFrameWorkIOS/Classes/Storyboard/Order.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -1841,7 +1841,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="Cyt-2c-YkJ">
<rect key="frame" x="20" y="20" width="374" height="116"/>
<rect key="frame" x="20" y="20" width="374" height="100"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="3XF-22-AGG"/>
Expand All @@ -1850,30 +1850,31 @@
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4SY-mx-ugH">
<rect key="frame" x="172" y="166" width="70" height="30"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VEu-6Y-Boc">
<rect key="frame" x="147" y="145" width="120" height="51"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="8La-XP-RGV"/>
<constraint firstAttribute="width" constant="70" id="If6-Y9-UJc"/>
<constraint firstAttribute="height" constant="51" id="2p1-mK-HLM"/>
<constraint firstAttribute="width" constant="120" id="4c7-01-898"/>
</constraints>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="submit"/>
<connections>
<action selector="onSubmitRateTapped:" destination="2VM-vy-k8h" eventType="touchUpInside" id="qGb-bU-c4z"/>
<action selector="submitRateTappedBtn:" destination="2VM-vy-k8h" eventType="touchUpInside" id="f3W-1u-da9"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="4SY-mx-ugH" firstAttribute="top" secondItem="Cyt-2c-YkJ" secondAttribute="bottom" constant="30" id="1Ub-gv-1R2"/>
<constraint firstItem="VEu-6Y-Boc" firstAttribute="top" secondItem="Cyt-2c-YkJ" secondAttribute="bottom" constant="25" id="6Zv-sC-Fd8"/>
<constraint firstItem="VEu-6Y-Boc" firstAttribute="centerX" secondItem="Cyt-2c-YkJ" secondAttribute="centerX" id="9QM-DB-S8O"/>
<constraint firstItem="Cyt-2c-YkJ" firstAttribute="top" secondItem="cBt-pJ-A53" secondAttribute="top" constant="20" id="CdP-7B-9km"/>
<constraint firstAttribute="bottom" secondItem="VEu-6Y-Boc" secondAttribute="bottom" constant="10" id="Mcu-JU-XjL"/>
<constraint firstAttribute="trailing" secondItem="Cyt-2c-YkJ" secondAttribute="trailing" constant="20" id="Mjf-4M-WXv"/>
<constraint firstItem="4SY-mx-ugH" firstAttribute="centerX" secondItem="cBt-pJ-A53" secondAttribute="centerX" id="Tmo-YV-iyT"/>
<constraint firstItem="Cyt-2c-YkJ" firstAttribute="leading" secondItem="cBt-pJ-A53" secondAttribute="leading" constant="20" id="rSf-mk-Wih"/>
<constraint firstAttribute="bottom" secondItem="4SY-mx-ugH" secondAttribute="bottom" constant="10" id="szX-hh-Gfd"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="commentTextView" destination="Cyt-2c-YkJ" id="HVd-8H-9pc"/>
<outlet property="submitButton" destination="4SY-mx-ugH" id="RfK-Cq-FhJ"/>
<outlet property="submitRateBtn" destination="VEu-6Y-Boc" id="31v-bV-6AF"/>
</connections>
</tableViewCell>
</prototypes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ extension CheckOutViewController {
return
}
UserDefaultsApp.shared.orderPayID = "\(orderID)"
UserDefaultsApp.shared.orderID = orderID
self.paymentKeyRequest()
case .failure(let error):
debugPrint(error.localizedDescription)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class RateOrderCommentTableViewCell: UITableViewCell {
var onSubmitTapped: (() -> Void)?

// MARK: - IBOutlets
@IBOutlet weak var submitButton: UIButton!
@IBOutlet weak var commentTextView: UITextView!
@IBOutlet weak var submitRateBtn: UIButton!

override func awakeFromNib() {
super.awakeFromNib()
Expand All @@ -31,25 +31,25 @@ class RateOrderCommentTableViewCell: UITableViewCell {
// Configure the view for the selected state
}
func configureCell(_ comment: String,_ isOrderRatedBefore: Bool){
self.submitButton.backgroundColor = COLOR_ACCENT
self.submitButton.titleLabel?.font = FONT_PRIMARY_BUTTON
self.submitButton.setTitleColor(COLOR_BUTTON_TEXT, for: .normal)
self.submitButton.layer.cornerRadius = 5
self.submitButton.setTitle(R.string.localizable.submit(), for: .normal)
self.submitRateBtn.titleLabel?.font = FONT_PRIMARY_BUTTON
self.submitRateBtn.setTitleColor(COLOR_BUTTON_TEXT, for: .normal)
self.submitRateBtn.layer.cornerRadius = 5
self.submitRateBtn.setTitle(R.string.localizable.submit(), for: .normal)
self.commentTextView.layer.cornerRadius = 5
self.commentTextView.addShadow()
self.commentTextView.delegate = self
self.commentTextView.text = comment
self.commentTextView.isUserInteractionEnabled = !isOrderRatedBefore
self.submitButton.isHidden = isOrderRatedBefore
self.submitRateBtn.isHidden = isOrderRatedBefore
if isOrderRatedBefore {
self.commentTextView.isHidden = comment == ""
}
}

@IBAction func onSubmitRateTapped(_ sender: Any) {
@IBAction func submitRateTappedBtn(_ sender: Any) {
self.onSubmitTapped!()
}

}
extension RateOrderCommentTableViewCell : UITextViewDelegate {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ enum MainRouterPaymob: URLRequestConvertiblePaymob {
"auth_token": UserDefaultsApp.shared.auth_token,
"expiration": 3600,
"order_id": UserDefaultsApp.shared.orderPayID,
"merchant_order_id": UserDefaultsApp.shared.orderID,
"delivery_needed": "false",
"amount_cents": "\(Int(amount * 100))",
"currency": "EGP",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,13 @@ class UserDefaultsApp {
}
}

var orderID: Int {
set {
UserDefaults.standard.set(newValue, forKey: "wd_order_id")
}
get {
return UserDefaults.standard.integer(forKey: "wd_order_id")
}
}

}

0 comments on commit 8a13f89

Please sign in to comment.