11/*
2- MIT License
2+ MIT License
33
4- Copyright 2023 - Present, Shopify Inc.
4+ Copyright 2023 - Present, Shopify Inc.
55
6- Permission is hereby granted, free of charge, to any person obtaining a copy
7- of this software and associated documentation files (the "Software"), to deal
8- in the Software without restriction, including without limitation the rights
9- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10- copies of the Software, and to permit persons to whom the Software is
11- furnished to do so, subject to the following conditions:
6+ Permission is hereby granted, free of charge, to any person obtaining a copy
7+ of this software and associated documentation files (the "Software"), to deal
8+ in the Software without restriction, including without limitation the rights
9+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+ copies of the Software, and to permit persons to whom the Software is
11+ furnished to do so, subject to the following conditions:
1212
13- The above copyright notice and this permission notice shall be included in all
14- copies or substantial portions of the Software.
13+ The above copyright notice and this permission notice shall be included in all
14+ copies or substantial portions of the Software.
1515
16- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22- */
16+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+ */
2323
2424import Foundation
2525import React
@@ -30,7 +30,7 @@ import UIKit
3030class RCTShopifyCheckoutSheetKit : RCTEventEmitter , CheckoutDelegate {
3131 private var hasListeners = false
3232
33- var checkoutSheet : UIViewController ?
33+ internal var checkoutSheet : UIViewController ?
3434
3535 override var methodQueue : DispatchQueue ! {
3636 return DispatchQueue . main
@@ -78,7 +78,7 @@ class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate {
7878 " __typename " : " CheckoutExpiredError " ,
7979 " message " : message,
8080 " code " : code. rawValue,
81- " recoverable " : recoverable,
81+ " recoverable " : recoverable
8282 ] )
8383 } else if case let . checkoutUnavailable( message, code, recoverable) = error {
8484 switch code {
@@ -87,38 +87,38 @@ class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate {
8787 " __typename " : " CheckoutClientError " ,
8888 " message " : message,
8989 " code " : clientErrorCode. rawValue,
90- " recoverable " : recoverable,
90+ " recoverable " : recoverable
9191 ] )
9292 case let . httpError( statusCode) :
9393 sendEvent ( withName: " error " , body: [
9494 " __typename " : " CheckoutHTTPError " ,
9595 " message " : message,
9696 " code " : " http_error " ,
9797 " statusCode " : statusCode,
98- " recoverable " : recoverable,
98+ " recoverable " : recoverable
9999 ] )
100100 }
101101 } else if case let . configurationError( message, code, recoverable) = error {
102102 sendEvent ( withName: " error " , body: [
103103 " __typename " : " ConfigurationError " ,
104104 " message " : message,
105105 " code " : code. rawValue,
106- " recoverable " : recoverable,
106+ " recoverable " : recoverable
107107 ] )
108108 } else if case let . sdkError( underlying, recoverable) = error {
109109 var errorMessage = " \( underlying. localizedDescription) "
110110 sendEvent ( withName: " error " , body: [
111111 " __typename " : " InternalError " ,
112112 " code " : " unknown " ,
113113 " message " : errorMessage,
114- " recoverable " : recoverable,
114+ " recoverable " : recoverable
115115 ] )
116116 } else {
117117 sendEvent ( withName: " error " , body: [
118118 " __typename " : " UnknownError " ,
119119 " code " : " unknown " ,
120120 " message " : error. localizedDescription,
121- " recoverable " : error. isRecoverable,
121+ " recoverable " : error. isRecoverable
122122 ] )
123123 }
124124 }
@@ -148,7 +148,7 @@ class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate {
148148
149149 @objc override func constantsToExport( ) -> [ AnyHashable : Any ] ! {
150150 return [
151- " version " : ShopifyCheckoutSheetKit . version,
151+ " version " : ShopifyCheckoutSheetKit . version
152152 ]
153153 }
154154
@@ -250,7 +250,7 @@ class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate {
250250 " preloading " : ShopifyCheckoutSheetKit . configuration. preloading. enabled,
251251 " colorScheme " : ShopifyCheckoutSheetKit . configuration. colorScheme. rawValue,
252252 " tintColor " : ShopifyCheckoutSheetKit . configuration. tintColor,
253- " backgroundColor " : ShopifyCheckoutSheetKit . configuration. backgroundColor,
253+ " backgroundColor " : ShopifyCheckoutSheetKit . configuration. backgroundColor
254254 ]
255255
256256 resolve ( config)
@@ -290,7 +290,7 @@ class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate {
290290 " id " : encoded [ " id " ] ,
291291 " name " : encoded [ " name " ] ,
292292 " timestamp " : encoded [ " timestamp " ] ,
293- " type " : " STANDARD " ,
293+ " type " : " STANDARD "
294294 ] as [ String : Any ]
295295 }
296296
@@ -311,7 +311,7 @@ class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate {
311311 " id " : event. id,
312312 " name " : event. name,
313313 " timestamp " : event. timestamp,
314- " type " : " CUSTOM " ,
314+ " type " : " CUSTOM "
315315 ] as [ String : Any ]
316316 }
317317}
0 commit comments