iamport-react-native 2.0.15 → 3.0.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +12 -2
  3. package/lib/module/components/Certification/index.js +75 -72
  4. package/lib/module/components/Certification/index.js.map +1 -1
  5. package/lib/module/components/ErrorOnParams/index.js +13 -9
  6. package/lib/module/components/ErrorOnParams/index.js.map +1 -1
  7. package/lib/module/components/Loading/index.js +13 -9
  8. package/lib/module/components/Loading/index.js.map +1 -1
  9. package/lib/module/components/Payment/index.js +111 -93
  10. package/lib/module/components/Payment/index.js.map +1 -1
  11. package/lib/module/constants/index.js +2 -0
  12. package/lib/module/constants/index.js.map +1 -1
  13. package/lib/module/index.js +6 -4
  14. package/lib/module/index.js.map +1 -1
  15. package/lib/module/package.json +1 -0
  16. package/lib/module/styles.js +2 -0
  17. package/lib/module/styles.js.map +1 -1
  18. package/lib/module/utils/IamportUrl.js +51 -29
  19. package/lib/module/utils/IamportUrl.js.map +1 -1
  20. package/lib/module/utils/Validation.js +3 -2
  21. package/lib/module/utils/Validation.js.map +1 -1
  22. package/lib/module/utils/ValidationForPayment.js +4 -2
  23. package/lib/module/utils/ValidationForPayment.js.map +1 -1
  24. package/lib/typescript/package.json +1 -0
  25. package/lib/typescript/{components → src/components}/Certification/index.d.ts +1 -2
  26. package/lib/typescript/src/components/Certification/index.d.ts.map +1 -0
  27. package/lib/typescript/src/components/ErrorOnParams/index.d.ts +6 -0
  28. package/lib/typescript/src/components/ErrorOnParams/index.d.ts.map +1 -0
  29. package/lib/typescript/src/components/Loading/index.d.ts +3 -0
  30. package/lib/typescript/src/components/Loading/index.d.ts.map +1 -0
  31. package/lib/typescript/{components → src/components}/Payment/index.d.ts +1 -2
  32. package/lib/typescript/src/components/Payment/index.d.ts.map +1 -0
  33. package/lib/typescript/src/constants/index.d.ts.map +1 -0
  34. package/lib/typescript/src/index.d.ts.map +1 -0
  35. package/lib/typescript/{styles.d.ts → src/styles.d.ts} +2 -2
  36. package/lib/typescript/src/styles.d.ts.map +1 -0
  37. package/lib/typescript/{utils → src/utils}/IamportUrl.d.ts +8 -7
  38. package/lib/typescript/src/utils/IamportUrl.d.ts.map +1 -0
  39. package/lib/typescript/src/utils/Validation.d.ts.map +1 -0
  40. package/lib/typescript/src/utils/ValidationForPayment.d.ts.map +1 -0
  41. package/package.json +81 -74
  42. package/src/components/Certification/index.tsx +7 -7
  43. package/src/components/ErrorOnParams/index.tsx +1 -2
  44. package/src/components/Loading/index.tsx +1 -2
  45. package/src/components/Payment/index.tsx +31 -7
  46. package/src/utils/IamportUrl.ts +54 -26
  47. package/.circleci/config.yml +0 -98
  48. package/.editorconfig +0 -15
  49. package/.gitattributes +0 -3
  50. package/.gitignore +0 -69
  51. package/.yarnrc +0 -3
  52. package/.yarnrc.yml +0 -1
  53. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  54. package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
  55. package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
  56. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  57. package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
  58. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  59. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  60. package/android/.gradle/8.9/gc.properties +0 -0
  61. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  62. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  63. package/android/.gradle/vcs-1/gc.properties +0 -0
  64. package/android/build.gradle +0 -128
  65. package/android/gradle.properties +0 -4
  66. package/android/src/main/AndroidManifest.xml +0 -4
  67. package/android/src/main/java/com/iamportreactnative/IamportReactNativePackage.kt +0 -17
  68. package/android/src/main/java/com/iamportreactnative/IamportReactNativeViewManager.kt +0 -20
  69. package/babel.config.js +0 -3
  70. package/example/.gitignore +0 -69
  71. package/example/README.md +0 -44
  72. package/example/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
  73. package/example/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
  74. package/example/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
  75. package/example/android/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  76. package/example/android/.gradle/7.5.1/dependencies-accessors/gc.properties +0 -0
  77. package/example/android/.gradle/7.5.1/executionHistory/executionHistory.lock +0 -0
  78. package/example/android/.gradle/7.5.1/fileChanges/last-build.bin +0 -0
  79. package/example/android/.gradle/7.5.1/fileHashes/fileHashes.bin +0 -0
  80. package/example/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
  81. package/example/android/.gradle/7.5.1/gc.properties +0 -0
  82. package/example/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  83. package/example/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  84. package/example/android/.gradle/vcs-1/gc.properties +0 -0
  85. package/example/android/app/build.gradle +0 -183
  86. package/example/android/app/debug.keystore +0 -0
  87. package/example/android/app/proguard-rules.pro +0 -10
  88. package/example/android/app/src/debug/AndroidManifest.xml +0 -8
  89. package/example/android/app/src/debug/java/com/example/iamportreactnative/ReactNativeFlipper.java +0 -69
  90. package/example/android/app/src/main/AndroidManifest.xml +0 -34
  91. package/example/android/app/src/main/java/com/example/iamportreactnative/MainActivity.java +0 -15
  92. package/example/android/app/src/main/java/com/example/iamportreactnative/MainApplication.java +0 -80
  93. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  94. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  95. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  96. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  97. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  98. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  99. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  100. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  101. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  102. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  103. package/example/android/app/src/main/res/values/strings.xml +0 -3
  104. package/example/android/app/src/main/res/values/styles.xml +0 -9
  105. package/example/android/build.gradle +0 -21
  106. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  107. package/example/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  108. package/example/android/gradle.properties +0 -44
  109. package/example/android/gradlew +0 -183
  110. package/example/android/gradlew.bat +0 -103
  111. package/example/android/settings.gradle +0 -9
  112. package/example/app.json +0 -4
  113. package/example/babel.config.js +0 -11
  114. package/example/index.js +0 -5
  115. package/example/ios/File.swift +0 -8
  116. package/example/ios/Gemfile +0 -7
  117. package/example/ios/Gemfile.lock +0 -99
  118. package/example/ios/IamportReactNativeExample/AppDelegate.h +0 -15
  119. package/example/ios/IamportReactNativeExample/AppDelegate.mm +0 -138
  120. package/example/ios/IamportReactNativeExample/Images.xcassets/AppIcon.appiconset/Contents.json +0 -53
  121. package/example/ios/IamportReactNativeExample/Images.xcassets/Contents.json +0 -6
  122. package/example/ios/IamportReactNativeExample/Info.plist +0 -121
  123. package/example/ios/IamportReactNativeExample/LaunchScreen.storyboard +0 -58
  124. package/example/ios/IamportReactNativeExample/main.m +0 -16
  125. package/example/ios/IamportReactNativeExample-Bridging-Header.h +0 -3
  126. package/example/ios/IamportReactNativeExample.xcodeproj/project.pbxproj +0 -969
  127. package/example/ios/IamportReactNativeExample.xcodeproj/xcshareddata/xcschemes/IamportReactNativeExample.xcscheme +0 -99
  128. package/example/ios/IamportReactNativeExample.xcworkspace/contents.xcworkspacedata +0 -10
  129. package/example/ios/IamportReactNativeExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  130. package/example/ios/Podfile +0 -57
  131. package/example/ios/Podfile.lock +0 -756
  132. package/example/metro.config.js +0 -66
  133. package/example/package.json +0 -40
  134. package/example/src/App.tsx +0 -17
  135. package/example/src/Certification/index.tsx +0 -30
  136. package/example/src/CertificationResult/index.tsx +0 -79
  137. package/example/src/CertificationTest/index.tsx +0 -214
  138. package/example/src/Home/index.tsx +0 -87
  139. package/example/src/Loading/index.tsx +0 -12
  140. package/example/src/NavigationService.tsx +0 -127
  141. package/example/src/Payment/index.tsx +0 -28
  142. package/example/src/PaymentResult/index.tsx +0 -96
  143. package/example/src/PaymentTest/index.tsx +0 -383
  144. package/example/src/Picker/index.tsx +0 -60
  145. package/example/src/constants.ts +0 -274
  146. package/example/src/utils.ts +0 -83
  147. package/example/yarn.lock +0 -7358
  148. package/exampleForExpo/.buckconfig +0 -6
  149. package/exampleForExpo/.expo/README.md +0 -8
  150. package/exampleForExpo/.expo/devices.json +0 -3
  151. package/exampleForExpo/.gitattributes +0 -1
  152. package/exampleForExpo/.gitignore +0 -125
  153. package/exampleForExpo/.idea/.gitignore +0 -3
  154. package/exampleForExpo/.idea/caches/deviceStreaming.xml +0 -549
  155. package/exampleForExpo/.idea/exampleForExpo.iml +0 -9
  156. package/exampleForExpo/.idea/misc.xml +0 -6
  157. package/exampleForExpo/.idea/modules.xml +0 -8
  158. package/exampleForExpo/.idea/vcs.xml +0 -6
  159. package/exampleForExpo/.idea/workspace.xml +0 -53
  160. package/exampleForExpo/README.md +0 -58
  161. package/exampleForExpo/__tests__/App.js +0 -10
  162. package/exampleForExpo/android/.gitignore +0 -21
  163. package/exampleForExpo/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
  164. package/exampleForExpo/android/.gradle/7.5.1/fileChanges/last-build.bin +0 -0
  165. package/exampleForExpo/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
  166. package/exampleForExpo/android/.gradle/7.5.1/gc.properties +0 -0
  167. package/exampleForExpo/android/.gradle/vcs-1/gc.properties +0 -0
  168. package/exampleForExpo/android/app/BUCK +0 -55
  169. package/exampleForExpo/android/app/build.gradle +0 -362
  170. package/exampleForExpo/android/app/build_defs.bzl +0 -19
  171. package/exampleForExpo/android/app/debug.keystore +0 -0
  172. package/exampleForExpo/android/app/proguard-rules.pro +0 -14
  173. package/exampleForExpo/android/app/src/debug/AndroidManifest.xml +0 -7
  174. package/exampleForExpo/android/app/src/debug/java/kr/iamport/exampleForExpo/ReactNativeFlipper.java +0 -69
  175. package/exampleForExpo/android/app/src/main/AndroidManifest.xml +0 -34
  176. package/exampleForExpo/android/app/src/main/java/kr/iamport/exampleForExpo/MainActivity.java +0 -83
  177. package/exampleForExpo/android/app/src/main/java/kr/iamport/exampleForExpo/MainApplication.java +0 -106
  178. package/exampleForExpo/android/app/src/main/java/kr/iamport/exampleForExpo/newarchitecture/MainApplicationReactNativeHost.java +0 -117
  179. package/exampleForExpo/android/app/src/main/java/kr/iamport/exampleForExpo/newarchitecture/components/MainComponentsRegistry.java +0 -36
  180. package/exampleForExpo/android/app/src/main/java/kr/iamport/exampleForExpo/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +0 -48
  181. package/exampleForExpo/android/app/src/main/jni/CMakeLists.txt +0 -7
  182. package/exampleForExpo/android/app/src/main/jni/MainApplicationModuleProvider.cpp +0 -32
  183. package/exampleForExpo/android/app/src/main/jni/MainApplicationModuleProvider.h +0 -16
  184. package/exampleForExpo/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +0 -45
  185. package/exampleForExpo/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +0 -38
  186. package/exampleForExpo/android/app/src/main/jni/MainComponentsRegistry.cpp +0 -65
  187. package/exampleForExpo/android/app/src/main/jni/MainComponentsRegistry.h +0 -32
  188. package/exampleForExpo/android/app/src/main/jni/OnLoad.cpp +0 -11
  189. package/exampleForExpo/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -36
  190. package/exampleForExpo/android/app/src/main/res/drawable/splashscreen.xml +0 -4
  191. package/exampleForExpo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  192. package/exampleForExpo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  193. package/exampleForExpo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  194. package/exampleForExpo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  195. package/exampleForExpo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  196. package/exampleForExpo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  197. package/exampleForExpo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  198. package/exampleForExpo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  199. package/exampleForExpo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  200. package/exampleForExpo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  201. package/exampleForExpo/android/app/src/main/res/values/colors.xml +0 -4
  202. package/exampleForExpo/android/app/src/main/res/values/strings.xml +0 -3
  203. package/exampleForExpo/android/app/src/main/res/values/styles.xml +0 -17
  204. package/exampleForExpo/android/app/src/main/res/values-night/colors.xml +0 -1
  205. package/exampleForExpo/android/build.gradle +0 -65
  206. package/exampleForExpo/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  207. package/exampleForExpo/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  208. package/exampleForExpo/android/gradle.properties +0 -53
  209. package/exampleForExpo/android/gradlew +0 -240
  210. package/exampleForExpo/android/gradlew.bat +0 -91
  211. package/exampleForExpo/android/settings.gradle +0 -17
  212. package/exampleForExpo/app.json +0 -16
  213. package/exampleForExpo/babel.config.js +0 -11
  214. package/exampleForExpo/index.js +0 -9
  215. package/exampleForExpo/ios/.gitignore +0 -30
  216. package/exampleForExpo/ios/.xcode.env +0 -11
  217. package/exampleForExpo/ios/Podfile +0 -61
  218. package/exampleForExpo/ios/Podfile.lock +0 -734
  219. package/exampleForExpo/ios/Podfile.properties.json +0 -3
  220. package/exampleForExpo/ios/exampleForExpo/AppDelegate.h +0 -9
  221. package/exampleForExpo/ios/exampleForExpo/AppDelegate.mm +0 -166
  222. package/exampleForExpo/ios/exampleForExpo/Images.xcassets/AppIcon.appiconset/Contents.json +0 -38
  223. package/exampleForExpo/ios/exampleForExpo/Images.xcassets/Contents.json +0 -6
  224. package/exampleForExpo/ios/exampleForExpo/Images.xcassets/SplashScreenBackground.imageset/Contents.json +0 -21
  225. package/exampleForExpo/ios/exampleForExpo/Images.xcassets/SplashScreenBackground.imageset/image.png +0 -0
  226. package/exampleForExpo/ios/exampleForExpo/Info.plist +0 -118
  227. package/exampleForExpo/ios/exampleForExpo/SplashScreen.storyboard +0 -43
  228. package/exampleForExpo/ios/exampleForExpo/Supporting/Expo.plist +0 -16
  229. package/exampleForExpo/ios/exampleForExpo/exampleForExpo.entitlements +0 -8
  230. package/exampleForExpo/ios/exampleForExpo/main.m +0 -10
  231. package/exampleForExpo/ios/exampleForExpo/noop-file.swift +0 -4
  232. package/exampleForExpo/ios/exampleForExpo.xcodeproj/project.pbxproj +0 -544
  233. package/exampleForExpo/ios/exampleForExpo.xcodeproj/xcshareddata/xcschemes/exampleForExpo.xcscheme +0 -88
  234. package/exampleForExpo/ios/exampleForExpo.xcworkspace/contents.xcworkspacedata +0 -10
  235. package/exampleForExpo/ios/exampleForExpo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  236. package/exampleForExpo/metro.config.js +0 -62
  237. package/exampleForExpo/package.json +0 -40
  238. package/exampleForExpo/src/App.js +0 -14
  239. package/exampleForExpo/src/Certification/index.js +0 -25
  240. package/exampleForExpo/src/CertificationResult/index.js +0 -61
  241. package/exampleForExpo/src/CertificationTest/index.js +0 -151
  242. package/exampleForExpo/src/Home/index.js +0 -80
  243. package/exampleForExpo/src/Loading/index.js +0 -10
  244. package/exampleForExpo/src/NavigationService.js +0 -102
  245. package/exampleForExpo/src/Payment/index.js +0 -23
  246. package/exampleForExpo/src/PaymentResult/index.js +0 -82
  247. package/exampleForExpo/src/PaymentTest/index.js +0 -313
  248. package/exampleForExpo/src/Picker/index.js +0 -19
  249. package/exampleForExpo/src/constants.js +0 -322
  250. package/exampleForExpo/src/utils.js +0 -116
  251. package/exampleForExpo/yarn.lock +0 -9498
  252. package/exampleForManagedExpo/.expo-shared/assets.json +0 -4
  253. package/exampleForManagedExpo/.gitignore +0 -22
  254. package/exampleForManagedExpo/App.js +0 -11
  255. package/exampleForManagedExpo/README.md +0 -33
  256. package/exampleForManagedExpo/app.json +0 -90
  257. package/exampleForManagedExpo/assets/adaptive-icon.png +0 -0
  258. package/exampleForManagedExpo/assets/favicon.png +0 -0
  259. package/exampleForManagedExpo/assets/icon.png +0 -0
  260. package/exampleForManagedExpo/assets/splash.png +0 -0
  261. package/exampleForManagedExpo/babel.config.js +0 -11
  262. package/exampleForManagedExpo/metro.config.js +0 -62
  263. package/exampleForManagedExpo/package.json +0 -36
  264. package/exampleForManagedExpo/src/Certification/index.js +0 -25
  265. package/exampleForManagedExpo/src/CertificationResult/index.js +0 -61
  266. package/exampleForManagedExpo/src/CertificationTest/index.js +0 -151
  267. package/exampleForManagedExpo/src/Home/index.js +0 -80
  268. package/exampleForManagedExpo/src/Loading/index.js +0 -10
  269. package/exampleForManagedExpo/src/NavigationService.js +0 -102
  270. package/exampleForManagedExpo/src/Payment/index.js +0 -23
  271. package/exampleForManagedExpo/src/PaymentResult/index.js +0 -82
  272. package/exampleForManagedExpo/src/PaymentTest/index.js +0 -313
  273. package/exampleForManagedExpo/src/Picker/index.js +0 -19
  274. package/exampleForManagedExpo/src/constants.js +0 -322
  275. package/exampleForManagedExpo/src/utils.js +0 -116
  276. package/exampleForManagedExpo/yarn.lock +0 -9411
  277. package/exampleForWebView/.buckconfig +0 -6
  278. package/exampleForWebView/.eslintrc.js +0 -4
  279. package/exampleForWebView/.gitattributes +0 -3
  280. package/exampleForWebView/.gitignore +0 -68
  281. package/exampleForWebView/.prettierrc.js +0 -7
  282. package/exampleForWebView/.watchmanconfig +0 -1
  283. package/exampleForWebView/README.md +0 -77
  284. package/exampleForWebView/__tests__/App-test.tsx +0 -14
  285. package/exampleForWebView/_editorconfig +0 -3
  286. package/exampleForWebView/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
  287. package/exampleForWebView/android/.gradle/7.5.1/fileChanges/last-build.bin +0 -0
  288. package/exampleForWebView/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
  289. package/exampleForWebView/android/.gradle/7.5.1/gc.properties +0 -0
  290. package/exampleForWebView/android/.gradle/vcs-1/gc.properties +0 -0
  291. package/exampleForWebView/android/app/BUCK +0 -55
  292. package/exampleForWebView/android/app/build.gradle +0 -313
  293. package/exampleForWebView/android/app/build_defs.bzl +0 -19
  294. package/exampleForWebView/android/app/debug.keystore +0 -0
  295. package/exampleForWebView/android/app/proguard-rules.pro +0 -10
  296. package/exampleForWebView/android/app/src/debug/AndroidManifest.xml +0 -13
  297. package/exampleForWebView/android/app/src/debug/java/com/exampleforwebview/ReactNativeFlipper.java +0 -73
  298. package/exampleForWebView/android/app/src/main/AndroidManifest.xml +0 -26
  299. package/exampleForWebView/android/app/src/main/java/com/exampleforwebview/MainActivity.java +0 -48
  300. package/exampleForWebView/android/app/src/main/java/com/exampleforwebview/MainApplication.java +0 -91
  301. package/exampleForWebView/android/app/src/main/java/com/exampleforwebview/newarchitecture/MainApplicationReactNativeHost.java +0 -116
  302. package/exampleForWebView/android/app/src/main/java/com/exampleforwebview/newarchitecture/components/MainComponentsRegistry.java +0 -36
  303. package/exampleForWebView/android/app/src/main/java/com/exampleforwebview/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +0 -48
  304. package/exampleForWebView/android/app/src/main/jni/CMakeLists.txt +0 -7
  305. package/exampleForWebView/android/app/src/main/jni/MainApplicationModuleProvider.cpp +0 -32
  306. package/exampleForWebView/android/app/src/main/jni/MainApplicationModuleProvider.h +0 -16
  307. package/exampleForWebView/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +0 -45
  308. package/exampleForWebView/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +0 -38
  309. package/exampleForWebView/android/app/src/main/jni/MainComponentsRegistry.cpp +0 -65
  310. package/exampleForWebView/android/app/src/main/jni/MainComponentsRegistry.h +0 -32
  311. package/exampleForWebView/android/app/src/main/jni/OnLoad.cpp +0 -11
  312. package/exampleForWebView/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -36
  313. package/exampleForWebView/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  314. package/exampleForWebView/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  315. package/exampleForWebView/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  316. package/exampleForWebView/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  317. package/exampleForWebView/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  318. package/exampleForWebView/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  319. package/exampleForWebView/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  320. package/exampleForWebView/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  321. package/exampleForWebView/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  322. package/exampleForWebView/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  323. package/exampleForWebView/android/app/src/main/res/values/strings.xml +0 -3
  324. package/exampleForWebView/android/app/src/main/res/values/styles.xml +0 -9
  325. package/exampleForWebView/android/build.gradle +0 -51
  326. package/exampleForWebView/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  327. package/exampleForWebView/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  328. package/exampleForWebView/android/gradle.properties +0 -40
  329. package/exampleForWebView/android/gradlew +0 -234
  330. package/exampleForWebView/android/gradlew.bat +0 -89
  331. package/exampleForWebView/android/settings.gradle +0 -11
  332. package/exampleForWebView/app.json +0 -4
  333. package/exampleForWebView/babel.config.js +0 -11
  334. package/exampleForWebView/index.js +0 -9
  335. package/exampleForWebView/ios/.xcode.env +0 -11
  336. package/exampleForWebView/ios/Podfile +0 -43
  337. package/exampleForWebView/ios/Podfile.lock +0 -748
  338. package/exampleForWebView/ios/exampleForWebView/AppDelegate.h +0 -8
  339. package/exampleForWebView/ios/exampleForWebView/AppDelegate.mm +0 -133
  340. package/exampleForWebView/ios/exampleForWebView/Images.xcassets/AppIcon.appiconset/Contents.json +0 -53
  341. package/exampleForWebView/ios/exampleForWebView/Images.xcassets/Contents.json +0 -6
  342. package/exampleForWebView/ios/exampleForWebView/Info.plist +0 -96
  343. package/exampleForWebView/ios/exampleForWebView/LaunchScreen.storyboard +0 -47
  344. package/exampleForWebView/ios/exampleForWebView/main.m +0 -10
  345. package/exampleForWebView/ios/exampleForWebView.xcodeproj/project.pbxproj +0 -723
  346. package/exampleForWebView/ios/exampleForWebView.xcodeproj/xcshareddata/xcschemes/exampleForWebView.xcscheme +0 -88
  347. package/exampleForWebView/ios/exampleForWebView.xcworkspace/contents.xcworkspacedata +0 -10
  348. package/exampleForWebView/ios/exampleForWebView.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  349. package/exampleForWebView/ios/exampleForWebViewTests/Info.plist +0 -24
  350. package/exampleForWebView/ios/exampleForWebViewTests/exampleForWebViewTests.m +0 -66
  351. package/exampleForWebView/manuals/CERTIFICATION.md +0 -223
  352. package/exampleForWebView/manuals/PAYMENT.md +0 -232
  353. package/exampleForWebView/metro.config.js +0 -61
  354. package/exampleForWebView/package.json +0 -54
  355. package/exampleForWebView/src/App.tsx +0 -50
  356. package/exampleForWebView/src/Certification.tsx +0 -54
  357. package/exampleForWebView/src/Home.tsx +0 -49
  358. package/exampleForWebView/src/Loading.tsx +0 -23
  359. package/exampleForWebView/src/Payment.tsx +0 -65
  360. package/exampleForWebView/yarn.lock +0 -7362
  361. package/iamport-react-native.podspec +0 -19
  362. package/ios/IamportReactNative-Bridging-Header.h +0 -1
  363. package/ios/IamportReactNative.xcodeproj/project.pbxproj +0 -293
  364. package/ios/IamportReactNativeViewManager.m +0 -12
  365. package/ios/IamportReactNativeViewManager.swift +0 -32
  366. package/lib/commonjs/components/Certification/index.js +0 -121
  367. package/lib/commonjs/components/Certification/index.js.map +0 -1
  368. package/lib/commonjs/components/ErrorOnParams/index.js +0 -50
  369. package/lib/commonjs/components/ErrorOnParams/index.js.map +0 -1
  370. package/lib/commonjs/components/Loading/index.js +0 -34
  371. package/lib/commonjs/components/Loading/index.js.map +0 -1
  372. package/lib/commonjs/components/Payment/index.js +0 -225
  373. package/lib/commonjs/components/Payment/index.js.map +0 -1
  374. package/lib/commonjs/constants/index.js +0 -114
  375. package/lib/commonjs/constants/index.js.map +0 -1
  376. package/lib/commonjs/img/iamport-logo.png +0 -0
  377. package/lib/commonjs/index.js +0 -29
  378. package/lib/commonjs/index.js.map +0 -1
  379. package/lib/commonjs/styles.js +0 -27
  380. package/lib/commonjs/styles.js.map +0 -1
  381. package/lib/commonjs/utils/IamportUrl.js +0 -289
  382. package/lib/commonjs/utils/IamportUrl.js.map +0 -1
  383. package/lib/commonjs/utils/Validation.js +0 -109
  384. package/lib/commonjs/utils/Validation.js.map +0 -1
  385. package/lib/commonjs/utils/ValidationForPayment.js +0 -112
  386. package/lib/commonjs/utils/ValidationForPayment.js.map +0 -1
  387. package/lib/typescript/components/Certification/index.d.ts.map +0 -1
  388. package/lib/typescript/components/ErrorOnParams/index.d.ts +0 -7
  389. package/lib/typescript/components/ErrorOnParams/index.d.ts.map +0 -1
  390. package/lib/typescript/components/Loading/index.d.ts +0 -4
  391. package/lib/typescript/components/Loading/index.d.ts.map +0 -1
  392. package/lib/typescript/components/Payment/index.d.ts.map +0 -1
  393. package/lib/typescript/constants/index.d.ts.map +0 -1
  394. package/lib/typescript/index.d.ts.map +0 -1
  395. package/lib/typescript/styles.d.ts.map +0 -1
  396. package/lib/typescript/utils/IamportUrl.d.ts.map +0 -1
  397. package/lib/typescript/utils/Validation.d.ts.map +0 -1
  398. package/lib/typescript/utils/ValidationForPayment.d.ts.map +0 -1
  399. package/manuals/CALLBACK.md +0 -72
  400. package/manuals/EXAMPLE.md +0 -168
  401. package/manuals/EXPO.md +0 -246
  402. package/manuals/INSTALL.md +0 -31
  403. package/manuals/SETTING.md +0 -140
  404. package/manuals/SUPPORT.md +0 -35
  405. package/manuals/TRANS.md +0 -77
  406. package/manuals/VERSION.md +0 -187
  407. package/manuals/assets/after-linking-iamport.png +0 -0
  408. package/manuals/assets/after-linking-webview.png +0 -0
  409. package/manuals/assets/allow-arbitrary.gif +0 -0
  410. package/manuals/assets/android-studio-avd-manager.png +0 -0
  411. package/manuals/assets/android-studio-build.png +0 -0
  412. package/manuals/assets/app-scheme-registry.gif +0 -0
  413. package/manuals/assets/expo-eject.png +0 -0
  414. package/manuals/assets/ios-emulator-certification.png +0 -0
  415. package/manuals/assets/ios-emulator-home.png +0 -0
  416. package/manuals/assets/ios-emulator-payment.png +0 -0
  417. package/manuals/assets/ios-trans-create-header-file-1.png +0 -0
  418. package/manuals/assets/ios-trans-create-header-file-2.png +0 -0
  419. package/manuals/assets/ios-trans-create-objectivec-file-1.png +0 -0
  420. package/manuals/assets/ios-trans-create-objectivec-file-2.png +0 -0
  421. package/manuals/assets/ios-trans-result.png +0 -0
  422. package/manuals/assets/webview-peer-dependency.png +0 -0
  423. package/scripts/bootstrap.js +0 -24
  424. package/tsconfig.build.json +0 -9
  425. package/tsconfig.json +0 -26
  426. package/yarn.lock +0 -6174
  427. /package/lib/typescript/{constants → src/constants}/index.d.ts +0 -0
  428. /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
  429. /package/lib/typescript/{utils → src/utils}/Validation.d.ts +0 -0
  430. /package/lib/typescript/{utils → src/utils}/ValidationForPayment.d.ts +0 -0
