Skip to content

Commit

Permalink
1.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
cuong-huynh-tamara committed May 1, 2024
1 parent 708b962 commit 618840f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 11 deletions.
11 changes: 7 additions & 4 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -342,8 +342,9 @@
645368DF2450A7D900ED9A3B /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1140;
LastUpgradeCheck = 1200;
LastUpgradeCheck = 1530;
ORGANIZATIONNAME = Tamara;
TargetAttributes = {
645368E62450A7D900ED9A3B = {
Expand Down Expand Up @@ -563,6 +564,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -624,6 +626,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down Expand Up @@ -651,7 +654,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"Example/Preview Content\"";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 9N367HAA79;
ENABLE_PREVIEWS = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -680,7 +683,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"Example/Preview Content\"";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 9N367HAA79;
ENABLE_PREVIEWS = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down
4 changes: 3 additions & 1 deletion Example/Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.0.7</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -38,6 +38,8 @@
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>Camera usage description</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
Expand Down
6 changes: 3 additions & 3 deletions Example/Example/InfoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ struct InfoView : View {
self.appState.isLoading = true
tamara.initialize(token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhY2NvdW50SWQiOiJmY2ZiYzk3ZC0wYmIwLTRkYTItYmY3ZS02MjhlOTRkMzM0M2EiLCJ0eXBlIjoibWVyY2hhbnQiLCJzYWx0IjoiNzQxMmZkZjI1NGZiMWJhNmY5N2FmMmY1N2YxYzA1MDYiLCJpYXQiOjE2Nzc4MzIzNzQsImlzcyI6IlRhbWFyYSJ9.WVn2sf3LrW_YI3c2pNrbcOa--tRDAVm9p2GOBRdn7d671QIuqPvDgI9Gz7MNzBirUDnVLATCrL9uvMxDY_1OzXe3Sn1Gawckw-NE2EfL_Kjnl8GcNqwMcMvcin9XGxGRhbDDusgFCFzxaiEYae3DpA-pO0TpyQbEXl49ZLT4a9sEW75Taxc2ofZ-DJ_ciblImk1aJ6p9YhQowvzAVHz6yG-ZRfosxc96t8BK15bVTvTLnT9hzEnCqifqKO7vSu1e2mKEG8lC46pZHSr-ZpvfjSytrMX2QAZuXqxtlvbg3aRZeGiJ-SKVcbRdlId1wSRTZ5lntrw3pyrLS1dpxcfSOA", apiUrl: "https://api-sandbox.tamara.co", pushUrl: "https://tamara.co/pushnotification", publishKey: "d36c6279-90c2-4239-b4e2-2c91bfda0fe4", notificationToken: "aeae44a2-5f57-475e-a384-0e9b8a802326", isSandbox: true)
tamara.createOrder(orderReferenceId: "A352BB0A59044C77928A7551A1EA566B", description: "String")
tamara.setCurrency(newCurrency: "AED")
tamara.setCountry(countryCode: "AE", currency: "AED")
tamara.setInstalments(instalments: 1)
tamara.setPlatform(platform: "Ios")
tamara.setLocale(locale: "en-US")
Expand All @@ -43,7 +45,7 @@ struct InfoView : View {
//check again json
}
tamara.setPaymentType(paymentType: "PAY_BY_INSTALMENTS")
tamara.setCustomerInfo(firstName: "Mona", lastName: "Lisa", phoneNumber: "502223333", email: "user@gmail.com")
tamara.setCustomerInfo(firstName: "Mona", lastName: "Lisa", phoneNumber: "502223353", email: "user1@gmail.com")

tamara.clearItem()

Expand All @@ -60,9 +62,7 @@ struct InfoView : View {
tamara.addItem(name: "Thor", referenceId: "123459_item", sku: "SA-12439", type: "Digital", unitPrice: 100.0, tax: 10.0, discount: 25.0, quantity: 1)

tamara.addItem(name: "Iron man", referenceId: "123460_item", sku: "SA-12460", type: "Digital", unitPrice: 500.0, tax: 10.0, discount: 0.0, quantity: 1)

tamara.setShippingAmount(amount: 20.0)

tamara.setDiscount(amount: 100.0, name: "Launch event's discount")

tamara.setShippingAddress(firstName: "Mona", lastName: "Lisa", phoneNumber: "502223337", addressLine1: "3764 Al Urubah Rd", addressLine2: "", country: "SA", region: "As Sulimaniyah", city: "Riyadh")
Expand Down
2 changes: 1 addition & 1 deletion TamaraSDK/TamaraSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = "TamaraSDK"
s.version = "1.0.13"
s.version = "1.0.14"
s.summary = "SDK for tamara.co"
s.description = "iOS sdk for tamara.co"
s.homepage = "https://tamara.co"
Expand Down
9 changes: 8 additions & 1 deletion TamaraSDK/TamaraSDK/TamaraSDKCheckout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public protocol TamaraCheckoutDelegate {
func onCancel()
}

public class TamaraSDKCheckout: UIViewController {
public class TamaraSDKCheckout: UIViewController, WKUIDelegate {
private var webView: WKWebView!
private var url: String!
public var delegate: TamaraCheckoutDelegate!
Expand Down Expand Up @@ -52,7 +52,13 @@ public class TamaraSDKCheckout: UIViewController {
/// Creates the view that the controller manages.
public override func loadView() {
let webConfiguration = WKWebViewConfiguration()
webConfiguration.preferences.javaScriptEnabled = true
webConfiguration.mediaTypesRequiringUserActionForPlayback = []
webConfiguration.allowsInlineMediaPlayback = true

webView = WKWebView(frame: .zero, configuration: webConfiguration)
webView.navigationDelegate = self
webView.allowsBackForwardNavigationGestures = true
view = webView
}

Expand All @@ -64,6 +70,7 @@ public class TamaraSDKCheckout: UIViewController {
let myURL = URL(string: authUrl)
let myRequest = URLRequest(url: myURL!)
webView.navigationDelegate = self
webView.uiDelegate = self
webView.load(myRequest)
}

Expand Down
9 changes: 8 additions & 1 deletion TamaraSDK/TamaraSDK/TamaraSDKCheckoutSwiftUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ public class TamaraSDKCheckoutSwiftUIViewModel: ObservableObject {
public init(url: String? = "", merchantURL: TamaraMerchantURL = TamaraMerchantURL(success: "", failure: "", cancel: "", notification: ""),webView: WKWebView? = WKWebView()) {
self.url = url ?? ""
self.merchantURL = merchantURL
self.webView = webView ?? WKWebView()
// Enable JavaScript
let webConfiguration = WKWebViewConfiguration()
webConfiguration.preferences.javaScriptEnabled = true
webConfiguration.allowsInlineMediaPlayback = true
webConfiguration.mediaTypesRequiringUserActionForPlayback = []

// Use the configuration to initialize the WKWebView
self.webView = WKWebView(frame: .zero, configuration: webConfiguration)
}
}

Expand Down
1 change: 1 addition & 0 deletions TamaraSDK/TamaraSDK/TamaraSDKPayment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ public extension TamaraSDKPayment {
*/
func setCountry(countryCode: String, currency: String) {
self.defaultCountryCode = countryCode
self.order?.countryCode = self.defaultCountryCode
}

/**
Expand Down

0 comments on commit 618840f

Please sign in to comment.