diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index df4ad57..61e4fc7 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -31,7 +31,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'corretto' - java-version: '11' + java-version: '17' - name: Install Maestro CLI run: curl -Ls "https://get.maestro.mobile.dev" | bash @@ -102,7 +102,7 @@ jobs: restore-keys: | ${{ runner.os }}-node- - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: example/ios/Pods key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index c7e522f..5ba7954 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v3 - name: Cache Tyro Pay API React Native - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | **/node_modules @@ -28,6 +28,10 @@ jobs: restore-keys: | ${{ runner.os }}-tyro- + - name: Pod clear cache + run: | + pod cache clean --all + - name: Install dependencies, lint and jest test run: | chmod +x ./.ci_steps/test.sh @@ -50,7 +54,7 @@ jobs: uses: actions/checkout@v3 - name: Cache Tyro Pay API React Native - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | **/node_modules @@ -59,6 +63,10 @@ jobs: restore-keys: | ${{ runner.os }}-tyro- + - name: Pod clear cache + run: | + pod cache clean --all + - name: Install React Native CLI run: npm install react-native-cli @@ -80,7 +88,7 @@ jobs: uses: actions/checkout@v3 - name: Cache Tyro Pay API React Native - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | **/node_modules @@ -90,7 +98,7 @@ jobs: ${{ runner.os }}-tyro- - name: Gradle cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.gradle/caches diff --git a/example/ios/Podfile b/example/ios/Podfile index 75a108b..f4ff114 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -30,6 +30,17 @@ if linkage != nil use_frameworks! :linkage => linkage.to_sym end +# Custom script to update boost.podspec source URL +boost_podspec_path = File.join(__dir__, '../node_modules/react-native/third-party-podspecs/boost.podspec') +if File.exist?(boost_podspec_path) + boost_podspec = File.read(boost_podspec_path) + updated_boost_podspec = boost_podspec.gsub( + 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2', + 'https://archives.boost.io/release/1.76.0/source/boost_1_76_0.tar.bz2' + ) + File.write(boost_podspec_path, updated_boost_podspec) +end + target 'example' do config = use_native_modules! diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 45268fc..1f4cee4 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,7 +1,7 @@ PODS: - boost (1.76.0) - DoubleConversion (1.1.6) - - Factory (2.4.1) + - Factory (2.4.3) - FBLazyVector (0.72.7) - FBReactNativeSpec (0.72.7): - RCT-Folly (= 2021.07.22.00) @@ -439,11 +439,11 @@ PODS: - React-Core - SocketRocket (0.6.1) - SwiftyBeaver (2.1.1) - - tyro-pay-api-react-native (1.0.1): + - tyro-pay-api-react-native (1.0.2): - RCT-Folly (= 2021.07.22.00) - React-Core - - TyroApplePay (= 0.0.4) - - TyroApplePay (0.0.4): + - TyroApplePay (= 1.0.0) + - TyroApplePay (1.0.0): - Factory - SwiftyBeaver - Yoga (1.14.0) @@ -598,38 +598,38 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - boost: 57d2868c099736d80fcd648bf211b4431e51a558 + boost: 7dcd2de282d72e344012f7d6564d024930a6a440 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 - Factory: 13e63ac988c73f13c55c251b0748a9518e078710 + Factory: 9d20d8cb56fc44b341d6dad1cf67dc93e9ae7788 FBLazyVector: 5fbbff1d7734827299274638deb8ba3024f6c597 FBReactNativeSpec: 638095fe8a01506634d77b260ef8a322019ac671 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b hermes-engine: 9180d43df05c1ed658a87cc733dc3044cf90c00a libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 - RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 + RCT-Folly: 8dc08ca5a393b48b1c523ab6220dfdcc0fe000ad RCTRequired: 83bca1c184feb4d2e51c72c8369b83d641443f95 RCTTypeSafety: 13c4a87a16d7db6cd66006ce9759f073402ef85b React: e67aa9f99957c7611c392b5e49355d877d6525e2 React-callinvoker: 2790c09d964c2e5404b5410cde91b152e3746b7b - React-Codegen: e6e05e105ca7cdb990f4d609985a2a689d8d0653 - React-Core: 9283f1e7d0d5e3d33ad298547547b1b43912534c - React-CoreModules: 6312c9b2fec4329d9ae6a2b8c350032d1664c51b - React-cxxreact: 7da72565656c8ac7f97c9a031d0b199bbdec0640 + React-Codegen: 89173b1974099c3082e50c83e9d04113ede45792 + React-Core: 27990a32ca0cfc04872600440f618365b7c35433 + React-CoreModules: 2a1850a46d60b901cceef4e64bcf5bf6a0130206 + React-cxxreact: 03d370d58a083a1c8b5a69b9095c1ac9f57b2f94 React-debug: 4accb2b9dc09b575206d2c42f4082990a52ae436 - React-hermes: 1299a94f255f59a72d5baa54a2ca2e1eee104947 - React-jsi: 2208de64c3a41714ac04e86975386fc49116ea13 - React-jsiexecutor: c49502e5d02112247ee4526bc3ccfc891ae3eb9b + React-hermes: 0a9e25fbf4dbcd8ca89de9a89a0cce2fce45989f + React-jsi: 0c473d4292f9a10469b3755767bf28d0b35fbeb6 + React-jsiexecutor: 00fdf7bd0e99ab878109ce1b51cb6212d76683e4 React-jsinspector: 8baadae51f01d867c3921213a25ab78ab4fbcd91 - React-logger: 8edc785c47c8686c7962199a307015e2ce9a0e4f - react-native-safe-area-context: dcab599c527c2d7de2d76507a523d20a0b83823d - react-native-webview: 4e7d637b43eddec107016d316ae75f7063a3075c - React-NativeModulesApple: b6868ee904013a7923128892ee4a032498a1024a + React-logger: 61efd44da84482aabbbbb478a49b893c7c912f99 + react-native-safe-area-context: 8c70551c8688cd584a53487aa1b9361e991a3b4a + react-native-webview: 6ef00afa766bf2d4cc6c2705be3add7b38d604f3 + React-NativeModulesApple: 2f7a355e9b4c83b9509bf6dd798dc5f63ab8bc7d React-perflogger: 31ea61077185eb1428baf60c0db6e2886f141a5a React-RCTActionSheet: 392090a3abc8992eb269ef0eaa561750588fc39d React-RCTAnimation: 4b3cc6a29474bc0d78c4f04b52ab59bf760e8a9b - React-RCTAppDelegate: 89b015b29885109addcabecdf3b2e833905437c7 - React-RCTBlob: 3e23dcbe6638897b5605e46d0d62955d78e8d27b + React-RCTAppDelegate: b6febbe1109554fee87d3fea1c50cca511429fec + React-RCTBlob: 76113160e3cdc0f678795823c1a7c9d69b2db099 React-RCTImage: 8a5d339d614a90a183fc1b8b6a7eb44e2e703943 React-RCTLinking: b37dfbf646d77c326f9eae094b1fcd575b1c24c7 React-RCTNetwork: 8bed9b2461c7d8a7d14e63df9b16181c448beebc @@ -638,17 +638,17 @@ SPEC CHECKSUMS: React-RCTVibration: d1b78ca38f61ea4b3e9ebb2ddbd0b5662631d99b React-rncore: bfc2f6568b6fecbae6f2f774e95c60c3c9e95bf2 React-runtimeexecutor: 47b0a2d5bbb416db65ef881a6f7bdcfefa0001ab - React-runtimescheduler: 7649c3b46c8dee1853691ecf60146a16ae59253c - React-utils: 56838edeaaf651220d1e53cd0b8934fb8ce68415 - ReactCommon: 5f704096ccf7733b390f59043b6fa9cc180ee4f6 - RNScreens: 93ae3be2f119d955620f9bbb39ad372adb53b7a9 - RNSVG: ba3e7232f45e34b7b47e74472386cf4e1a676d0a + React-runtimescheduler: d12a963f61390fcd1b957a9c9ebee3c0f775dede + React-utils: 22f94a6e85b1323ffb1b9a747a1c03c5e6eaead6 + ReactCommon: ef602e9cfb8940ad7c08aa4cdc228d802e194e5c + RNScreens: 448026fcd1beb88770b0a67a871a3d1bf9cdde0a + RNSVG: 6d5ed33b6635ed6d6ecb50744dcf127580c39ed5 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 SwiftyBeaver: ade157e4f857812e7d7f15f2e3396bb8733f8a1c - tyro-pay-api-react-native: 07517cf983e2b37b13b00851aaf8782a650e71ed - TyroApplePay: eadbfb8c857581decafb598cdea474d39a278628 + tyro-pay-api-react-native: 1f0b713a4171442686ef9e9d7fd23ffe46aa8c95 + TyroApplePay: ac775ba6a496cb2a89816f0ccee8a4515b321851 Yoga: 4c3aa327e4a6a23eeacd71f61c81df1bcdf677d5 -PODFILE CHECKSUM: 03ca4465b98fb613cb7475b82d91f9b5868b250e +PODFILE CHECKSUM: 8bcc1b808214f11bdc1a3c6c79b0c5bf4213233e -COCOAPODS: 1.15.2 +COCOAPODS: 1.16.2 diff --git a/example/ios/example.xcodeproj/project.pbxproj b/example/ios/example.xcodeproj/project.pbxproj index 9d1339a..64ef9f1 100644 --- a/example/ios/example.xcodeproj/project.pbxproj +++ b/example/ios/example.xcodeproj/project.pbxproj @@ -11,10 +11,10 @@ 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 2B330D28D6459D1DF44DEED4 /* libPods-example-exampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 60746095885B27A651766AD3 /* libPods-example-exampleTests.a */; }; - 469777D5C48FEAC326413A5A /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EEC060BFEB9D07B712937727 /* libPods-example.a */; }; + 19C87C35FAC4CACB1D27C879 /* libPods-example-exampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C271B2A870873A89F6E4DC1F /* libPods-example-exampleTests.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 9BDC11AC2B9EBFFD003033F6 /* tyroPayApiReactNativeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BDC11452B9ADE4D003033F6 /* tyroPayApiReactNativeTests.swift */; }; + B947CD493D52F456D19F5C66 /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 81785AAC8A42C5C79CD4738B /* libPods-example.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -35,6 +35,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 0084F2F8AB770D21549FFC11 /* Pods-example-exampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-exampleTests.debug.xcconfig"; path = "Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests.debug.xcconfig"; sourceTree = ""; }; 00E356EE1AD99517003FC87E /* exampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = exampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 00E356F21AD99517003FC87E /* exampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = exampleTests.m; sourceTree = ""; }; @@ -44,18 +45,17 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = ""; }; - 3B4392A12AC88292D35C810B /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = ""; }; - 5709B34CF0A7D63546082F79 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = ""; }; - 5B7EB9410499542E8C5724F5 /* Pods-example-exampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-exampleTests.debug.xcconfig"; path = "Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests.debug.xcconfig"; sourceTree = ""; }; - 60746095885B27A651766AD3 /* libPods-example-exampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example-exampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 6BB8A234BB94BC7EA098045F /* Pods-example-exampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-exampleTests.release.xcconfig"; path = "Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests.release.xcconfig"; sourceTree = ""; }; + 81785AAC8A42C5C79CD4738B /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = example/LaunchScreen.storyboard; sourceTree = ""; }; - 89C6BE57DB24E9ADA2F236DE /* Pods-example-exampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-exampleTests.release.xcconfig"; path = "Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests.release.xcconfig"; sourceTree = ""; }; 8BF259462BAD297600B83F2C /* example.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = example.entitlements; path = example/example.entitlements; sourceTree = ""; }; 8BF259472BB1131000B83F2C /* example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "example-Bridging-Header.h"; sourceTree = ""; }; 9BDC11432B9ADE4D003033F6 /* tyroPayApiReactNativeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = tyroPayApiReactNativeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 9BDC11452B9ADE4D003033F6 /* tyroPayApiReactNativeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = tyroPayApiReactNativeTests.swift; sourceTree = ""; }; + A11C4715D36CD3A816FA6B6D /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = ""; }; + C271B2A870873A89F6E4DC1F /* libPods-example-exampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example-exampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + D5DBBB4DA7247207F9D7383E /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; - EEC060BFEB9D07B712937727 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -63,7 +63,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2B330D28D6459D1DF44DEED4 /* libPods-example-exampleTests.a in Frameworks */, + 19C87C35FAC4CACB1D27C879 /* libPods-example-exampleTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -71,7 +71,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 469777D5C48FEAC326413A5A /* libPods-example.a in Frameworks */, + B947CD493D52F456D19F5C66 /* libPods-example.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -121,8 +121,8 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - EEC060BFEB9D07B712937727 /* libPods-example.a */, - 60746095885B27A651766AD3 /* libPods-example-exampleTests.a */, + 81785AAC8A42C5C79CD4738B /* libPods-example.a */, + C271B2A870873A89F6E4DC1F /* libPods-example-exampleTests.a */, ); name = Frameworks; sourceTree = ""; @@ -171,10 +171,10 @@ BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( - 3B4392A12AC88292D35C810B /* Pods-example.debug.xcconfig */, - 5709B34CF0A7D63546082F79 /* Pods-example.release.xcconfig */, - 5B7EB9410499542E8C5724F5 /* Pods-example-exampleTests.debug.xcconfig */, - 89C6BE57DB24E9ADA2F236DE /* Pods-example-exampleTests.release.xcconfig */, + A11C4715D36CD3A816FA6B6D /* Pods-example.debug.xcconfig */, + D5DBBB4DA7247207F9D7383E /* Pods-example.release.xcconfig */, + 0084F2F8AB770D21549FFC11 /* Pods-example-exampleTests.debug.xcconfig */, + 6BB8A234BB94BC7EA098045F /* Pods-example-exampleTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -186,12 +186,12 @@ isa = PBXNativeTarget; buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "exampleTests" */; buildPhases = ( - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, + 5B32AF4C3EAD8FDC35DF81E7 /* [CP] Check Pods Manifest.lock */, 00E356EA1AD99517003FC87E /* Sources */, 00E356EB1AD99517003FC87E /* Frameworks */, 00E356EC1AD99517003FC87E /* Resources */, - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */, - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, + F749A8F3DC156B4727D44FD6 /* [CP] Embed Pods Frameworks */, + C8E9098317538CBFD1B841DC /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -207,14 +207,14 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */; buildPhases = ( - C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, + 80C802F6E61233536C09DDDF /* [CP] Check Pods Manifest.lock */, FD10A7F022414F080027D42C /* Start Packager */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, - E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, + 717D9884E2132C4A5ADBEA4D /* [CP] Embed Pods Frameworks */, + 70AC244B5D86E70FC17F7235 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -328,24 +328,7 @@ shellPath = /bin/sh; shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; }; - 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { + 5B32AF4C3EAD8FDC35DF81E7 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -367,63 +350,63 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { + 70AC244B5D86E70FC17F7235 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-example-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\"\n"; showEnvVarsInLog = 0; }; - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = { + 717D9884E2132C4A5ADBEA4D /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { + 80C802F6E61233536C09DDDF /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-example-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { + C8E9098317538CBFD1B841DC /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -440,6 +423,23 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; + F749A8F3DC156B4727D44FD6 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; FD10A7F022414F080027D42C /* Start Packager */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -505,7 +505,7 @@ /* Begin XCBuildConfiguration section */ 00E356F61AD99517003FC87E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-example-exampleTests.debug.xcconfig */; + baseConfigurationReference = 0084F2F8AB770D21549FFC11 /* Pods-example-exampleTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; DEVELOPMENT_TEAM = AP4UA2XZ78; @@ -538,7 +538,7 @@ }; 00E356F71AD99517003FC87E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-example-exampleTests.release.xcconfig */; + baseConfigurationReference = 6BB8A234BB94BC7EA098045F /* Pods-example-exampleTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; @@ -568,7 +568,7 @@ }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-example.debug.xcconfig */; + baseConfigurationReference = A11C4715D36CD3A816FA6B6D /* Pods-example.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -605,7 +605,7 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-example.release.xcconfig */; + baseConfigurationReference = D5DBBB4DA7247207F9D7383E /* Pods-example.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; diff --git a/example/package-lock.json b/example/package-lock.json index b81afb7..327cc76 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -41,7 +41,7 @@ }, "..": { "name": "@tyro/tyro-pay-api-react-native", - "version": "1.0.1", + "version": "1.0.2", "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", diff --git a/example/src/App.tsx b/example/src/App.tsx index bbb2117..93045c8 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -46,6 +46,7 @@ function App(): JSX.Element { applePay: { enabled: true, merchantIdentifier: 'merchant.tyro-pay-api-sample-app', + totalLabel: 'Example (Via Merchant Restaurant)', }, }, styleProps: { diff --git a/ios/TyroPaySdkModule.swift b/ios/TyroPaySdkModule.swift index 24d0305..a245b3b 100644 --- a/ios/TyroPaySdkModule.swift +++ b/ios/TyroPaySdkModule.swift @@ -41,6 +41,7 @@ class TyroPaySdkModule: RCTEventEmitter { return } let merchantIdentifier: String = try getConfigParamOrThrow("merchantIdentifier", configs, "Merchant Identifier is required") + let merchantName: String = try getConfigParamOrThrow("totalLabel", configs, "Merchant Name is required") let allowedCardNetworks: [String] = try getConfigParamOrThrow("supportedNetworks", configs, "Supported Networks is require") let paymentNetworks: [TyroApplePayCardNetwork] = try self.mapSupportedNetworkStringsToTyroApplePayCardNetwork(allowedCardNetworks) @@ -48,7 +49,9 @@ class TyroPaySdkModule: RCTEventEmitter { merchantIdentifier: merchantIdentifier, allowedCardNetworks: paymentNetworks ) - self.tyroApplePay = TyroApplePay(config: config) + self.tyroApplePay = TyroApplePay(config: config, layout: TyroApplePay.Layout( + merchantName: merchantName + )) resolve(true) } catch { print(error) diff --git a/package.json b/package.json index ffd38e5..640424d 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "android:release": "cd example && react-native run-android --mode=release", "ios:release": "cd example && react-native run-ios --mode Release --simulator \"iPhone 15 Pro\"", "install:all": "npm run install:no-pods && npm run install:pods && npm run prepack", - "install:pods": "cd example/ios && pod install", + "install:pods": "cd example/ios && pod cache clean --all && pod install --verbose", "install:no-pods": "npm install && cd example && npm install", "gradlew:build:all": "npm run gradlew:build:sdk && npm run gradlew:build:example", "gradlew:build:example": "cd example/android && chmod +x ./gradlew && ./gradlew --no-daemon -S -Dorg.gradle.dependency.verification=off clean build", diff --git a/src/@types/definitions.ts b/src/@types/definitions.ts index 7469cc6..baf7698 100644 --- a/src/@types/definitions.ts +++ b/src/@types/definitions.ts @@ -33,12 +33,14 @@ export type TyroPayOptionsProps = { export enum TyroPayApplePayOptionKeys { enabled = 'enabled', merchantIdentifier = 'merchantIdentifier', + totalLabel = 'totalLabel', supportedNetworks = 'supportedNetworks', } export type TyroPayApplePayOptions = { [TyroPayApplePayOptionKeys.enabled]?: boolean; [TyroPayApplePayOptionKeys.merchantIdentifier]?: string; + [TyroPayApplePayOptionKeys.totalLabel]?: string; [TyroPayApplePayOptionKeys.supportedNetworks]?: SupportedNetworksApplePay[]; }; diff --git a/src/SDKSharedContext.tsx b/src/SDKSharedContext.tsx index be44383..8bb2485 100644 --- a/src/SDKSharedContext.tsx +++ b/src/SDKSharedContext.tsx @@ -56,7 +56,8 @@ const SDKProvider = ({ children, tyroProvider }: SDKContext): JSX.Element => { walletPaymentResult: WalletPaymentResult ): Promise => { // TODO: Find a way to remove this conditional - const { status, error } = typeof walletPaymentResult === 'string' ? JSON.parse(walletPaymentResult) : walletPaymentResult; + const { status, error } = + typeof walletPaymentResult === 'string' ? JSON.parse(walletPaymentResult) : walletPaymentResult; if (error) { const { errorMessage: message, errorType: type, errorCode, gatewayCode } = error; setTyroErrorMessage(errorMessage({ type, message }, errorCode, gatewayCode)); diff --git a/src/clients/three-d-secure-client.ts b/src/clients/three-d-secure-client.ts index 41823e7..3e35c00 100644 --- a/src/clients/three-d-secure-client.ts +++ b/src/clients/three-d-secure-client.ts @@ -41,7 +41,9 @@ export const pollFor3DSecureChallengeAndFinalResult = async ( // poll for 10 mins const updatedPayRequest = await pollForResult( paySecret, - (payRequestStatus) => COMPLETION_STATUSES.includes(payRequestStatus.status), + (payRequestStatus) => + COMPLETION_STATUSES.includes(payRequestStatus.status) || + payRequestStatus.threeDSecure?.status === ThreeDSecureStatus.FAILED, CHALLENGE_POLL_INTERVAL_MS, CHALLENGE_MAX_RETRIES ); diff --git a/src/tests/PaySheet.spec.tsx b/src/tests/PaySheet.spec.tsx index 9ec3c4c..2ed3829 100644 --- a/src/tests/PaySheet.spec.tsx +++ b/src/tests/PaySheet.spec.tsx @@ -46,6 +46,7 @@ jest.mock('../@types/images.tsx', () => { const merchantIdentifier = 'merId'; const merchantName = 'merName'; const cardDeclined = 'Card Declined'; +const appleTotalLabel = 'Total Label'; const renderWithProvider = async (component, options: TyroPayOptionsProps): Promise => { return render({component}); @@ -1299,6 +1300,7 @@ describe('PaySheet', () => { applePay: { enabled: true, merchantIdentifier, + totalLabel: appleTotalLabel, supportedNetworks: ['visa'], }, }, @@ -1323,6 +1325,7 @@ describe('PaySheet', () => { applePay: { enabled: true, merchantIdentifier, + totalLabel: appleTotalLabel, }, }, styleProps: { walletPaymentsDividerText: 'My Custom Divider Text', showSupportedCards: false }, @@ -1346,6 +1349,7 @@ describe('PaySheet', () => { applePay: { enabled: true, merchantIdentifier, + totalLabel: appleTotalLabel, }, }, styleProps: { walletPaymentsDividerEnabled: false, showSupportedCards: false }, diff --git a/src/tests/integration/android/paysheet-card-cancelled-challenge.yml b/src/tests/integration/android/paysheet-card-cancelled-challenge.yml deleted file mode 100644 index 3e7c6a8..0000000 --- a/src/tests/integration/android/paysheet-card-cancelled-challenge.yml +++ /dev/null @@ -1,39 +0,0 @@ -appId: ${APP_ID} ---- -- launchApp -- assertVisible: "Tyro Pay Demo" -- tapOn: "+" -- tapOn: "checkout" -- extendedWaitUntil: - visible: "Or pay with card" - timeout: 150000 -- tapOn: - text: "Card number" -- inputText: "4111111111112002" -- tapOn: - text: "Name on card" -- inputText: "ABC" -- tapOn: "CheckOut" -- tapOn: - text: "MM/YY" -- inputText: "0125" -- tapOn: - text: "CVV" -- inputText: "123" -- tapOn: "CheckOut" -- scrollUntilVisible: - element: - id: "pay-button" - direction: DOWN -- tapOn: - id: "pay-button" -- extendedWaitUntil: - visible: "Enter Your Authentication Data" - timeout: 150000 -- tapOn: - text: "Cancel" -- extendedWaitUntil: - visible: "ErrorType: PAY_REQUEST_ERROR" - timeout: 150000 -- assertVisible: "ErrorCode: THREED_SECURE_FAILED" -- assertVisible: "ErrorMessage: There was an error with the pay request, either validation error or payment failed." diff --git a/src/tests/integration/android/paysheet-card-success-challenge.yml b/src/tests/integration/android/paysheet-card-success-challenge.yml index 8e86ee9..14a6bb0 100644 --- a/src/tests/integration/android/paysheet-card-success-challenge.yml +++ b/src/tests/integration/android/paysheet-card-success-challenge.yml @@ -16,7 +16,7 @@ appId: ${APP_ID} - tapOn: "CheckOut" - tapOn: text: "MM/YY" -- inputText: "0125" +- inputText: "01/99" - tapOn: text: "CVV" - inputText: "123" diff --git a/src/tests/integration/ios/local-only/paysheet-card-cancelled-challenge.yml b/src/tests/integration/ios/local-only/paysheet-card-cancelled-challenge.yml index 3e7c6a8..f44aede 100644 --- a/src/tests/integration/ios/local-only/paysheet-card-cancelled-challenge.yml +++ b/src/tests/integration/ios/local-only/paysheet-card-cancelled-challenge.yml @@ -16,7 +16,7 @@ appId: ${APP_ID} - tapOn: "CheckOut" - tapOn: text: "MM/YY" -- inputText: "0125" +- inputText: "01/99" - tapOn: text: "CVV" - inputText: "123" diff --git a/src/tests/integration/ios/local-only/paysheet-card-success-challenge.yml b/src/tests/integration/ios/local-only/paysheet-card-success-challenge.yml index 8e86ee9..14a6bb0 100644 --- a/src/tests/integration/ios/local-only/paysheet-card-success-challenge.yml +++ b/src/tests/integration/ios/local-only/paysheet-card-success-challenge.yml @@ -16,7 +16,7 @@ appId: ${APP_ID} - tapOn: "CheckOut" - tapOn: text: "MM/YY" -- inputText: "0125" +- inputText: "01/99" - tapOn: text: "CVV" - inputText: "123" diff --git a/src/tests/integration/paysheet-card-declined.yml b/src/tests/integration/paysheet-card-declined.yml index d4e72d5..5ac16b1 100644 --- a/src/tests/integration/paysheet-card-declined.yml +++ b/src/tests/integration/paysheet-card-declined.yml @@ -16,7 +16,7 @@ appId: ${APP_ID} - tapOn: "CheckOut" - tapOn: text: "MM/YY" -- inputText: "0125" +- inputText: "01/99" - tapOn: text: "CVV" - inputText: "123" diff --git a/src/tests/integration/paysheet-card-failed-frictionless.yml b/src/tests/integration/paysheet-card-failed-frictionless.yml deleted file mode 100644 index 3512c44..0000000 --- a/src/tests/integration/paysheet-card-failed-frictionless.yml +++ /dev/null @@ -1,34 +0,0 @@ -appId: ${APP_ID} ---- -- launchApp -- assertVisible: "Tyro Pay Demo" -- tapOn: "+" -- tapOn: "checkout" -- extendedWaitUntil: - visible: "Or pay with card" - timeout: 150000 -- tapOn: - text: "Card number" -- inputText: "4111111111112028" -- tapOn: - text: "Name on card" -- inputText: "ABC" -- tapOn: "CheckOut" -- tapOn: - text: "MM/YY" -- inputText: "0125" -- tapOn: - text: "CVV" -- inputText: "123" -- tapOn: "CheckOut" -- scrollUntilVisible: - element: - id: "pay-button" - direction: DOWN -- tapOn: - id: "pay-button" -- extendedWaitUntil: - visible: "ErrorType: PAY_REQUEST_ERROR" - timeout: 150000 -- assertVisible: "ErrorCode: THREED_SECURE_FAILED" -- assertVisible: "ErrorMessage: There was an error with the pay request, either validation error or payment failed." diff --git a/src/tests/integration/paysheet-card-success-frictionless.yml b/src/tests/integration/paysheet-card-success-frictionless.yml index 53c0906..989fdb0 100644 --- a/src/tests/integration/paysheet-card-success-frictionless.yml +++ b/src/tests/integration/paysheet-card-success-frictionless.yml @@ -16,7 +16,7 @@ appId: ${APP_ID} - tapOn: "CheckOut" - tapOn: text: "MM/YY" -- inputText: "0125" +- inputText: "01/99" - tapOn: text: "CVV" - inputText: "123" diff --git a/src/tests/integration/paysheet-card-success-mastercard.yml b/src/tests/integration/paysheet-card-success-mastercard.yml index 283064b..564eaac 100644 --- a/src/tests/integration/paysheet-card-success-mastercard.yml +++ b/src/tests/integration/paysheet-card-success-mastercard.yml @@ -16,7 +16,7 @@ appId: ${APP_ID} - tapOn: "CheckOut" - tapOn: text: "MM/YY" -- inputText: "0125" +- inputText: "01/99" - tapOn: text: "CVV" - inputText: "123" diff --git a/src/tests/integration/paysheet-card-success-visa.yml b/src/tests/integration/paysheet-card-success-visa.yml index 8f912ac..7d36186 100644 --- a/src/tests/integration/paysheet-card-success-visa.yml +++ b/src/tests/integration/paysheet-card-success-visa.yml @@ -16,7 +16,7 @@ appId: ${APP_ID} - tapOn: "CheckOut" - tapOn: text: "MM/YY" -- inputText: "0125" +- inputText: "01/99" - tapOn: text: "CVV" - inputText: "123" diff --git a/tyro-pay-api-react-native.podspec b/tyro-pay-api-react-native.podspec index 783997f..d97f66e 100644 --- a/tyro-pay-api-react-native.podspec +++ b/tyro-pay-api-react-native.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |s| # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79. if respond_to?(:install_modules_dependencies, true) install_modules_dependencies(s) - s.dependency "TyroApplePay", "0.0.4" + s.dependency "TyroApplePay", "1.0.0" else s.dependency "React-Core"