package/package.json CHANGED
@@ -1,46 +1,30 @@
1
1
  {
2
2
  "name": "iamport-react-native",
3
- "version": "2.0.15",
3
+ "version": "3.0.1-alpha.0",
4
4
  "description": "리액트 네이티브용 아임포트 결제/본인인증 연동 라이브러리",
5
- "main": "lib/commonjs/index",
6
- "module": "lib/module/index",
7
- "types": "lib/typescript/index.d.ts",
8
- "react-native": "src/index",
9
- "source": "src/index",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "source": "./src/index.tsx",
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
10
15
  "files": [
11
16
  "src",
12
17
  "lib",
13
- "android",
14
- "ios",
15
- "iamport-react-native.podspec",
16
- "!lib/typescript/example",
17
- "!android/build",
18
- "!ios/build",
19
- "!**/__tests__",
20
- "!**/__fixtures__",
21
- "!**/__mocks__"
18
+ "CHANGELOG.md"
22
19
  ],
23
- "scripts": {
24
- "test": "echo \"Error: no test specified\" && exit 1",
25
- "typescript": "tsc --noEmit",
26
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
27
- "prepare": "bob build",
28
- "example": "yarn --cwd example",
29
- "example-expo": "yarn --cwd exampleForExpo",
30
- "example-managed-expo": "yarn --cwd exampleForManagedExpo",
31
- "example-webview": "yarn --cwd exampleForWebView",
32
- "pods-example": "cd example && pod-install --quiet",
33
- "pods-example-webview": "cd exampleForWebView && pod-install --quiet",
34
- "bootstrap": "yarn example && yarn example-expo && yarn example-managed-expo && yarn example-webview &&yarn && yarn pods-example && yarn pods-example-webview"
35
- },
36
20
  "keywords": [
37
- "iamport",
38
- "react",
39
- "react-native"
21
+ "react-native",
22
+ "ios",
23
+ "android"
40
24
  ],
41
25
  "repository": {
42
26
  "type": "git",
43
- "url": "https://github.com/iamport/iamport-react-native"
27
+ "url": "git+https://github.com/iamport/iamport-react-native.git"
44
28
  },
45
29
  "author": "Hyukgyu Kwon <me@kwon.hk>",
46
30
  "license": "MIT",
@@ -48,54 +32,62 @@
48
32
  "url": "https://github.com/iamport/iamport-react-native/issues"
49
33
  },
50
34
  "homepage": "https://github.com/iamport/iamport-react-native#readme",
35
+ "publishConfig": {
36
+ "registry": "https://registry.npmjs.org/"
37
+ },
51
38
  "devDependencies": {
52
- "@react-native-community/eslint-config": "^3.2.0",
53
- "@types/react": "^18.0.26",
54
- "@types/react-native": "^0.70.8",
55
- "eslint": "^8.30.0",
56
- "eslint-config-prettier": "^8.5.0",
57
- "eslint-plugin-prettier": "^4.2.1",
58
- "pod-install": "^0.1.38",
59
- "prettier": "^2.8.1",
60
- "query-string": "^8.1.0",
61
- "react": "18.2.0",
62
- "react-native": "0.72.6",
63
- "react-native-builder-bob": "^0.20.3",
64
- "react-native-webview": "^13.6.2",
65
- "typescript": "^4.9.4"
39
+ "@changesets/cli": "^2.29.7",
40
+ "@eslint/compat": "^1.3.2",
41
+ "@eslint/eslintrc": "^3.3.1",
42
+ "@eslint/js": "^9.35.0",
43
+ "@react-native/babel-preset": "0.81.5",
44
+ "@react-native/eslint-config": "0.81.5",
45
+ "@release-it/conventional-changelog": "^10.0.1",
46
+ "@types/jest": "^29.5.14",
47
+ "@types/react": "^19.1.12",
48
+ "del-cli": "^6.0.0",
49
+ "eslint": "^9.35.0",
50
+ "eslint-config-prettier": "^10.1.8",
51
+ "eslint-plugin-prettier": "^5.5.4",
52
+ "jest": "^29.7.0",
53
+ "prettier": "^3.6.2",
54
+ "react": "19.1.0",
55
+ "react-native": "0.81.5",
56
+ "react-native-builder-bob": "^0.40.14",
57
+ "react-native-webview": "^13.16.0",
58
+ "release-it": "^19.0.4",
59
+ "typescript": "^5.9.3"
66
60
  },
67
61
  "peerDependencies": {
68
- "query-string": "8.x || 9.x",
69
62
  "react": "*",
70
63
  "react-native": "*",
71
- "react-native-webview": ">=11.x"
64
+ "react-native-webview": "*"
72
65
  },
73
- "resolutions": {
74
- "@types/react": "^18"
66
+ "jest": {
67
+ "preset": "react-native",
68
+ "modulePathIgnorePatterns": [
69
+ "<rootDir>/lib/"
70
+ ]
75
71
  },
76
- "eslintConfig": {
77
- "root": true,
78
- "extends": [
79
- "@react-native-community",
80
- "prettier"
81
- ],
82
- "rules": {
83
- "prettier/prettier": [
84
- "error",
85
- {
86
- "quoteProps": "consistent",
87
- "singleQuote": true,
88
- "tabWidth": 2,
89
- "trailingComma": "es5",
90
- "useTabs": false
72
+ "release-it": {
73
+ "git": {
74
+ "commitMessage": "chore: release ${version}",
75
+ "tagName": "v${version}"
76
+ },
77
+ "npm": {
78
+ "publish": true
79
+ },
80
+ "github": {
81
+ "release": true
82
+ },
83
+ "plugins": {
84
+ "@release-it/conventional-changelog": {
85
+ "preset": {
86
+ "name": "angular"
91
87
  }
92
- ]
88
+ }
93
89
  }
94
90
  },
95
- "eslintIgnore": [
96
- "node_modules/",
97
- "lib/"
98
- ],
99
91
  "prettier": {
100
92
  "quoteProps": "consistent",
101
93
  "singleQuote": true,
@@ -107,8 +99,12 @@
107
99
  "source": "src",
108
100
  "output": "lib",
109
101
  "targets": [
110
- "commonjs",
111
- "module",
102
+ [
103
+ "module",
104
+ {
105
+ "esm": true
106
+ }
107
+ ],
112
108
  [
113
109
  "typescript",
114
110
  {
@@ -117,5 +113,16 @@
117
113
  ]
118
114
  ]
119
115
  },
120
- "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
121
- }
116
+ "create-react-native-library": {
117
+ "languages": "js",
118
+ "type": "library",
119
+ "version": "0.54.8"
120
+ },
121
+ "scripts": {
122
+ "test": "jest",
123
+ "typecheck": "tsc",
124
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
125
+ "clean": "del-cli lib",
126
+ "release": "release-it --only-version"
127
+ }
128
+ }
@@ -1,12 +1,12 @@
1
- import React, { createRef, useState } from 'react';
1
+ import { createRef, useState } from 'react';
2
2
  import { View } from 'react-native';
3
3
  import { WebView } from 'react-native-webview';
4
4
 
5
- import Loading from '../Loading';
6
5
  import ErrorOnParams from '../ErrorOnParams';
6
+ import Loading from '../Loading';
7
7
 
8
- import { IMPData, Validation } from '../../utils/Validation';
9
8
  import { IMPConst } from '../../constants';
9
+ import { IMPData, Validation } from '../../utils/Validation';
10
10
 
11
11
  import viewStyles from '../../styles';
12
12
  import IamportUrl from '../../utils/IamportUrl';
@@ -62,11 +62,11 @@ function Certification({ userCode, tierCode, data, loading, callback }: Props) {
62
62
  }
63
63
  }}
64
64
  onMessage={(e) => {
65
- let data = e.nativeEvent.data;
66
- if (decodeURIComponent(data) !== data) {
67
- data = decodeURIComponent(data);
65
+ let messageData = e.nativeEvent.data;
66
+ if (decodeURIComponent(messageData) !== messageData) {
67
+ messageData = decodeURIComponent(messageData);
68
68
  }
69
- let response = JSON.parse(data);
69
+ let response = JSON.parse(messageData);
70
70
 
71
71
  if (typeof callback === 'function') {
72
72
  callback(response);
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { View, Image, Text, StyleSheet } from 'react-native';
1
+ import { Image, StyleSheet, Text, View } from 'react-native';
3
2
 
4
3
  const logo = require('../../img/iamport-logo.png');
5
4
 
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { View, Image, Text, StyleSheet } from 'react-native';
1
+ import { Image, StyleSheet, Text, View } from 'react-native';
3
2
 
4
3
  const logo = require('../../img/iamport-logo.png');
5
4
 
@@ -1,14 +1,14 @@
1
- import React, { createRef, useEffect, useRef, useState } from 'react';
2
1
  import type { IMPData } from 'iamport-react-native';
3
- import ValidationForPayment from '../../utils/ValidationForPayment';
4
- import ErrorOnParams from '../ErrorOnParams';
5
- import { Linking, Platform, View } from 'react-native';
6
- import { IMPConst } from '../../constants';
7
- import IamportUrl from '../../utils/IamportUrl';
2
+ import { createRef, useEffect, useRef, useState } from 'react';
3
+ import { Alert, Linking, Platform, View } from 'react-native';
8
4
  import WebView from 'react-native-webview';
5
+ import type { WebViewSource } from 'react-native-webview/lib/WebViewTypes';
6
+ import { IMPConst } from '../../constants';
9
7
  import viewStyles from '../../styles';
8
+ import IamportUrl from '../../utils/IamportUrl';
9
+ import ValidationForPayment from '../../utils/ValidationForPayment';
10
+ import ErrorOnParams from '../ErrorOnParams';
10
11
  import Loading from '../Loading';
11
- import type { WebViewSource } from 'react-native-webview/lib/WebViewTypes';
12
12
 
13
13
  type Props = {
14
14
  userCode: string;
@@ -129,6 +129,30 @@ function Payment({ userCode, tierCode, data, loading, callback }: Props) {
129
129
  ref={webview}
130
130
  source={webviewSource}
131
131
  mixedContentMode={'always'}
132
+ onError={(event) => {
133
+ console.warn(
134
+ 'Encountered an error loading page',
135
+ event.nativeEvent
136
+ );
137
+ // 탐색이 실패하면 react-native-webview는 바로 오류 화면을 표시하려 한다
138
+ // 한편 별도 설정 안 한 WKWebView는 오류를 무시하여 결제를 계속 진행할 수 있는 경우가 있다
139
+ // 오류 화면 표시를 막는다
140
+ event.preventDefault();
141
+ // Domain=NSURLErrorDomain Code=-1005 Description="The network connection was lost."
142
+ // 지속적으로 폴링하는 카드사(현대카드)의 경우 카드사 앱에서 돌아올 때 HTTP 요청이 강제 중단되어 -1005 오류 발생
143
+ // 별도 설정 안 한 WKWebView에서 간헐적으로 자동 리다이렉트가 안 되고 버튼을 누르라고 하는 경우 이 경우이다
144
+ // 무시한다
145
+ if (
146
+ Platform.OS === 'ios' ||
147
+ (Platform.OS === 'macos' && event.nativeEvent.code === -1005)
148
+ ) {
149
+ return;
150
+ }
151
+ // 이외의 경우에는 어떻게 처리해야 할지 확실하지 않지만 우선 알림을 보여 주도록 구현
152
+ Alert.alert(
153
+ `탐색 오류가 발생했습니다\n도메인: ${event.nativeEvent.domain}\n오류 코드: ${event.nativeEvent.code}\n설명: ${event.nativeEvent.description}`
154
+ );
155
+ }}
132
156
  onLoadEnd={() => {
133
157
  if (!isWebViewLoaded) {
134
158
  if (data.pg.startsWith('eximbay')) {
@@ -1,5 +1,4 @@
1
1
  import type { IMPData } from 'iamport-react-native';
2
- import queryString from 'query-string';
3
2
  import { Linking, Platform } from 'react-native';
4
3
  import { IMPConst } from '../constants';
5
4
 
@@ -11,32 +10,36 @@ class IamportUrl {
11
10
 
12
11
  constructor(url: string) {
13
12
  this.url = url;
14
- this.scheme = url.split('://', 1)[0];
15
- let splittedUrl = [this.scheme, url.slice(this.scheme.length + 3)];
13
+ const [scheme, location] = splitFirst(url, '://');
14
+ this.scheme = scheme;
16
15
  if (Platform.OS === 'ios') {
17
16
  this.path = this.scheme.startsWith('itms')
18
- ? `https://${splittedUrl[1]}`
17
+ ? `https://${location}`
19
18
  : this.url;
20
19
  } else if (Platform.OS === 'android') {
21
20
  if (this.isAppUrl()) {
22
21
  if (this.scheme.includes('intent')) {
23
- let intentUrl = splittedUrl[1].split('#Intent;');
24
- let host = intentUrl[0];
25
- let args = intentUrl[1].split(';');
26
-
22
+ const [host, argText] = splitFirst(location!!, '#Intent;');
23
+ const args = argText!!.split(';');
27
24
  if (this.scheme !== 'intent') {
28
- this.scheme = this.scheme.split(':')[1];
25
+ this.scheme = this.scheme.split(':')[1]!!;
29
26
  this.path = this.scheme + '://' + host;
30
27
  }
31
- args.forEach((s) => {
32
- if (s.startsWith('scheme')) {
33
- let scheme = s.split('=')[1];
34
- this.path = scheme + '://' + host;
35
- this.scheme = scheme;
36
- } else if (s.startsWith('package')) {
37
- this.package = s.split('=')[1];
28
+ for (const arg of args) {
29
+ const [key, rawValue] = splitFirst(arg, '=');
30
+ const value =
31
+ rawValue === undefined ? undefined : decodeURIComponent(rawValue);
32
+ switch (key) {
33
+ case 'scheme':
34
+ if (value !== undefined) {
35
+ this.path = `${value}://${host}`;
36
+ this.scheme = value;
37
+ }
38
+ break;
39
+ case 'package':
40
+ this.package = value;
38
41
  }
39
- });
42
+ }
40
43
  } else {
41
44
  this.path = this.url;
42
45
  }
@@ -50,14 +53,13 @@ class IamportUrl {
50
53
  return this.url;
51
54
  }
52
55
 
53
- isPaymentOver(redirectUrl: string, data?: IMPData.PaymentData) {
56
+ isPaymentOver(redirectUrl: string, data?: IMPData.PaymentData): boolean {
54
57
  if (this.url.startsWith(redirectUrl)) {
55
58
  return true;
56
59
  }
57
60
 
58
61
  if (data?.pay_method === 'trans') {
59
- const decodeUrl = decodeURIComponent(this.url);
60
- const parsedUrl = queryString.parse(decodeUrl);
62
+ const searchParams = new URLSearchParams(extractQuery(this.url));
61
63
  const scheme = data?.app_scheme;
62
64
  /**
63
65
  * [IOS] 웹 표준 이니시스 - 실시간 계좌이체 대비
@@ -72,17 +74,17 @@ class IamportUrl {
72
74
  * 이를 위한 isInicisTransPaid 플래그 추가
73
75
  */
74
76
  if (data.pg.startsWith('html5_inicis') && Platform.OS === 'ios') {
75
- const query = parsedUrl;
76
77
  if (
77
- query.m_redirect_url !== null &&
78
+ searchParams.has('m_redirect_url') &&
78
79
  scheme === data.app_scheme?.toLowerCase()
79
80
  ) {
80
- if ((query.m_redirect_url as string | null)?.includes(redirectUrl)) {
81
+ if (searchParams.get('m_redirect_url')?.includes(redirectUrl)) {
81
82
  return true;
82
83
  }
83
84
  }
84
85
  }
85
86
  }
87
+ return false;
86
88
  }
87
89
 
88
90
  isAppUrl() {
@@ -333,12 +335,15 @@ class IamportUrl {
333
335
  }
334
336
 
335
337
  getQuery() {
336
- return queryString.parse(this.getStringifiedQuery());
338
+ return Object.fromEntries(
339
+ new URLSearchParams(this.getStringifiedQuery()).entries()
340
+ );
337
341
  }
338
342
 
339
343
  getStringifiedQuery() {
340
- const decodedUrl = decodeURIComponent(this.url);
341
- return queryString.extract(decodedUrl);
344
+ const query = extractQuery(this.url);
345
+ if (query === undefined) return undefined;
346
+ return decodeQueryParam(query);
342
347
  }
343
348
 
344
349
  getInicisTransQuery(redirectUrl: string) {
@@ -368,4 +373,27 @@ class IamportUrl {
368
373
  }
369
374
  }
370
375
 
376
+ function splitFirst(
377
+ text: string,
378
+ delimiter: string
379
+ ): [string] | [string, string] {
380
+ const index = text.indexOf(delimiter);
381
+ if (index === -1) return [text];
382
+ return [text.slice(0, index), text.slice(index + delimiter.length)];
383
+ }
384
+
385
+ // PG사 URL은 표준적인 URL이 아닐 수 있다.
386
+ function extractQuery(url: string): string | undefined {
387
+ const hashIndex = url.indexOf('#');
388
+ const beforeHash = hashIndex === -1 ? url : url.slice(0, hashIndex);
389
+ const queryIndex = beforeHash.indexOf('?');
390
+ if (queryIndex === -1) return undefined;
391
+ return beforeHash.slice(queryIndex);
392
+ }
393
+
394
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#decoding_query_parameters_from_a_url
395
+ function decodeQueryParam(query: string): string {
396
+ return decodeURIComponent(query.replaceAll('+', ' '));
397
+ }
398
+
371
399
  export default IamportUrl;
@@ -1,98 +0,0 @@
1
- version: 2.1
2
-
3
- executors:
4
- default:
5
- docker:
6
- - image: circleci/node:10
7
- working_directory: ~/project
8
-
9
- commands:
10
- attach_project:
11
- steps:
12
- - attach_workspace:
13
- at: ~/project
14
-
15
- jobs:
16
- install-dependencies:
17
- executor: default
18
- steps:
19
- - checkout
20
- - attach_project
21
- - restore_cache:
22
- keys:
23
- - dependencies-{{ checksum "package.json" }}
24
- - dependencies-
25
- - restore_cache:
26
- keys:
27
- - dependencies-example-{{ checksum "example/package.json" }}
28
- - dependencies-example-
29
- - run:
30
- name: Install dependencies
31
- command: |
32
- yarn install --cwd example --frozen-lockfile
33
- yarn install --frozen-lockfile
34
- - save_cache:
35
- key: dependencies-{{ checksum "package.json" }}
36
- paths: node_modules
37
- - save_cache:
38
- key: dependencies-example-{{ checksum "example/package.json" }}
39
- paths: example/node_modules
40
- - persist_to_workspace:
41
- root: .
42
- paths: .
43
-
44
- lint:
45
- executor: default
46
- steps:
47
- - attach_project
48
- - run:
49
- name: Lint files
50
- command: |
51
- yarn lint
52
-
53
- typescript:
54
- executor: default
55
- steps:
56
- - attach_project
57
- - run:
58
- name: Typecheck files
59
- command: |
60
- yarn typescript
61
-
62
- unit-tests:
63
- executor: default
64
- steps:
65
- - attach_project
66
- - run:
67
- name: Run unit tests
68
- command: |
69
- yarn test --coverage
70
- - store_artifacts:
71
- path: coverage
72
- destination: coverage
73
-
74
- build-package:
75
- executor: default
76
- steps:
77
- - attach_project
78
- - run:
79
- name: Build package
80
- command: |
81
- yarn prepare
82
-
83
- workflows:
84
- build-and-test:
85
- jobs:
86
- - install-dependencies
87
- - lint:
88
- requires:
89
- - install-dependencies
90
- - typescript:
91
- requires:
92
- - install-dependencies
93
- - unit-tests:
94
- requires:
95
- - install-dependencies
96
- - build-package:
97
- requires:
98
- - install-dependencies
package/.editorconfig DELETED
@@ -1,15 +0,0 @@
1
- # EditorConfig helps developers define and maintain consistent
2
- # coding styles between different editors and IDEs
3
- # editorconfig.org
4
-
5
- root = true
6
-
7
- [*]
8
-
9
- indent_style = space
10
- indent_size = 2
11
-
12
- end_of_line = lf
13
- charset = utf-8
14
- trim_trailing_whitespace = true
15
- insert_final_newline = true
package/.gitattributes DELETED
@@ -1,3 +0,0 @@
1
- *.pbxproj -text
2
- # specific for windows script files
3
- *.bat text eol=crlf
package/.gitignore DELETED
@@ -1,69 +0,0 @@
1
- # OSX
2
- #
3
- .DS_Store
4
-
5
- # XDE
6
- .expo/
7
-
8
- # VSCode
9
- .vscode/
10
- jsconfig.json
11
-
12
- # Xcode
13
- #
14
- build/
15
- *.pbxuser
16
- !default.pbxuser
17
- *.mode1v3
18
- !default.mode1v3
19
- *.mode2v3
20
- !default.mode2v3
21
- *.perspectivev3
22
- !default.perspectivev3
23
- xcuserdata
24
- *.xccheckout
25
- *.moved-aside
26
- DerivedData
27
- *.hmap
28
- *.ipa
29
- *.xcuserstate
30
- project.xcworkspace
31
-
32
- # Android/IJ
33
- #
34
- .idea
35
- .gradle
36
- local.properties
37
- android.iml
38
-
39
- # Cocoapods
40
- #
41
- example/ios/Pods
42
-
43
- # node.js
44
- #
45
- node_modules/
46
- npm-debug.log
47
- yarn-debug.log
48
- yarn-error.log
49
-
50
- # BUCK
51
- buck-out/
52
- \.buckd/
53
- android/app/libs
54
- android/keystores/debug.keystore
55
-
56
- # Expo
57
- .expo/*
58
-
59
- # generated by bob
60
- lib/
61
-
62
- # yarn
63
- .yarn/*
64
- !.yarn/cache
65
- !.yarn/patches
66
- !.yarn/plugins
67
- !.yarn/releases
68
- !.yarn/sdks
69
- !.yarn/versions
package/.yarnrc DELETED
@@ -1,3 +0,0 @@
1
- # Override Yarn command so we can automatically setup the repo on running `yarn`
2
-
3
- yarn-path "scripts/bootstrap.js"
package/.yarnrc.yml DELETED
@@ -1 +0,0 @@
1
- nodeLinker: node-modules
File without changes
@@ -1,2 +0,0 @@
1
- #Thu Feb 13 15:06:16 KST 2025
2
- gradle.version=8.9
File without changes