From a924de2d944fe9a0470f824955a34ae433b1d18d Mon Sep 17 00:00:00 2001 From: Tj Date: Mon, 22 Jun 2015 18:45:22 -0400 Subject: [PATCH 01/36] Initial commit --- .gitignore | 26 ++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 .gitignore create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c964cd8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,26 @@ +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control +# +#Pods/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..1eca6e7 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# react-native-paypal +Paypal wrapper for React Native From 63943ebec71546b3396c62224b29ccde8c936f4f Mon Sep 17 00:00:00 2001 From: Tj Date: Mon, 22 Jun 2015 18:52:20 -0400 Subject: [PATCH 02/36] Empty project --- .gitignore | 2 +- .gitmodules | 3 + ReactPaypal/.flowconfig | 36 + ReactPaypal/.gitignore | 28 + ReactPaypal/.npmignore | 27 + .../ReactPaypal.xcodeproj/project.pbxproj | 745 ++++++++++++++++++ .../xcschemes/ReactPaypal.xcscheme | 112 +++ ReactPaypal/ReactPaypalTests/Info.plist | 24 + .../ReactPaypalTests/ReactPaypalTests.m | 68 ++ ReactPaypal/iOS/AppDelegate.h | 16 + ReactPaypal/iOS/AppDelegate.m | 60 ++ ReactPaypal/iOS/Base.lproj/LaunchScreen.xib | 42 + .../AppIcon.appiconset/Contents.json | 38 + ReactPaypal/iOS/Info.plist | 42 + ReactPaypal/iOS/main.jsbundle | 8 + ReactPaypal/iOS/main.m | 18 + ReactPaypal/index.ios.js | 53 ++ ReactPaypal/lib/Paypal | 1 + ReactPaypal/package.json | 11 + 19 files changed, 1333 insertions(+), 1 deletion(-) create mode 100644 .gitmodules create mode 100644 ReactPaypal/.flowconfig create mode 100644 ReactPaypal/.gitignore create mode 100644 ReactPaypal/.npmignore create mode 100644 ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj create mode 100644 ReactPaypal/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme create mode 100644 ReactPaypal/ReactPaypalTests/Info.plist create mode 100644 ReactPaypal/ReactPaypalTests/ReactPaypalTests.m create mode 100644 ReactPaypal/iOS/AppDelegate.h create mode 100644 ReactPaypal/iOS/AppDelegate.m create mode 100644 ReactPaypal/iOS/Base.lproj/LaunchScreen.xib create mode 100644 ReactPaypal/iOS/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 ReactPaypal/iOS/Info.plist create mode 100644 ReactPaypal/iOS/main.jsbundle create mode 100644 ReactPaypal/iOS/main.m create mode 100644 ReactPaypal/index.ios.js create mode 160000 ReactPaypal/lib/Paypal create mode 100644 ReactPaypal/package.json diff --git a/.gitignore b/.gitignore index c964cd8..b04c94f 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ DerivedData *.hmap *.ipa *.xcuserstate - +node_modules/ # CocoaPods # # We recommend against adding the Pods directory to your .gitignore. However diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..617a2b1 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "ReactPaypal/lib/Paypal"] + path = ReactPaypal/lib/Paypal + url = git@github.com:paypal/PayPal-iOS-SDK.git diff --git a/ReactPaypal/.flowconfig b/ReactPaypal/.flowconfig new file mode 100644 index 0000000..a86e0f8 --- /dev/null +++ b/ReactPaypal/.flowconfig @@ -0,0 +1,36 @@ +[ignore] + +# We fork some components by platform. +.*/*.web.js +.*/*.android.js + +# Some modules have their own node_modules with overlap +.*/node_modules/node-haste/.* + +# Ignore react-tools where there are overlaps, but don't ignore anything that +# react-native relies on +.*/node_modules/react-tools/src/vendor/core/ExecutionEnvironment.js +.*/node_modules/react-tools/src/browser/eventPlugins/ResponderEventPlugin.js +.*/node_modules/react-tools/src/browser/ui/React.js +.*/node_modules/react-tools/src/core/ReactInstanceHandles.js +.*/node_modules/react-tools/src/event/EventPropagators.js + +# Ignore commoner tests +.*/node_modules/react-tools/node_modules/commoner/test/.* + +# See https://github.com/facebook/flow/issues/442 +.*/react-tools/node_modules/commoner/lib/reader.js + +# Ignore jest +.*/react-native/node_modules/jest-cli/.* + +[include] + +[libs] +node_modules/react-native/Libraries/react-native/react-native-interface.js + +[options] +module.system=haste + +[version] +0.11.0 diff --git a/ReactPaypal/.gitignore b/ReactPaypal/.gitignore new file mode 100644 index 0000000..b927355 --- /dev/null +++ b/ReactPaypal/.gitignore @@ -0,0 +1,28 @@ +# OSX +# +.DS_Store + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +project.xcworkspace + +# node.js +# +node_modules/ +npm-debug.log diff --git a/ReactPaypal/.npmignore b/ReactPaypal/.npmignore new file mode 100644 index 0000000..c39012e --- /dev/null +++ b/ReactPaypal/.npmignore @@ -0,0 +1,27 @@ +# OSX +# +.DS_Store + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate + +# node.js +# +node_modules/ +npm-debug.log diff --git a/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj b/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj new file mode 100644 index 0000000..a0a6768 --- /dev/null +++ b/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj @@ -0,0 +1,745 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 008F07F21AC5B25A0029DE68 /* main.jsbundle */; }; + 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; + 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; + 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; + 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; + 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; + 00E356F31AD99517003FC87E /* ReactPaypalTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ReactPaypalTests.m */; }; + 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; + 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; + 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; + 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; + 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; + 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; + 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RCTActionSheet; + }; + 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RCTGeolocation; + }; + 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5115D1A9E6B3D00147676; + remoteInfo = RCTImage; + }; + 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511DB1A9E6C8500147676; + remoteInfo = RCTNetwork; + }; + 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; + remoteInfo = RCTVibration; + }; + 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 13B07F861A680F5B00A75B9A; + remoteInfo = ReactPaypal; + }; + 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RCTSettings; + }; + 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3C86DF461ADF2C930047B81A; + remoteInfo = RCTWebSocket; + }; + 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; + remoteInfo = React; + }; + 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RCTLinking; + }; + 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5119B1A9E6C1200147676; + remoteInfo = RCTText; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = iOS/main.jsbundle; sourceTree = ""; }; + 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj; sourceTree = ""; }; + 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj; sourceTree = ""; }; + 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = node_modules/react-native/Libraries/Image/RCTImage.xcodeproj; sourceTree = ""; }; + 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj; sourceTree = ""; }; + 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj; sourceTree = ""; }; + 00E356EE1AD99517003FC87E /* ReactPaypalTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ReactPaypalTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 00E356F21AD99517003FC87E /* ReactPaypalTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactPaypalTests.m; sourceTree = ""; }; + 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj; sourceTree = ""; }; + 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj; sourceTree = ""; }; + 13B07F961A680F5B00A75B9A /* ReactPaypal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReactPaypal.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = iOS/AppDelegate.h; sourceTree = ""; }; + 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = iOS/AppDelegate.m; sourceTree = ""; }; + 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = iOS/Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = iOS/Info.plist; sourceTree = ""; }; + 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = iOS/main.m; sourceTree = ""; }; + 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = node_modules/react-native/React/React.xcodeproj; sourceTree = ""; }; + 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj; sourceTree = ""; }; + 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = node_modules/react-native/Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 00E356EB1AD99517003FC87E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 146834051AC3E58100842450 /* libReact.a in Frameworks */, + 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, + 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, + 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, + 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, + 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, + 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, + 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, + 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, + 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 00C302A81ABCB8CE00DB3ED1 /* Products */ = { + isa = PBXGroup; + children = ( + 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, + ); + name = Products; + sourceTree = ""; + }; + 00C302B61ABCB90400DB3ED1 /* Products */ = { + isa = PBXGroup; + children = ( + 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, + ); + name = Products; + sourceTree = ""; + }; + 00C302BC1ABCB91800DB3ED1 /* Products */ = { + isa = PBXGroup; + children = ( + 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, + ); + name = Products; + sourceTree = ""; + }; + 00C302D41ABCB9D200DB3ED1 /* Products */ = { + isa = PBXGroup; + children = ( + 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, + ); + name = Products; + sourceTree = ""; + }; + 00C302E01ABCB9EE00DB3ED1 /* Products */ = { + isa = PBXGroup; + children = ( + 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, + ); + name = Products; + sourceTree = ""; + }; + 00E356EF1AD99517003FC87E /* ReactPaypalTests */ = { + isa = PBXGroup; + children = ( + 00E356F21AD99517003FC87E /* ReactPaypalTests.m */, + 00E356F01AD99517003FC87E /* Supporting Files */, + ); + path = ReactPaypalTests; + sourceTree = ""; + }; + 00E356F01AD99517003FC87E /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 00E356F11AD99517003FC87E /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 139105B71AF99BAD00B5F7CC /* Products */ = { + isa = PBXGroup; + children = ( + 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, + ); + name = Products; + sourceTree = ""; + }; + 139FDEE71B06529A00C62182 /* Products */ = { + isa = PBXGroup; + children = ( + 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, + ); + name = Products; + sourceTree = ""; + }; + 13B07FAE1A68108700A75B9A /* ReactPaypal */ = { + isa = PBXGroup; + children = ( + 008F07F21AC5B25A0029DE68 /* main.jsbundle */, + 13B07FAF1A68108700A75B9A /* AppDelegate.h */, + 13B07FB01A68108700A75B9A /* AppDelegate.m */, + 13B07FB51A68108700A75B9A /* Images.xcassets */, + 13B07FB61A68108700A75B9A /* Info.plist */, + 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, + 13B07FB71A68108700A75B9A /* main.m */, + ); + name = ReactPaypal; + sourceTree = ""; + }; + 146834001AC3E56700842450 /* Products */ = { + isa = PBXGroup; + children = ( + 146834041AC3E56700842450 /* libReact.a */, + ); + name = Products; + sourceTree = ""; + }; + 78C398B11ACF4ADC00677621 /* Products */ = { + isa = PBXGroup; + children = ( + 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, + ); + name = Products; + sourceTree = ""; + }; + 832341AE1AAA6A7D00B99B32 /* Libraries */ = { + isa = PBXGroup; + children = ( + 146833FF1AC3E56700842450 /* React.xcodeproj */, + 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, + 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, + 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, + 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, + 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, + 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, + 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, + 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, + 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, + ); + name = Libraries; + sourceTree = ""; + }; + 832341B11AAA6A8300B99B32 /* Products */ = { + isa = PBXGroup; + children = ( + 832341B51AAA6A8300B99B32 /* libRCTText.a */, + ); + name = Products; + sourceTree = ""; + }; + 83CBB9F61A601CBA00E9B192 = { + isa = PBXGroup; + children = ( + 13B07FAE1A68108700A75B9A /* ReactPaypal */, + 832341AE1AAA6A7D00B99B32 /* Libraries */, + 00E356EF1AD99517003FC87E /* ReactPaypalTests */, + 83CBBA001A601CBA00E9B192 /* Products */, + ); + indentWidth = 2; + sourceTree = ""; + tabWidth = 2; + }; + 83CBBA001A601CBA00E9B192 /* Products */ = { + isa = PBXGroup; + children = ( + 13B07F961A680F5B00A75B9A /* ReactPaypal.app */, + 00E356EE1AD99517003FC87E /* ReactPaypalTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 00E356ED1AD99517003FC87E /* ReactPaypalTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactPaypalTests" */; + buildPhases = ( + 00E356EA1AD99517003FC87E /* Sources */, + 00E356EB1AD99517003FC87E /* Frameworks */, + 00E356EC1AD99517003FC87E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 00E356F51AD99517003FC87E /* PBXTargetDependency */, + ); + name = ReactPaypalTests; + productName = ReactPaypalTests; + productReference = 00E356EE1AD99517003FC87E /* ReactPaypalTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 13B07F861A680F5B00A75B9A /* ReactPaypal */ = { + isa = PBXNativeTarget; + buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactPaypal" */; + buildPhases = ( + 13B07F871A680F5B00A75B9A /* Sources */, + 13B07F8C1A680F5B00A75B9A /* Frameworks */, + 13B07F8E1A680F5B00A75B9A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ReactPaypal; + productName = "Hello World"; + productReference = 13B07F961A680F5B00A75B9A /* ReactPaypal.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 83CBB9F71A601CBA00E9B192 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = Facebook; + TargetAttributes = { + 00E356ED1AD99517003FC87E = { + CreatedOnToolsVersion = 6.2; + TestTargetID = 13B07F861A680F5B00A75B9A; + }; + }; + }; + buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactPaypal" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 83CBB9F61A601CBA00E9B192; + productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; + ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; + }, + { + ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; + ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; + }, + { + ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; + ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; + }, + { + ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; + ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; + }, + { + ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; + ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; + }, + { + ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; + ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; + }, + { + ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; + ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; + }, + { + ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; + ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; + }, + { + ProductGroup = 139FDEE71B06529A00C62182 /* Products */; + ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; + }, + { + ProductGroup = 146834001AC3E56700842450 /* Products */; + ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 13B07F861A680F5B00A75B9A /* ReactPaypal */, + 00E356ED1AD99517003FC87E /* ReactPaypalTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTActionSheet.a; + remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTGeolocation.a; + remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTImage.a; + remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTNetwork.a; + remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTVibration.a; + remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTSettings.a; + remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTWebSocket.a; + remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 146834041AC3E56700842450 /* libReact.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libReact.a; + remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTLinking.a; + remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTText.a; + remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 00E356EC1AD99517003FC87E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 13B07F8E1A680F5B00A75B9A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */, + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, + 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 00E356EA1AD99517003FC87E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 00E356F31AD99517003FC87E /* ReactPaypalTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 13B07F871A680F5B00A75B9A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, + 13B07FC11A68108700A75B9A /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 13B07F861A680F5B00A75B9A /* ReactPaypal */; + targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + 13B07FB21A68108700A75B9A /* Base */, + ); + name = LaunchScreen.xib; + path = iOS; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 00E356F61AD99517003FC87E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = ReactPaypalTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactPaypal.app/ReactPaypal"; + }; + name = Debug; + }; + 00E356F71AD99517003FC87E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = ReactPaypalTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactPaypal.app/ReactPaypal"; + }; + name = Release; + }; + 13B07F941A680F5B00A75B9A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/node_modules/react-native/React/**", + ); + INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = ReactPaypal; + }; + name = Debug; + }; + 13B07F951A680F5B00A75B9A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/node_modules/react-native/React/**", + ); + INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = ReactPaypal; + }; + name = Release; + }; + 83CBBA201A601CBA00E9B192 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/node_modules/react-native/React/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 83CBBA211A601CBA00E9B192 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/node_modules/react-native/React/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactPaypalTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 00E356F61AD99517003FC87E /* Debug */, + 00E356F71AD99517003FC87E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactPaypal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 13B07F941A680F5B00A75B9A /* Debug */, + 13B07F951A680F5B00A75B9A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactPaypal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 83CBBA201A601CBA00E9B192 /* Debug */, + 83CBBA211A601CBA00E9B192 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; +} diff --git a/ReactPaypal/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme b/ReactPaypal/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme new file mode 100644 index 0000000..ec0f74b --- /dev/null +++ b/ReactPaypal/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ReactPaypal/ReactPaypalTests/Info.plist b/ReactPaypal/ReactPaypalTests/Info.plist new file mode 100644 index 0000000..886825c --- /dev/null +++ b/ReactPaypal/ReactPaypalTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/ReactPaypal/ReactPaypalTests/ReactPaypalTests.m b/ReactPaypal/ReactPaypalTests/ReactPaypalTests.m new file mode 100644 index 0000000..31fc729 --- /dev/null +++ b/ReactPaypal/ReactPaypalTests/ReactPaypalTests.m @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import +#import + +#import "RCTAssert.h" +#import "RCTRedBox.h" +#import "RCTRootView.h" + +#define TIMEOUT_SECONDS 240 +#define TEXT_TO_LOOK_FOR @"Welcome to React Native!" + +@interface ReactPaypalTests : XCTestCase + +@end + +@implementation ReactPaypalTests + + +- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test +{ + if (test(view)) { + return YES; + } + for (UIView *subview in [view subviews]) { + if ([self findSubviewInView:subview matching:test]) { + return YES; + } + } + return NO; +} + +- (void)testRendersWelcomeScreen { + UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; + NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; + BOOL foundElement = NO; + NSString *redboxError = nil; + + while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { + [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; + [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; + + redboxError = [[RCTRedBox sharedInstance] currentErrorMessage]; + + foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { + if ([view respondsToSelector:@selector(attributedText)]) { + NSString *text = [(id)view attributedText].string; + if ([text isEqualToString:TEXT_TO_LOOK_FOR]) { + return YES; + } + } + return NO; + }]; + } + + XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); + XCTAssertTrue(foundElement, @"Cound't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); +} + + +@end diff --git a/ReactPaypal/iOS/AppDelegate.h b/ReactPaypal/iOS/AppDelegate.h new file mode 100644 index 0000000..a9654d5 --- /dev/null +++ b/ReactPaypal/iOS/AppDelegate.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +@interface AppDelegate : UIResponder + +@property (nonatomic, strong) UIWindow *window; + +@end diff --git a/ReactPaypal/iOS/AppDelegate.m b/ReactPaypal/iOS/AppDelegate.m new file mode 100644 index 0000000..8b16bec --- /dev/null +++ b/ReactPaypal/iOS/AppDelegate.m @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "AppDelegate.h" + +#import "RCTRootView.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + NSURL *jsCodeLocation; + + /** + * Loading JavaScript code - uncomment the one you want. + * + * OPTION 1 + * Load from development server. Start the server from the repository root: + * + * $ npm start + * + * To run on device, change `localhost` to the IP address of your computer + * (you can get this by typing `ifconfig` into the terminal and selecting the + * `inet` value under `en0:`) and make sure your computer and iOS device are + * on the same Wi-Fi network. + */ + + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"]; + + /** + * OPTION 2 + * Load from pre-bundled file on disk. To re-generate the static bundle + * from the root of your project directory, run + * + * $ react-native bundle --minify + * + * see http://facebook.github.io/react-native/docs/runningondevice.html + */ + +// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; + + RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation + moduleName:@"ReactPaypal" + launchOptions:launchOptions]; + + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + UIViewController *rootViewController = [[UIViewController alloc] init]; + rootViewController.view = rootView; + self.window.rootViewController = rootViewController; + [self.window makeKeyAndVisible]; + return YES; +} + +@end diff --git a/ReactPaypal/iOS/Base.lproj/LaunchScreen.xib b/ReactPaypal/iOS/Base.lproj/LaunchScreen.xib new file mode 100644 index 0000000..2f81a12 --- /dev/null +++ b/ReactPaypal/iOS/Base.lproj/LaunchScreen.xib @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ReactPaypal/iOS/Images.xcassets/AppIcon.appiconset/Contents.json b/ReactPaypal/iOS/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..118c98f --- /dev/null +++ b/ReactPaypal/iOS/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ReactPaypal/iOS/Info.plist b/ReactPaypal/iOS/Info.plist new file mode 100644 index 0000000..0a56a6e --- /dev/null +++ b/ReactPaypal/iOS/Info.plist @@ -0,0 +1,42 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + NSLocationWhenInUseUsageDescription + + + diff --git a/ReactPaypal/iOS/main.jsbundle b/ReactPaypal/iOS/main.jsbundle new file mode 100644 index 0000000..b702b30 --- /dev/null +++ b/ReactPaypal/iOS/main.jsbundle @@ -0,0 +1,8 @@ +// Offline JS +// To re-generate the offline bundle, run this from the root of your project: +// +// $ react-native bundle --minify +// +// See http://facebook.github.io/react-native/docs/runningondevice.html for more details. + +throw new Error('Offline JS file is empty. See iOS/main.jsbundle for instructions'); diff --git a/ReactPaypal/iOS/main.m b/ReactPaypal/iOS/main.m new file mode 100644 index 0000000..3d767fc --- /dev/null +++ b/ReactPaypal/iOS/main.m @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/ReactPaypal/index.ios.js b/ReactPaypal/index.ios.js new file mode 100644 index 0000000..ad27c0d --- /dev/null +++ b/ReactPaypal/index.ios.js @@ -0,0 +1,53 @@ +/** + * Sample React Native App + * https://github.com/facebook/react-native + */ +'use strict'; + +var React = require('react-native'); +var { + AppRegistry, + StyleSheet, + Text, + View, +} = React; + +var ReactPaypal = React.createClass({ + render: function() { + return ( + + + Welcome to React Native! + + + To get started, edit index.ios.js + + + Press Cmd+R to reload,{'\n'} + Cmd+D or shake for dev menu + + + ); + } +}); + +var styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: '#F5FCFF', + }, + welcome: { + fontSize: 20, + textAlign: 'center', + margin: 10, + }, + instructions: { + textAlign: 'center', + color: '#333333', + marginBottom: 5, + }, +}); + +AppRegistry.registerComponent('ReactPaypal', () => ReactPaypal); diff --git a/ReactPaypal/lib/Paypal b/ReactPaypal/lib/Paypal new file mode 160000 index 0000000..e0b5f80 --- /dev/null +++ b/ReactPaypal/lib/Paypal @@ -0,0 +1 @@ +Subproject commit e0b5f802c541084f88343dc033ac902feecbe4e0 diff --git a/ReactPaypal/package.json b/ReactPaypal/package.json new file mode 100644 index 0000000..acc7b17 --- /dev/null +++ b/ReactPaypal/package.json @@ -0,0 +1,11 @@ +{ + "name": "ReactPaypal", + "version": "0.0.1", + "private": true, + "scripts": { + "start": "node_modules/react-native/packager/packager.sh" + }, + "dependencies": { + "react-native": "^0.5.0" + } +} From 1f621b69f364bd71748aeeb693c5cfef3870b813 Mon Sep 17 00:00:00 2001 From: Tj Date: Mon, 22 Jun 2015 18:54:18 -0400 Subject: [PATCH 03/36] empty class --- .../MFLReactNativePayPal.h | 13 +++++++ .../MFLReactNativePayPal.m | 13 +++++++ .../ReactPaypal.xcodeproj/project.pbxproj | 34 +++++++++++++------ 3 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.h create mode 100644 ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m diff --git a/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.h b/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.h new file mode 100644 index 0000000..5d062aa --- /dev/null +++ b/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.h @@ -0,0 +1,13 @@ +// +// MFLReactNativePayPal.h +// ReactPaypal +// +// Created by Tj on 6/22/15. +// Copyright (c) 2015 Facebook. All rights reserved. +// + +#import + +@interface MFLReactNativePayPal : NSObject + +@end diff --git a/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m b/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m new file mode 100644 index 0000000..fa5346d --- /dev/null +++ b/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m @@ -0,0 +1,13 @@ +// +// MFLReactNativePayPal.m +// ReactPaypal +// +// Created by Tj on 6/22/15. +// Copyright (c) 2015 Facebook. All rights reserved. +// + +#import "MFLReactNativePayPal.h" + +@implementation MFLReactNativePayPal + +@end diff --git a/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj b/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj index a0a6768..956341c 100644 --- a/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj +++ b/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj @@ -22,6 +22,7 @@ 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; + 32A2D8201B38C9820037584B /* MFLReactNativePayPal.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A2D81F1B38C9820037584B /* MFLReactNativePayPal.m */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; /* End PBXBuildFile section */ @@ -107,16 +108,16 @@ /* Begin PBXFileReference section */ 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = iOS/main.jsbundle; sourceTree = ""; }; - 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj; sourceTree = ""; }; - 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj; sourceTree = ""; }; - 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = node_modules/react-native/Libraries/Image/RCTImage.xcodeproj; sourceTree = ""; }; - 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj; sourceTree = ""; }; - 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj; sourceTree = ""; }; + 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; + 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; + 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; + 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; + 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 00E356EE1AD99517003FC87E /* ReactPaypalTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ReactPaypalTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 00E356F21AD99517003FC87E /* ReactPaypalTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactPaypalTests.m; sourceTree = ""; }; - 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj; sourceTree = ""; }; - 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj; sourceTree = ""; }; + 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; + 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* ReactPaypal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReactPaypal.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = iOS/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = iOS/AppDelegate.m; sourceTree = ""; }; @@ -124,9 +125,11 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = iOS/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = iOS/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = iOS/main.m; sourceTree = ""; }; - 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = node_modules/react-native/React/React.xcodeproj; sourceTree = ""; }; - 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj; sourceTree = ""; }; - 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = node_modules/react-native/Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; + 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; + 32A2D81E1B38C9820037584B /* MFLReactNativePayPal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFLReactNativePayPal.h; sourceTree = ""; }; + 32A2D81F1B38C9820037584B /* MFLReactNativePayPal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFLReactNativePayPal.m; sourceTree = ""; }; + 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; + 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -240,6 +243,7 @@ 13B07FB61A68108700A75B9A /* Info.plist */, 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 13B07FB71A68108700A75B9A /* main.m */, + 32A2D8131B38C96C0037584B /* MFLReactNativePayPal */, ); name = ReactPaypal; sourceTree = ""; @@ -252,6 +256,15 @@ name = Products; sourceTree = ""; }; + 32A2D8131B38C96C0037584B /* MFLReactNativePayPal */ = { + isa = PBXGroup; + children = ( + 32A2D81E1B38C9820037584B /* MFLReactNativePayPal.h */, + 32A2D81F1B38C9820037584B /* MFLReactNativePayPal.m */, + ); + path = MFLReactNativePayPal; + sourceTree = ""; + }; 78C398B11ACF4ADC00677621 /* Products */ = { isa = PBXGroup; children = ( @@ -526,6 +539,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 32A2D8201B38C9820037584B /* MFLReactNativePayPal.m in Sources */, 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 13B07FC11A68108700A75B9A /* main.m in Sources */, ); From 69c7f39c14d942a3d8cb760c8b7de3fc84ffe714 Mon Sep 17 00:00:00 2001 From: Tj Date: Mon, 22 Jun 2015 20:05:21 -0400 Subject: [PATCH 04/36] Working implementation and example --- .../MFLReactNativePayPal.h | 14 +++ .../MFLReactNativePayPal.m | 97 +++++++++++++++++++ .../ReactPaypal.xcodeproj/project.pbxproj | 93 +++++++++++++++++- ReactPaypal/index.ios.js | 42 ++++++-- 4 files changed, 234 insertions(+), 12 deletions(-) diff --git a/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.h b/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.h index 5d062aa..f341aaa 100644 --- a/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.h +++ b/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.h @@ -8,6 +8,20 @@ #import +typedef NS_ENUM(NSInteger, PayPalEnvironment) +{ + kPayPalEnvironmentSandbox, + kPayPalEnvironmentProduction, + kPayPalEnvironmentSandboxNoNetwork +}; + +typedef NS_ENUM(NSInteger, PaymentCompletionStatus) +{ + kPayPalPaymentCanceled, + kPayPalPaymentCompleted +}; + + @interface MFLReactNativePayPal : NSObject @end diff --git a/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m b/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m index fa5346d..058b72b 100644 --- a/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m +++ b/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m @@ -7,7 +7,104 @@ // #import "MFLReactNativePayPal.h" +#import "RCTBridge.h" +#import "PayPalMobile.h" + +@interface MFLReactNativePayPal () + +@property PayPalPayment *payment; +@property PayPalConfiguration *configuration; +@property (copy) RCTResponseSenderBlock flowCompletedCallback; + +@end @implementation MFLReactNativePayPal +RCT_EXPORT_MODULE(); + +RCT_EXPORT_METHOD(initializePaypalEnvironment:(PayPalEnvironment)environment + forClientId:(NSString *)clientId ) +{ + dispatch_async(dispatch_get_main_queue(), ^{ + NSString *envString = [self stringFromEnvironmentEnum:environment]; + + [PayPalMobile initializeWithClientIdsForEnvironments:@{envString : clientId}]; + [PayPalMobile preconnectWithEnvironment:envString]; + }); +} + +#pragma mark React Exported Methods + +RCT_EXPORT_METHOD(preparePaymentOfAmount:(CGFloat)amount + ofCurrency:(NSString *)currencyCode + withDescription:(NSString *)description) +{ + self.payment = [[PayPalPayment alloc] init]; + [self.payment setAmount:[[NSDecimalNumber alloc] initWithFloat:amount]]; + [self.payment setCurrencyCode:currencyCode]; + [self.payment setShortDescription:description]; +} + + +RCT_EXPORT_METHOD(prepareConfigurationForMerchant:(NSString *)merchantName + acceptingCreditCards:(BOOL)shouldAcceptCreditCards + withUserEmail:(NSString *)userEmail) +{ + self.configuration = [[PayPalConfiguration alloc] init]; + [self.configuration setMerchantName:merchantName]; + [self.configuration setAcceptCreditCards:shouldAcceptCreditCards]; + [self.configuration setDefaultUserEmail:userEmail]; +} + +RCT_EXPORT_METHOD(presentPaymentViewControllerForPreparedPurchase:(RCTResponseSenderBlock)flowCompletedCallback) +{ + self.flowCompletedCallback = flowCompletedCallback; + + PayPalPaymentViewController *vc = [[PayPalPaymentViewController alloc] initWithPayment:self.payment + configuration:self.configuration + delegate:self]; + + UIViewController *visibleVC = [[[UIApplication sharedApplication] keyWindow] rootViewController]; + do { + if ([visibleVC isKindOfClass:[UINavigationController class]]) { + visibleVC = [(UINavigationController *)visibleVC visibleViewController]; + } else if (visibleVC.presentedViewController) { + visibleVC = visibleVC.presentedViewController; + } + } while (visibleVC.presentedViewController); + + [visibleVC presentViewController:vc animated:YES completion:nil]; +} + +#pragma mark Paypal Delegate + +- (void)payPalPaymentDidCancel:(PayPalPaymentViewController *)paymentViewController +{ + [paymentViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ + if (self.flowCompletedCallback) { + self.flowCompletedCallback(@[[NSNull null], @(kPayPalPaymentCanceled)]); + } + }]; +} + +- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController didCompletePayment:(PayPalPayment *)completedPayment +{ + [paymentViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ + if (self.flowCompletedCallback) { + self.flowCompletedCallback(@[[NSNull null], @(kPayPalPaymentCompleted)]); + } + }]; +} + +#pragma mark Utilities + +- (NSString *)stringFromEnvironmentEnum:(PayPalEnvironment)env +{ + switch (env) { + case kPayPalEnvironmentProduction: return PayPalEnvironmentProduction; + case kPayPalEnvironmentSandbox: return PayPalEnvironmentSandbox; + case kPayPalEnvironmentSandboxNoNetwork: return PayPalEnvironmentNoNetwork; + } +} + @end diff --git a/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj b/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj index 956341c..4c7fb8c 100644 --- a/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj +++ b/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj @@ -23,6 +23,15 @@ 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 32A2D8201B38C9820037584B /* MFLReactNativePayPal.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A2D81F1B38C9820037584B /* MFLReactNativePayPal.m */; }; + 32A2D8321B38C9C30037584B /* libPayPalMobile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D82A1B38C9C30037584B /* libPayPalMobile.a */; }; + 32A2D8341B38D0900037584B /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D8331B38D0900037584B /* Accelerate.framework */; }; + 32A2D8361B38D0950037584B /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D8351B38D0950037584B /* AudioToolbox.framework */; }; + 32A2D8381B38D09A0037584B /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D8371B38D09A0037584B /* AVFoundation.framework */; }; + 32A2D83A1B38D09E0037584B /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D8391B38D09E0037584B /* CoreLocation.framework */; }; + 32A2D83C1B38D0A30037584B /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D83B1B38D0A30037584B /* CoreMedia.framework */; }; + 32A2D83E1B38D0A70037584B /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D83D1B38D0A70037584B /* MessageUI.framework */; }; + 32A2D8401B38D0AC0037584B /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D83F1B38D0AC0037584B /* MobileCoreServices.framework */; }; + 32A2D8421B38D0B20037584B /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D8411B38D0B20037584B /* SystemConfiguration.framework */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; /* End PBXBuildFile section */ @@ -128,6 +137,30 @@ 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 32A2D81E1B38C9820037584B /* MFLReactNativePayPal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFLReactNativePayPal.h; sourceTree = ""; }; 32A2D81F1B38C9820037584B /* MFLReactNativePayPal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFLReactNativePayPal.m; sourceTree = ""; }; + 32A2D8221B38C9C30037584B /* CardIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIO.h; sourceTree = ""; }; + 32A2D8231B38C9C30037584B /* CardIOCreditCardInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOCreditCardInfo.h; sourceTree = ""; }; + 32A2D8241B38C9C30037584B /* CardIODetectionMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIODetectionMode.h; sourceTree = ""; }; + 32A2D8251B38C9C30037584B /* CardIOPaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOPaymentViewController.h; sourceTree = ""; }; + 32A2D8261B38C9C30037584B /* CardIOPaymentViewControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOPaymentViewControllerDelegate.h; sourceTree = ""; }; + 32A2D8271B38C9C30037584B /* CardIOUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOUtilities.h; sourceTree = ""; }; + 32A2D8281B38C9C30037584B /* CardIOView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOView.h; sourceTree = ""; }; + 32A2D8291B38C9C30037584B /* CardIOViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOViewDelegate.h; sourceTree = ""; }; + 32A2D82A1B38C9C30037584B /* libPayPalMobile.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libPayPalMobile.a; sourceTree = ""; }; + 32A2D82B1B38C9C30037584B /* PayPalConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalConfiguration.h; sourceTree = ""; }; + 32A2D82C1B38C9C30037584B /* PayPalFuturePaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalFuturePaymentViewController.h; sourceTree = ""; }; + 32A2D82D1B38C9C30037584B /* PayPalMobile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalMobile.h; sourceTree = ""; }; + 32A2D82E1B38C9C30037584B /* PayPalOAuthScopes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalOAuthScopes.h; sourceTree = ""; }; + 32A2D82F1B38C9C30037584B /* PayPalPayment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalPayment.h; sourceTree = ""; }; + 32A2D8301B38C9C30037584B /* PayPalPaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalPaymentViewController.h; sourceTree = ""; }; + 32A2D8311B38C9C30037584B /* PayPalProfileSharingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalProfileSharingViewController.h; sourceTree = ""; }; + 32A2D8331B38D0900037584B /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; + 32A2D8351B38D0950037584B /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + 32A2D8371B38D09A0037584B /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + 32A2D8391B38D09E0037584B /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; + 32A2D83B1B38D0A30037584B /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; + 32A2D83D1B38D0A70037584B /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; + 32A2D83F1B38D0AC0037584B /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; + 32A2D8411B38D0B20037584B /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -144,6 +177,14 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 32A2D8421B38D0B20037584B /* SystemConfiguration.framework in Frameworks */, + 32A2D8401B38D0AC0037584B /* MobileCoreServices.framework in Frameworks */, + 32A2D83E1B38D0A70037584B /* MessageUI.framework in Frameworks */, + 32A2D83C1B38D0A30037584B /* CoreMedia.framework in Frameworks */, + 32A2D83A1B38D09E0037584B /* CoreLocation.framework in Frameworks */, + 32A2D8381B38D09A0037584B /* AVFoundation.framework in Frameworks */, + 32A2D8361B38D0950037584B /* AudioToolbox.framework in Frameworks */, + 32A2D8341B38D0900037584B /* Accelerate.framework in Frameworks */, 146834051AC3E58100842450 /* libReact.a in Frameworks */, 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, @@ -152,6 +193,7 @@ 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, + 32A2D8321B38C9C30037584B /* libPayPalMobile.a in Frameworks */, 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, ); @@ -265,6 +307,30 @@ path = MFLReactNativePayPal; sourceTree = ""; }; + 32A2D8211B38C9C30037584B /* PayPalMobile */ = { + isa = PBXGroup; + children = ( + 32A2D8221B38C9C30037584B /* CardIO.h */, + 32A2D8231B38C9C30037584B /* CardIOCreditCardInfo.h */, + 32A2D8241B38C9C30037584B /* CardIODetectionMode.h */, + 32A2D8251B38C9C30037584B /* CardIOPaymentViewController.h */, + 32A2D8261B38C9C30037584B /* CardIOPaymentViewControllerDelegate.h */, + 32A2D8271B38C9C30037584B /* CardIOUtilities.h */, + 32A2D8281B38C9C30037584B /* CardIOView.h */, + 32A2D8291B38C9C30037584B /* CardIOViewDelegate.h */, + 32A2D82A1B38C9C30037584B /* libPayPalMobile.a */, + 32A2D82B1B38C9C30037584B /* PayPalConfiguration.h */, + 32A2D82C1B38C9C30037584B /* PayPalFuturePaymentViewController.h */, + 32A2D82D1B38C9C30037584B /* PayPalMobile.h */, + 32A2D82E1B38C9C30037584B /* PayPalOAuthScopes.h */, + 32A2D82F1B38C9C30037584B /* PayPalPayment.h */, + 32A2D8301B38C9C30037584B /* PayPalPaymentViewController.h */, + 32A2D8311B38C9C30037584B /* PayPalProfileSharingViewController.h */, + ); + name = PayPalMobile; + path = lib/Paypal/PayPalMobile; + sourceTree = ""; + }; 78C398B11ACF4ADC00677621 /* Products */ = { isa = PBXGroup; children = ( @@ -276,6 +342,7 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( + 32A2D8211B38C9C30037584B /* PayPalMobile */, 146833FF1AC3E56700842450 /* React.xcodeproj */, 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, @@ -301,6 +368,14 @@ 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( + 32A2D8411B38D0B20037584B /* SystemConfiguration.framework */, + 32A2D83F1B38D0AC0037584B /* MobileCoreServices.framework */, + 32A2D83D1B38D0A70037584B /* MessageUI.framework */, + 32A2D83B1B38D0A30037584B /* CoreMedia.framework */, + 32A2D8391B38D09E0037584B /* CoreLocation.framework */, + 32A2D8371B38D09A0037584B /* AVFoundation.framework */, + 32A2D8351B38D0950037584B /* AudioToolbox.framework */, + 32A2D8331B38D0900037584B /* Accelerate.framework */, 13B07FAE1A68108700A75B9A /* ReactPaypal */, 832341AE1AAA6A7D00B99B32 /* Libraries */, 00E356EF1AD99517003FC87E /* ReactPaypalTests */, @@ -616,7 +691,14 @@ ); INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/lib/Paypal/PayPalMobile", + ); + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); PRODUCT_NAME = ReactPaypal; }; name = Debug; @@ -632,7 +714,14 @@ ); INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/lib/Paypal/PayPalMobile", + ); + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); PRODUCT_NAME = ReactPaypal; }; name = Release; diff --git a/ReactPaypal/index.ios.js b/ReactPaypal/index.ios.js index ad27c0d..66ba00a 100644 --- a/ReactPaypal/index.ios.js +++ b/ReactPaypal/index.ios.js @@ -4,28 +4,50 @@ */ 'use strict'; +var MFLReactNativePayPal = require('NativeModules').MFLReactNativePayPal; var React = require('react-native'); + var { AppRegistry, StyleSheet, Text, View, + TouchableHighlight } = React; var ReactPaypal = React.createClass({ + componentDidMount: function() { + console.log("Component did mount"); + MFLReactNativePayPal.initializePaypalEnvironment(0, + "AWyPKtVl7ac7SOlIscEe-dONGB-oBYav2TwimOgB1FysVGcKneAkj_1O1LV-Vnr0PEeMk5NmweJfIiLm"); + }, + + _onPressButton: function() { + MFLReactNativePayPal.preparePaymentOfAmount(100.00, "USD", "Bacon"); + MFLReactNativePayPal.prepareConfigurationForMerchant("Bacon Truck", true, "bacon@bacon.com"); + MFLReactNativePayPal.presentPaymentViewControllerForPreparedPurchase((error, payload) => { + if (error) { + // I should think about returning some errors + return; + } else { + console.log("payload: " + payload); + } + }); + }, + render: function() { return ( - - Welcome to React Native! - - - To get started, edit index.ios.js - - - Press Cmd+R to reload,{'\n'} - Cmd+D or shake for dev menu - + + + + Tap To Initiate Paypal Test + + + Use test user "bacon@bacon.com" password "password". + + + ); } From 245ed9d7d1225118a13daf2cfd1b7402a7bc384b Mon Sep 17 00:00:00 2001 From: Tj Date: Mon, 22 Jun 2015 20:08:34 -0400 Subject: [PATCH 05/36] Adding the react-component keyword --- ReactPaypal/package.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ReactPaypal/package.json b/ReactPaypal/package.json index acc7b17..3a1408d 100644 --- a/ReactPaypal/package.json +++ b/ReactPaypal/package.json @@ -5,6 +5,11 @@ "scripts": { "start": "node_modules/react-native/packager/packager.sh" }, + "keywords": [ + "react-component", + "react-native", + "ios" + ], "dependencies": { "react-native": "^0.5.0" } From da2a9f13d74d9937369ace91c162989701ba9590 Mon Sep 17 00:00:00 2001 From: Tj Date: Mon, 22 Jun 2015 20:13:50 -0400 Subject: [PATCH 06/36] Adding repository key --- ReactPaypal/package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactPaypal/package.json b/ReactPaypal/package.json index 3a1408d..f1657bb 100644 --- a/ReactPaypal/package.json +++ b/ReactPaypal/package.json @@ -10,6 +10,10 @@ "react-native", "ios" ], + "repository": { + "type": "git", + "url": "git@github.com:MattFoley/react-native-paypal.git" + }, "dependencies": { "react-native": "^0.5.0" } From 5adeb17526a5df6caa48b51a60e9497750371a1f Mon Sep 17 00:00:00 2001 From: Tj Date: Mon, 22 Jun 2015 22:01:54 -0400 Subject: [PATCH 07/36] Updating package again --- ReactPaypal/package.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ReactPaypal/package.json b/ReactPaypal/package.json index f1657bb..75c865a 100644 --- a/ReactPaypal/package.json +++ b/ReactPaypal/package.json @@ -1,7 +1,7 @@ { - "name": "ReactPaypal", + "name": "react-paypal", "version": "0.0.1", - "private": true, + "private": false, "scripts": { "start": "node_modules/react-native/packager/packager.sh" }, @@ -16,5 +16,7 @@ }, "dependencies": { "react-native": "^0.5.0" - } + }, + "main":"index.ios.js", + "author": "iOSGuy (http://github.com/MattFoley)" } From 25ab41df8e298c1325a046438d663d4d0e0b8edb Mon Sep 17 00:00:00 2001 From: Tj Date: Tue, 23 Jun 2015 09:35:26 -0400 Subject: [PATCH 08/36] Directionssssss --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index 1eca6e7..982667c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,43 @@ # react-native-paypal Paypal wrapper for React Native + + +Very basic support currently. + +Initialization: + + MFLReactNativePayPal.initializePaypalEnvironment(, ""); + +Environment Values that should be used here are declared in MFLReactNativePayPal.h + + • Sandbox = 0 + • Production = 1 + • No Network = 2 + +Prepare a Payment: + + MFLReactNativePayPal.preparePaymentOfAmount(, , ); + ie: MFLReactNativePayPal.preparePaymentOfAmount(100.00, "USD", "Bacon"); + +Prepare Configuration: + + MFLReactNativePayPal.prepareConfigurationForMerchant(, , ); + MFLReactNativePayPal.prepareConfigurationForMerchant("Bacon Truck", true, "bacon@bacon.com"); + + +Present the payment flow with a completion handler: + + MFLReactNativePayPal.presentPaymentViewControllerForPreparedPurchase((error, payload) => { + if (error) { + //Handle Error + return; + } else { + + console.log("payload: " + payload); + if (payload.status == 1) { + console.log(payload.confirmation); + } else { + console.log("User cancelled payment"); + } + } + }); From 85ffab0bded35c133b3b5fec14bd795589ff7db2 Mon Sep 17 00:00:00 2001 From: Tj Date: Tue, 23 Jun 2015 09:44:17 -0400 Subject: [PATCH 09/36] Passing back payment confirmation details, updating test user account information, and logging. --- .../MFLReactNativePayPal.m | 11 +- .../ReactPaypal.xcodeproj/project.pbxproj | 115 +----------------- ReactPaypal/index.ios.js | 16 ++- 3 files changed, 21 insertions(+), 121 deletions(-) diff --git a/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m b/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m index 058b72b..92e77cd 100644 --- a/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m +++ b/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m @@ -10,6 +10,9 @@ #import "RCTBridge.h" #import "PayPalMobile.h" +NSString * const kPayPalPaymentStatusKey = @"status"; +NSString * const kPayPalPaymentConfirmationKey = @"confirmation"; + @interface MFLReactNativePayPal () @property PayPalPayment *payment; @@ -82,16 +85,18 @@ - (void)payPalPaymentDidCancel:(PayPalPaymentViewController *)paymentViewControl { [paymentViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ if (self.flowCompletedCallback) { - self.flowCompletedCallback(@[[NSNull null], @(kPayPalPaymentCanceled)]); + self.flowCompletedCallback(@[[NSNull null], @{kPayPalPaymentStatusKey : @(kPayPalPaymentCanceled)}]); } }]; } -- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController didCompletePayment:(PayPalPayment *)completedPayment +- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController + didCompletePayment:(PayPalPayment *)completedPayment { [paymentViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ if (self.flowCompletedCallback) { - self.flowCompletedCallback(@[[NSNull null], @(kPayPalPaymentCompleted)]); + self.flowCompletedCallback(@[[NSNull null], @{kPayPalPaymentStatusKey : @(kPayPalPaymentCompleted), + kPayPalPaymentConfirmationKey : completedPayment.confirmation}]); } }]; } diff --git a/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj b/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj index 4c7fb8c..9c522c7 100644 --- a/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj +++ b/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj @@ -13,7 +13,6 @@ 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; - 00E356F31AD99517003FC87E /* ReactPaypalTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ReactPaypalTests.m */; }; 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; @@ -71,13 +70,6 @@ remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; remoteInfo = RCTVibration; }; - 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 13B07F861A680F5B00A75B9A; - remoteInfo = ReactPaypal; - }; 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; @@ -122,7 +114,6 @@ 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; - 00E356EE1AD99517003FC87E /* ReactPaypalTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ReactPaypalTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 00E356F21AD99517003FC87E /* ReactPaypalTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactPaypalTests.m; sourceTree = ""; }; 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; @@ -166,13 +157,6 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 00E356EB1AD99517003FC87E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -389,7 +373,6 @@ isa = PBXGroup; children = ( 13B07F961A680F5B00A75B9A /* ReactPaypal.app */, - 00E356EE1AD99517003FC87E /* ReactPaypalTests.xctest */, ); name = Products; sourceTree = ""; @@ -397,24 +380,6 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 00E356ED1AD99517003FC87E /* ReactPaypalTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactPaypalTests" */; - buildPhases = ( - 00E356EA1AD99517003FC87E /* Sources */, - 00E356EB1AD99517003FC87E /* Frameworks */, - 00E356EC1AD99517003FC87E /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 00E356F51AD99517003FC87E /* PBXTargetDependency */, - ); - name = ReactPaypalTests; - productName = ReactPaypalTests; - productReference = 00E356EE1AD99517003FC87E /* ReactPaypalTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; 13B07F861A680F5B00A75B9A /* ReactPaypal */ = { isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactPaypal" */; @@ -440,12 +405,6 @@ attributes = { LastUpgradeCheck = 0610; ORGANIZATIONNAME = Facebook; - TargetAttributes = { - 00E356ED1AD99517003FC87E = { - CreatedOnToolsVersion = 6.2; - TestTargetID = 13B07F861A680F5B00A75B9A; - }; - }; }; buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactPaypal" */; compatibilityVersion = "Xcode 3.2"; @@ -503,7 +462,6 @@ projectRoot = ""; targets = ( 13B07F861A680F5B00A75B9A /* ReactPaypal */, - 00E356ED1AD99517003FC87E /* ReactPaypalTests */, ); }; /* End PBXProject section */ @@ -582,13 +540,6 @@ /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ - 00E356EC1AD99517003FC87E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 13B07F8E1A680F5B00A75B9A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -602,14 +553,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 00E356EA1AD99517003FC87E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 00E356F31AD99517003FC87E /* ReactPaypalTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 13B07F871A680F5B00A75B9A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -622,14 +565,6 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 13B07F861A680F5B00A75B9A /* ReactPaypal */; - targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { isa = PBXVariantGroup; @@ -643,43 +578,6 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 00E356F61AD99517003FC87E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = ReactPaypalTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactPaypal.app/ReactPaypal"; - }; - name = Debug; - }; - 00E356F71AD99517003FC87E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - INFOPLIST_FILE = ReactPaypalTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactPaypal.app/ReactPaypal"; - }; - name = Release; - }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -687,7 +585,7 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/node_modules/react-native/React/**", + "\"$(SRCROOT)/node_modules/react-native/React\"/**", ); INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -710,7 +608,7 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/node_modules/react-native/React/**", + "\"$(SRCROOT)/node_modules/react-native/React\"/**", ); INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -815,15 +713,6 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactPaypalTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 00E356F61AD99517003FC87E /* Debug */, - 00E356F71AD99517003FC87E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactPaypal" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/ReactPaypal/index.ios.js b/ReactPaypal/index.ios.js index 66ba00a..a516bb2 100644 --- a/ReactPaypal/index.ios.js +++ b/ReactPaypal/index.ios.js @@ -27,11 +27,17 @@ var ReactPaypal = React.createClass({ MFLReactNativePayPal.prepareConfigurationForMerchant("Bacon Truck", true, "bacon@bacon.com"); MFLReactNativePayPal.presentPaymentViewControllerForPreparedPurchase((error, payload) => { if (error) { - // I should think about returning some errors - return; - } else { + //Handle Error + return; + } else { + console.log("payload: " + payload); - } + if (payload.status == 1) { + console.log(payload.confirmation); + } else { + console.log("User cancelled payment"); + } + } }); }, @@ -44,7 +50,7 @@ var ReactPaypal = React.createClass({ Tap To Initiate Paypal Test - Use test user "bacon@bacon.com" password "password". + Use test user "bacon@react.com" password "Password!". From df4c844403e9461212e60a83b0f4defcc4de7b11 Mon Sep 17 00:00:00 2001 From: Tj Date: Tue, 23 Jun 2015 09:46:32 -0400 Subject: [PATCH 10/36] More directionsssss --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 982667c..e25d793 100644 --- a/README.md +++ b/README.md @@ -4,28 +4,30 @@ Paypal wrapper for React Native Very basic support currently. -Initialization: +###Initialization: MFLReactNativePayPal.initializePaypalEnvironment(, ""); -Environment Values that should be used here are declared in MFLReactNativePayPal.h +#####Environment Values that should be used here are declared in MFLReactNativePayPal.h • Sandbox = 0 + • Production = 1 + • No Network = 2 -Prepare a Payment: +###Prepare a Payment: MFLReactNativePayPal.preparePaymentOfAmount(, , ); ie: MFLReactNativePayPal.preparePaymentOfAmount(100.00, "USD", "Bacon"); -Prepare Configuration: +###Prepare Configuration: MFLReactNativePayPal.prepareConfigurationForMerchant(, , ); MFLReactNativePayPal.prepareConfigurationForMerchant("Bacon Truck", true, "bacon@bacon.com"); -Present the payment flow with a completion handler: +###Present the payment flow with a completion handler: MFLReactNativePayPal.presentPaymentViewControllerForPreparedPurchase((error, payload) => { if (error) { From 85729a18fe67c88b5861b2dde09ded2a9b6d8bae Mon Sep 17 00:00:00 2001 From: Tj Date: Tue, 23 Jun 2015 09:50:05 -0400 Subject: [PATCH 11/36] Update README.md --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e25d793..b645214 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,19 @@ Paypal wrapper for React Native Very basic support currently. +###Integration + +Include PayPal as normally, following their directions. After doing that, also drag MFLReactNativePayPal.h and MFLReactNativePayPal.m into your project. + ###Initialization: MFLReactNativePayPal.initializePaypalEnvironment(, ""); #####Environment Values that should be used here are declared in MFLReactNativePayPal.h - • Sandbox = 0 - - • Production = 1 - - • No Network = 2 + • Sandbox = 0 + • Production = 1 + • No Network = 2 ###Prepare a Payment: From 9b879d5a80dc02752d1862a6bb74a046bfde294c Mon Sep 17 00:00:00 2001 From: Tj Date: Tue, 23 Jun 2015 09:50:33 -0400 Subject: [PATCH 12/36] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index b645214..4a40225 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # react-native-paypal -Paypal wrapper for React Native - -Very basic support currently. +Paypal wrapper for React Native, currently only supports the bare minimum of buying a product. ###Integration From b2d2432c2d6a8a4972b6d9e8f9fb9a0d7a180b50 Mon Sep 17 00:00:00 2001 From: Tj Date: Wed, 24 Jun 2015 09:01:35 -0400 Subject: [PATCH 13/36] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a40225..cff6f7e 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,11 @@ Paypal wrapper for React Native, currently only supports the bare minimum of buy ###Integration -Include PayPal as normally, following their directions. After doing that, also drag MFLReactNativePayPal.h and MFLReactNativePayPal.m into your project. +Include PayPal as normally, following their directions. Their integration steps and iOS SDK can be found [here](https://github.com/paypal/PayPal-iOS-SDK). After doing that, also drag MFLReactNativePayPal.h and MFLReactNativePayPal.m into your project. ###Initialization: + var MFLReactNativePayPal = require('NativeModules').MFLReactNativePayPal; MFLReactNativePayPal.initializePaypalEnvironment(, ""); #####Environment Values that should be used here are declared in MFLReactNativePayPal.h From 099dc7a1a125beb4d11bda9697c715fe74844ba9 Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Wed, 13 Jan 2016 10:33:14 +0100 Subject: [PATCH 14/36] Added react-native .gitignore --- .gitignore | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.gitignore b/.gitignore index 020c425..5be94be 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,38 @@ +# OSX +# +.DS_Store + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +project.xcworkspace + +# Android/IJ +# +.idea +.gradle +local.properties + +# node.js +# +node_modules/ +npm-debug.log + /android/build +/android/react-native-paypal.iml /.tern-port From ad1336f78d3666d8084906c35135abdc43454147 Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Wed, 13 Jan 2016 11:02:32 +0100 Subject: [PATCH 15/36] Android and iOS sections in README --- README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e646ecd..b8fd2db 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ A React Native interface for the PayPal Payment UI # Setup +Android +------- + 1. Add react-navive-paypal to your project ``` bash @@ -145,39 +148,42 @@ PayPal.paymentRequest(...).catch(function (error_code) { }) ``` +iOS +--- + ### TODO: - Automated tests - iOS version - Future payment (subscriptions) Paypal wrapper for React Native, currently only supports the bare minimum of buying a product. -###Integration +### Integration Include PayPal as normally, following their directions. Their integration steps and iOS SDK can be found [here](https://github.com/paypal/PayPal-iOS-SDK). After doing that, also drag MFLReactNativePayPal.h and MFLReactNativePayPal.m into your project. -###Initialization: +### Initialization: var MFLReactNativePayPal = require('NativeModules').MFLReactNativePayPal; MFLReactNativePayPal.initializePaypalEnvironment(, ""); -#####Environment Values that should be used here are declared in MFLReactNativePayPal.h +##### Environment Values that should be used here are declared in MFLReactNativePayPal.h • Sandbox = 0 • Production = 1 • No Network = 2 -###Prepare a Payment: +### Prepare a Payment: MFLReactNativePayPal.preparePaymentOfAmount(, , ); ie: MFLReactNativePayPal.preparePaymentOfAmount(100.00, "USD", "Bacon"); -###Prepare Configuration: +### Prepare Configuration: MFLReactNativePayPal.prepareConfigurationForMerchant(, , ); MFLReactNativePayPal.prepareConfigurationForMerchant("Bacon Truck", true, "bacon@bacon.com"); -###Present the payment flow with a completion handler: +### Present the payment flow with a completion handler: MFLReactNativePayPal.presentPaymentViewControllerForPreparedPurchase((error, payload) => { if (error) { From 1e8f13dd3fe69592257443135fb80272dc49f63f Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Wed, 13 Jan 2016 12:31:04 +0100 Subject: [PATCH 16/36] Renamed ReactPaypal => ios --- .gitmodules | 4 ++-- {ReactPaypal => ios}/.flowconfig | 0 {ReactPaypal => ios}/.gitignore | 0 {ReactPaypal => ios}/.npmignore | 0 .../MFLReactNativePayPal/MFLReactNativePayPal.h | 0 .../MFLReactNativePayPal/MFLReactNativePayPal.m | 0 {ReactPaypal => ios}/ReactPaypal.xcodeproj/project.pbxproj | 0 .../xcshareddata/xcschemes/ReactPaypal.xcscheme | 0 {ReactPaypal => ios}/ReactPaypalTests/Info.plist | 0 {ReactPaypal => ios}/ReactPaypalTests/ReactPaypalTests.m | 0 {ReactPaypal => ios}/iOS/AppDelegate.h | 0 {ReactPaypal => ios}/iOS/AppDelegate.m | 0 {ReactPaypal => ios}/iOS/Base.lproj/LaunchScreen.xib | 0 .../iOS/Images.xcassets/AppIcon.appiconset/Contents.json | 0 {ReactPaypal => ios}/iOS/Info.plist | 0 {ReactPaypal => ios}/iOS/main.jsbundle | 0 {ReactPaypal => ios}/iOS/main.m | 0 {ReactPaypal => ios}/index.ios.js | 0 {ReactPaypal => ios}/lib/Paypal | 0 {ReactPaypal => ios}/package.json | 0 20 files changed, 2 insertions(+), 2 deletions(-) rename {ReactPaypal => ios}/.flowconfig (100%) rename {ReactPaypal => ios}/.gitignore (100%) rename {ReactPaypal => ios}/.npmignore (100%) rename {ReactPaypal => ios}/MFLReactNativePayPal/MFLReactNativePayPal.h (100%) rename {ReactPaypal => ios}/MFLReactNativePayPal/MFLReactNativePayPal.m (100%) rename {ReactPaypal => ios}/ReactPaypal.xcodeproj/project.pbxproj (100%) rename {ReactPaypal => ios}/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme (100%) rename {ReactPaypal => ios}/ReactPaypalTests/Info.plist (100%) rename {ReactPaypal => ios}/ReactPaypalTests/ReactPaypalTests.m (100%) rename {ReactPaypal => ios}/iOS/AppDelegate.h (100%) rename {ReactPaypal => ios}/iOS/AppDelegate.m (100%) rename {ReactPaypal => ios}/iOS/Base.lproj/LaunchScreen.xib (100%) rename {ReactPaypal => ios}/iOS/Images.xcassets/AppIcon.appiconset/Contents.json (100%) rename {ReactPaypal => ios}/iOS/Info.plist (100%) rename {ReactPaypal => ios}/iOS/main.jsbundle (100%) rename {ReactPaypal => ios}/iOS/main.m (100%) rename {ReactPaypal => ios}/index.ios.js (100%) rename {ReactPaypal => ios}/lib/Paypal (100%) rename {ReactPaypal => ios}/package.json (100%) diff --git a/.gitmodules b/.gitmodules index 617a2b1..eb9dee3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "ReactPaypal/lib/Paypal"] - path = ReactPaypal/lib/Paypal +[submodule "ios/lib/Paypal"] + path = ios/lib/Paypal url = git@github.com:paypal/PayPal-iOS-SDK.git diff --git a/ReactPaypal/.flowconfig b/ios/.flowconfig similarity index 100% rename from ReactPaypal/.flowconfig rename to ios/.flowconfig diff --git a/ReactPaypal/.gitignore b/ios/.gitignore similarity index 100% rename from ReactPaypal/.gitignore rename to ios/.gitignore diff --git a/ReactPaypal/.npmignore b/ios/.npmignore similarity index 100% rename from ReactPaypal/.npmignore rename to ios/.npmignore diff --git a/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.h b/ios/MFLReactNativePayPal/MFLReactNativePayPal.h similarity index 100% rename from ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.h rename to ios/MFLReactNativePayPal/MFLReactNativePayPal.h diff --git a/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m similarity index 100% rename from ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m rename to ios/MFLReactNativePayPal/MFLReactNativePayPal.m diff --git a/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj b/ios/ReactPaypal.xcodeproj/project.pbxproj similarity index 100% rename from ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj rename to ios/ReactPaypal.xcodeproj/project.pbxproj diff --git a/ReactPaypal/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme b/ios/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme similarity index 100% rename from ReactPaypal/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme rename to ios/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme diff --git a/ReactPaypal/ReactPaypalTests/Info.plist b/ios/ReactPaypalTests/Info.plist similarity index 100% rename from ReactPaypal/ReactPaypalTests/Info.plist rename to ios/ReactPaypalTests/Info.plist diff --git a/ReactPaypal/ReactPaypalTests/ReactPaypalTests.m b/ios/ReactPaypalTests/ReactPaypalTests.m similarity index 100% rename from ReactPaypal/ReactPaypalTests/ReactPaypalTests.m rename to ios/ReactPaypalTests/ReactPaypalTests.m diff --git a/ReactPaypal/iOS/AppDelegate.h b/ios/iOS/AppDelegate.h similarity index 100% rename from ReactPaypal/iOS/AppDelegate.h rename to ios/iOS/AppDelegate.h diff --git a/ReactPaypal/iOS/AppDelegate.m b/ios/iOS/AppDelegate.m similarity index 100% rename from ReactPaypal/iOS/AppDelegate.m rename to ios/iOS/AppDelegate.m diff --git a/ReactPaypal/iOS/Base.lproj/LaunchScreen.xib b/ios/iOS/Base.lproj/LaunchScreen.xib similarity index 100% rename from ReactPaypal/iOS/Base.lproj/LaunchScreen.xib rename to ios/iOS/Base.lproj/LaunchScreen.xib diff --git a/ReactPaypal/iOS/Images.xcassets/AppIcon.appiconset/Contents.json b/ios/iOS/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from ReactPaypal/iOS/Images.xcassets/AppIcon.appiconset/Contents.json rename to ios/iOS/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/ReactPaypal/iOS/Info.plist b/ios/iOS/Info.plist similarity index 100% rename from ReactPaypal/iOS/Info.plist rename to ios/iOS/Info.plist diff --git a/ReactPaypal/iOS/main.jsbundle b/ios/iOS/main.jsbundle similarity index 100% rename from ReactPaypal/iOS/main.jsbundle rename to ios/iOS/main.jsbundle diff --git a/ReactPaypal/iOS/main.m b/ios/iOS/main.m similarity index 100% rename from ReactPaypal/iOS/main.m rename to ios/iOS/main.m diff --git a/ReactPaypal/index.ios.js b/ios/index.ios.js similarity index 100% rename from ReactPaypal/index.ios.js rename to ios/index.ios.js diff --git a/ReactPaypal/lib/Paypal b/ios/lib/Paypal similarity index 100% rename from ReactPaypal/lib/Paypal rename to ios/lib/Paypal diff --git a/ReactPaypal/package.json b/ios/package.json similarity index 100% rename from ReactPaypal/package.json rename to ios/package.json From e3714f69131a8ab12abdcda9e084f63f063e7198 Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Wed, 13 Jan 2016 15:58:10 +0100 Subject: [PATCH 17/36] Created MFLReactNativePayPal.xcodeproj --- .../project.pbxproj | 262 ++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 ios/MFLReactNativePayPal.xcodeproj/project.pbxproj diff --git a/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj b/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6f2c805 --- /dev/null +++ b/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj @@ -0,0 +1,262 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 64D7A23C1C46907F008FCDA3 /* MFLReactNativePayPal.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 64D7A23B1C46907F008FCDA3 /* MFLReactNativePayPal.h */; }; + 64D7A23E1C46907F008FCDA3 /* MFLReactNativePayPal.m in Sources */ = {isa = PBXBuildFile; fileRef = 64D7A23D1C46907F008FCDA3 /* MFLReactNativePayPal.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 64D7A2361C46907F008FCDA3 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + 64D7A23C1C46907F008FCDA3 /* MFLReactNativePayPal.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 64D7A2381C46907F008FCDA3 /* libMFLReactNativePayPal.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMFLReactNativePayPal.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 64D7A23B1C46907F008FCDA3 /* MFLReactNativePayPal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MFLReactNativePayPal.h; sourceTree = ""; }; + 64D7A23D1C46907F008FCDA3 /* MFLReactNativePayPal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MFLReactNativePayPal.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 64D7A2351C46907F008FCDA3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 64D7A22F1C46907F008FCDA3 = { + isa = PBXGroup; + children = ( + 64D7A23A1C46907F008FCDA3 /* MFLReactNativePayPal */, + 64D7A2391C46907F008FCDA3 /* Products */, + ); + sourceTree = ""; + }; + 64D7A2391C46907F008FCDA3 /* Products */ = { + isa = PBXGroup; + children = ( + 64D7A2381C46907F008FCDA3 /* libMFLReactNativePayPal.a */, + ); + name = Products; + sourceTree = ""; + }; + 64D7A23A1C46907F008FCDA3 /* MFLReactNativePayPal */ = { + isa = PBXGroup; + children = ( + 64D7A23B1C46907F008FCDA3 /* MFLReactNativePayPal.h */, + 64D7A23D1C46907F008FCDA3 /* MFLReactNativePayPal.m */, + ); + path = MFLReactNativePayPal; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 64D7A2371C46907F008FCDA3 /* MFLReactNativePayPal */ = { + isa = PBXNativeTarget; + buildConfigurationList = 64D7A2411C46907F008FCDA3 /* Build configuration list for PBXNativeTarget "MFLReactNativePayPal" */; + buildPhases = ( + 64D7A2341C46907F008FCDA3 /* Sources */, + 64D7A2351C46907F008FCDA3 /* Frameworks */, + 64D7A2361C46907F008FCDA3 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MFLReactNativePayPal; + productName = MFLReactNativePayPal; + productReference = 64D7A2381C46907F008FCDA3 /* libMFLReactNativePayPal.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 64D7A2301C46907F008FCDA3 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0720; + TargetAttributes = { + 64D7A2371C46907F008FCDA3 = { + CreatedOnToolsVersion = 7.2; + }; + }; + }; + buildConfigurationList = 64D7A2331C46907F008FCDA3 /* Build configuration list for PBXProject "MFLReactNativePayPal" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 64D7A22F1C46907F008FCDA3; + productRefGroup = 64D7A2391C46907F008FCDA3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 64D7A2371C46907F008FCDA3 /* MFLReactNativePayPal */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 64D7A2341C46907F008FCDA3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 64D7A23E1C46907F008FCDA3 /* MFLReactNativePayPal.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 64D7A23F1C46907F008FCDA3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 64D7A2401C46907F008FCDA3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 64D7A2421C46907F008FCDA3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/node_modules/react-native/React/**", + "$(SRCROOT)/../../react-native/React/**", + ); + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 64D7A2431C46907F008FCDA3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/node_modules/react-native/React/**", + "$(SRCROOT)/../../react-native/React/**", + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 64D7A2331C46907F008FCDA3 /* Build configuration list for PBXProject "MFLReactNativePayPal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 64D7A23F1C46907F008FCDA3 /* Debug */, + 64D7A2401C46907F008FCDA3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 64D7A2411C46907F008FCDA3 /* Build configuration list for PBXNativeTarget "MFLReactNativePayPal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 64D7A2421C46907F008FCDA3 /* Debug */, + 64D7A2431C46907F008FCDA3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 64D7A2301C46907F008FCDA3 /* Project object */; +} From 0653d9b91410ae35776abdb1d0cd705b69e2dbe5 Mon Sep 17 00:00:00 2001 From: Tj Date: Wed, 13 Jan 2016 09:05:52 -0800 Subject: [PATCH 18/36] Create license.md Adding license. --- license.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 license.md diff --git a/license.md b/license.md new file mode 100644 index 0000000..e7586de --- /dev/null +++ b/license.md @@ -0,0 +1,8 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Tj Fallon + * ---------------------------------------------------------------------------- + */ From fb6429960d7a331e9b2b5918898d164b3a74922a Mon Sep 17 00:00:00 2001 From: Tj Date: Wed, 13 Jan 2016 09:06:16 -0800 Subject: [PATCH 19/36] Rename license.md to LICENSE.md --- license.md => LICENSE.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename license.md => LICENSE.md (100%) diff --git a/license.md b/LICENSE.md similarity index 100% rename from license.md rename to LICENSE.md From bb41bde7e262051aff886c8511e1fd5c2cb2f187 Mon Sep 17 00:00:00 2001 From: Tj Date: Wed, 13 Jan 2016 09:07:36 -0800 Subject: [PATCH 20/36] Update LICENSE.md --- LICENSE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LICENSE.md b/LICENSE.md index e7586de..8d183ab 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,3 +1,4 @@ +``` /* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): @@ -6,3 +7,4 @@ * this stuff is worth it, you can buy me a beer in return. Tj Fallon * ---------------------------------------------------------------------------- */ +``` From 040887320af023a9ca766f6fb0716ec6c89fee7b Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Thu, 14 Jan 2016 09:38:48 +0100 Subject: [PATCH 21/36] PayPal iOS 2.13.0 --- ios/lib/Paypal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/lib/Paypal b/ios/lib/Paypal index e0b5f80..efcfab9 160000 --- a/ios/lib/Paypal +++ b/ios/lib/Paypal @@ -1 +1 @@ -Subproject commit e0b5f802c541084f88343dc033ac902feecbe4e0 +Subproject commit efcfab9308aba9382b0019ea17196731ba64e1b1 From dbcab7c7fac84d09ae2365fb7d56ce7a54185c1f Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Thu, 14 Jan 2016 09:53:52 +0100 Subject: [PATCH 22/36] Added PayPalMobile and CardIO --- .../project.pbxproj | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj b/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj index 6f2c805..16ba412 100644 --- a/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj +++ b/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj @@ -7,6 +7,10 @@ objects = { /* Begin PBXBuildFile section */ + 64976FFC1C47962B00C0178E /* libCardIO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64976FF01C47962B00C0178E /* libCardIO.a */; }; + 64976FFD1C47962B00C0178E /* libopencv_core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64976FF11C47962B00C0178E /* libopencv_core.a */; }; + 64976FFE1C47962B00C0178E /* libopencv_imgproc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64976FF21C47962B00C0178E /* libopencv_imgproc.a */; }; + 64976FFF1C47962B00C0178E /* libPayPalMobile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64976FF41C47962B00C0178E /* libPayPalMobile.a */; }; 64D7A23C1C46907F008FCDA3 /* MFLReactNativePayPal.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 64D7A23B1C46907F008FCDA3 /* MFLReactNativePayPal.h */; }; 64D7A23E1C46907F008FCDA3 /* MFLReactNativePayPal.m in Sources */ = {isa = PBXBuildFile; fileRef = 64D7A23D1C46907F008FCDA3 /* MFLReactNativePayPal.m */; }; /* End PBXBuildFile section */ @@ -25,6 +29,25 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 64976FE81C47962B00C0178E /* CardIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIO.h; sourceTree = ""; }; + 64976FE91C47962B00C0178E /* CardIOCreditCardInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOCreditCardInfo.h; sourceTree = ""; }; + 64976FEA1C47962B00C0178E /* CardIODetectionMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIODetectionMode.h; sourceTree = ""; }; + 64976FEB1C47962B00C0178E /* CardIOPaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOPaymentViewController.h; sourceTree = ""; }; + 64976FEC1C47962B00C0178E /* CardIOPaymentViewControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOPaymentViewControllerDelegate.h; sourceTree = ""; }; + 64976FED1C47962B00C0178E /* CardIOUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOUtilities.h; sourceTree = ""; }; + 64976FEE1C47962B00C0178E /* CardIOView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOView.h; sourceTree = ""; }; + 64976FEF1C47962B00C0178E /* CardIOViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOViewDelegate.h; sourceTree = ""; }; + 64976FF01C47962B00C0178E /* libCardIO.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libCardIO.a; sourceTree = ""; }; + 64976FF11C47962B00C0178E /* libopencv_core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopencv_core.a; sourceTree = ""; }; + 64976FF21C47962B00C0178E /* libopencv_imgproc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopencv_imgproc.a; sourceTree = ""; }; + 64976FF41C47962B00C0178E /* libPayPalMobile.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libPayPalMobile.a; sourceTree = ""; }; + 64976FF51C47962B00C0178E /* PayPalConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalConfiguration.h; sourceTree = ""; }; + 64976FF61C47962B00C0178E /* PayPalFuturePaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalFuturePaymentViewController.h; sourceTree = ""; }; + 64976FF71C47962B00C0178E /* PayPalMobile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalMobile.h; sourceTree = ""; }; + 64976FF81C47962B00C0178E /* PayPalOAuthScopes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalOAuthScopes.h; sourceTree = ""; }; + 64976FF91C47962B00C0178E /* PayPalPayment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalPayment.h; sourceTree = ""; }; + 64976FFA1C47962B00C0178E /* PayPalPaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalPaymentViewController.h; sourceTree = ""; }; + 64976FFB1C47962B00C0178E /* PayPalProfileSharingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalProfileSharingViewController.h; sourceTree = ""; }; 64D7A2381C46907F008FCDA3 /* libMFLReactNativePayPal.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMFLReactNativePayPal.a; sourceTree = BUILT_PRODUCTS_DIR; }; 64D7A23B1C46907F008FCDA3 /* MFLReactNativePayPal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MFLReactNativePayPal.h; sourceTree = ""; }; 64D7A23D1C46907F008FCDA3 /* MFLReactNativePayPal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MFLReactNativePayPal.m; sourceTree = ""; }; @@ -35,15 +58,56 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 64976FFC1C47962B00C0178E /* libCardIO.a in Frameworks */, + 64976FFD1C47962B00C0178E /* libopencv_core.a in Frameworks */, + 64976FFF1C47962B00C0178E /* libPayPalMobile.a in Frameworks */, + 64976FFE1C47962B00C0178E /* libopencv_imgproc.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 64976FE71C47962B00C0178E /* CardIO */ = { + isa = PBXGroup; + children = ( + 64976FE81C47962B00C0178E /* CardIO.h */, + 64976FE91C47962B00C0178E /* CardIOCreditCardInfo.h */, + 64976FEA1C47962B00C0178E /* CardIODetectionMode.h */, + 64976FEB1C47962B00C0178E /* CardIOPaymentViewController.h */, + 64976FEC1C47962B00C0178E /* CardIOPaymentViewControllerDelegate.h */, + 64976FED1C47962B00C0178E /* CardIOUtilities.h */, + 64976FEE1C47962B00C0178E /* CardIOView.h */, + 64976FEF1C47962B00C0178E /* CardIOViewDelegate.h */, + 64976FF01C47962B00C0178E /* libCardIO.a */, + 64976FF11C47962B00C0178E /* libopencv_core.a */, + 64976FF21C47962B00C0178E /* libopencv_imgproc.a */, + ); + name = CardIO; + path = lib/Paypal/CardIO; + sourceTree = ""; + }; + 64976FF31C47962B00C0178E /* PayPalMobile */ = { + isa = PBXGroup; + children = ( + 64976FF41C47962B00C0178E /* libPayPalMobile.a */, + 64976FF51C47962B00C0178E /* PayPalConfiguration.h */, + 64976FF61C47962B00C0178E /* PayPalFuturePaymentViewController.h */, + 64976FF71C47962B00C0178E /* PayPalMobile.h */, + 64976FF81C47962B00C0178E /* PayPalOAuthScopes.h */, + 64976FF91C47962B00C0178E /* PayPalPayment.h */, + 64976FFA1C47962B00C0178E /* PayPalPaymentViewController.h */, + 64976FFB1C47962B00C0178E /* PayPalProfileSharingViewController.h */, + ); + name = PayPalMobile; + path = lib/Paypal/PayPalMobile; + sourceTree = ""; + }; 64D7A22F1C46907F008FCDA3 = { isa = PBXGroup; children = ( + 64976FE71C47962B00C0178E /* CardIO */, + 64976FF31C47962B00C0178E /* PayPalMobile */, 64D7A23A1C46907F008FCDA3 /* MFLReactNativePayPal */, 64D7A2391C46907F008FCDA3 /* Products */, ); @@ -216,6 +280,11 @@ "$(SRCROOT)/node_modules/react-native/React/**", "$(SRCROOT)/../../react-native/React/**", ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/lib/Paypal/CardIO", + "$(PROJECT_DIR)/lib/Paypal/PayPalMobile", + ); ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -230,6 +299,11 @@ "$(SRCROOT)/node_modules/react-native/React/**", "$(SRCROOT)/../../react-native/React/**", ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/lib/Paypal/CardIO", + "$(PROJECT_DIR)/lib/Paypal/PayPalMobile", + ); PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; From e73c13164336cfb3dff0c0a021ee0579e7f20b67 Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Thu, 14 Jan 2016 10:01:21 +0100 Subject: [PATCH 23/36] Other Linker Flags --- ios/MFLReactNativePayPal.xcodeproj/project.pbxproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj b/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj index 16ba412..6b8f36e 100644 --- a/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj +++ b/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj @@ -286,6 +286,10 @@ "$(PROJECT_DIR)/lib/Paypal/PayPalMobile", ); ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "-lc++", + "-ObjC", + ); PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; @@ -304,6 +308,10 @@ "$(PROJECT_DIR)/lib/Paypal/CardIO", "$(PROJECT_DIR)/lib/Paypal/PayPalMobile", ); + OTHER_LDFLAGS = ( + "-lc++", + "-ObjC", + ); PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; From e84d3f117ce32206a8388af8f2253755dc3c29a8 Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Thu, 14 Jan 2016 10:23:38 +0100 Subject: [PATCH 24/36] Moved license to ios folder --- LICENSE.md => ios/LICENSE.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LICENSE.md => ios/LICENSE.md (100%) diff --git a/LICENSE.md b/ios/LICENSE.md similarity index 100% rename from LICENSE.md rename to ios/LICENSE.md From 10a81e1f3f8247e0ac4a3e68f119ce1d7707a860 Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Thu, 14 Jan 2016 10:24:59 +0100 Subject: [PATCH 25/36] Removed test project --- ios/ReactPaypal.xcodeproj/project.pbxproj | 737 ------------------ .../xcschemes/ReactPaypal.xcscheme | 112 --- ios/ReactPaypalTests/Info.plist | 24 - ios/ReactPaypalTests/ReactPaypalTests.m | 68 -- ios/iOS/AppDelegate.h | 16 - ios/iOS/AppDelegate.m | 60 -- ios/iOS/Base.lproj/LaunchScreen.xib | 42 - .../AppIcon.appiconset/Contents.json | 38 - ios/iOS/Info.plist | 42 - ios/iOS/main.jsbundle | 8 - ios/iOS/main.m | 18 - 11 files changed, 1165 deletions(-) delete mode 100644 ios/ReactPaypal.xcodeproj/project.pbxproj delete mode 100644 ios/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme delete mode 100644 ios/ReactPaypalTests/Info.plist delete mode 100644 ios/ReactPaypalTests/ReactPaypalTests.m delete mode 100644 ios/iOS/AppDelegate.h delete mode 100644 ios/iOS/AppDelegate.m delete mode 100644 ios/iOS/Base.lproj/LaunchScreen.xib delete mode 100644 ios/iOS/Images.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 ios/iOS/Info.plist delete mode 100644 ios/iOS/main.jsbundle delete mode 100644 ios/iOS/main.m diff --git a/ios/ReactPaypal.xcodeproj/project.pbxproj b/ios/ReactPaypal.xcodeproj/project.pbxproj deleted file mode 100644 index 9c522c7..0000000 --- a/ios/ReactPaypal.xcodeproj/project.pbxproj +++ /dev/null @@ -1,737 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 008F07F21AC5B25A0029DE68 /* main.jsbundle */; }; - 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; - 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; - 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; - 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; - 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; - 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; - 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; - 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; - 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; - 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; - 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; - 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; - 32A2D8201B38C9820037584B /* MFLReactNativePayPal.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A2D81F1B38C9820037584B /* MFLReactNativePayPal.m */; }; - 32A2D8321B38C9C30037584B /* libPayPalMobile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D82A1B38C9C30037584B /* libPayPalMobile.a */; }; - 32A2D8341B38D0900037584B /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D8331B38D0900037584B /* Accelerate.framework */; }; - 32A2D8361B38D0950037584B /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D8351B38D0950037584B /* AudioToolbox.framework */; }; - 32A2D8381B38D09A0037584B /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D8371B38D09A0037584B /* AVFoundation.framework */; }; - 32A2D83A1B38D09E0037584B /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D8391B38D09E0037584B /* CoreLocation.framework */; }; - 32A2D83C1B38D0A30037584B /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D83B1B38D0A30037584B /* CoreMedia.framework */; }; - 32A2D83E1B38D0A70037584B /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D83D1B38D0A70037584B /* MessageUI.framework */; }; - 32A2D8401B38D0AC0037584B /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D83F1B38D0AC0037584B /* MobileCoreServices.framework */; }; - 32A2D8421B38D0B20037584B /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D8411B38D0B20037584B /* SystemConfiguration.framework */; }; - 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 134814201AA4EA6300B7C361; - remoteInfo = RCTActionSheet; - }; - 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 134814201AA4EA6300B7C361; - remoteInfo = RCTGeolocation; - }; - 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B5115D1A9E6B3D00147676; - remoteInfo = RCTImage; - }; - 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B511DB1A9E6C8500147676; - remoteInfo = RCTNetwork; - }; - 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; - remoteInfo = RCTVibration; - }; - 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 134814201AA4EA6300B7C361; - remoteInfo = RCTSettings; - }; - 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 3C86DF461ADF2C930047B81A; - remoteInfo = RCTWebSocket; - }; - 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; - remoteInfo = React; - }; - 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 134814201AA4EA6300B7C361; - remoteInfo = RCTLinking; - }; - 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B5119B1A9E6C1200147676; - remoteInfo = RCTText; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = iOS/main.jsbundle; sourceTree = ""; }; - 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; - 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; - 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; - 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; - 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; - 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 00E356F21AD99517003FC87E /* ReactPaypalTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactPaypalTests.m; sourceTree = ""; }; - 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; - 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; - 13B07F961A680F5B00A75B9A /* ReactPaypal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReactPaypal.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = iOS/AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = iOS/AppDelegate.m; sourceTree = ""; }; - 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = iOS/Images.xcassets; sourceTree = ""; }; - 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = iOS/Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = iOS/main.m; sourceTree = ""; }; - 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; - 32A2D81E1B38C9820037584B /* MFLReactNativePayPal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFLReactNativePayPal.h; sourceTree = ""; }; - 32A2D81F1B38C9820037584B /* MFLReactNativePayPal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFLReactNativePayPal.m; sourceTree = ""; }; - 32A2D8221B38C9C30037584B /* CardIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIO.h; sourceTree = ""; }; - 32A2D8231B38C9C30037584B /* CardIOCreditCardInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOCreditCardInfo.h; sourceTree = ""; }; - 32A2D8241B38C9C30037584B /* CardIODetectionMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIODetectionMode.h; sourceTree = ""; }; - 32A2D8251B38C9C30037584B /* CardIOPaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOPaymentViewController.h; sourceTree = ""; }; - 32A2D8261B38C9C30037584B /* CardIOPaymentViewControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOPaymentViewControllerDelegate.h; sourceTree = ""; }; - 32A2D8271B38C9C30037584B /* CardIOUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOUtilities.h; sourceTree = ""; }; - 32A2D8281B38C9C30037584B /* CardIOView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOView.h; sourceTree = ""; }; - 32A2D8291B38C9C30037584B /* CardIOViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOViewDelegate.h; sourceTree = ""; }; - 32A2D82A1B38C9C30037584B /* libPayPalMobile.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libPayPalMobile.a; sourceTree = ""; }; - 32A2D82B1B38C9C30037584B /* PayPalConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalConfiguration.h; sourceTree = ""; }; - 32A2D82C1B38C9C30037584B /* PayPalFuturePaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalFuturePaymentViewController.h; sourceTree = ""; }; - 32A2D82D1B38C9C30037584B /* PayPalMobile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalMobile.h; sourceTree = ""; }; - 32A2D82E1B38C9C30037584B /* PayPalOAuthScopes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalOAuthScopes.h; sourceTree = ""; }; - 32A2D82F1B38C9C30037584B /* PayPalPayment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalPayment.h; sourceTree = ""; }; - 32A2D8301B38C9C30037584B /* PayPalPaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalPaymentViewController.h; sourceTree = ""; }; - 32A2D8311B38C9C30037584B /* PayPalProfileSharingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalProfileSharingViewController.h; sourceTree = ""; }; - 32A2D8331B38D0900037584B /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; - 32A2D8351B38D0950037584B /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; - 32A2D8371B38D09A0037584B /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; - 32A2D8391B38D09E0037584B /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; - 32A2D83B1B38D0A30037584B /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; - 32A2D83D1B38D0A70037584B /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; - 32A2D83F1B38D0AC0037584B /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; - 32A2D8411B38D0B20037584B /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; - 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; - 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 32A2D8421B38D0B20037584B /* SystemConfiguration.framework in Frameworks */, - 32A2D8401B38D0AC0037584B /* MobileCoreServices.framework in Frameworks */, - 32A2D83E1B38D0A70037584B /* MessageUI.framework in Frameworks */, - 32A2D83C1B38D0A30037584B /* CoreMedia.framework in Frameworks */, - 32A2D83A1B38D09E0037584B /* CoreLocation.framework in Frameworks */, - 32A2D8381B38D09A0037584B /* AVFoundation.framework in Frameworks */, - 32A2D8361B38D0950037584B /* AudioToolbox.framework in Frameworks */, - 32A2D8341B38D0900037584B /* Accelerate.framework in Frameworks */, - 146834051AC3E58100842450 /* libReact.a in Frameworks */, - 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, - 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, - 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, - 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, - 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, - 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, - 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, - 32A2D8321B38C9C30037584B /* libPayPalMobile.a in Frameworks */, - 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, - 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 00C302A81ABCB8CE00DB3ED1 /* Products */ = { - isa = PBXGroup; - children = ( - 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, - ); - name = Products; - sourceTree = ""; - }; - 00C302B61ABCB90400DB3ED1 /* Products */ = { - isa = PBXGroup; - children = ( - 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, - ); - name = Products; - sourceTree = ""; - }; - 00C302BC1ABCB91800DB3ED1 /* Products */ = { - isa = PBXGroup; - children = ( - 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, - ); - name = Products; - sourceTree = ""; - }; - 00C302D41ABCB9D200DB3ED1 /* Products */ = { - isa = PBXGroup; - children = ( - 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, - ); - name = Products; - sourceTree = ""; - }; - 00C302E01ABCB9EE00DB3ED1 /* Products */ = { - isa = PBXGroup; - children = ( - 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, - ); - name = Products; - sourceTree = ""; - }; - 00E356EF1AD99517003FC87E /* ReactPaypalTests */ = { - isa = PBXGroup; - children = ( - 00E356F21AD99517003FC87E /* ReactPaypalTests.m */, - 00E356F01AD99517003FC87E /* Supporting Files */, - ); - path = ReactPaypalTests; - sourceTree = ""; - }; - 00E356F01AD99517003FC87E /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 00E356F11AD99517003FC87E /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 139105B71AF99BAD00B5F7CC /* Products */ = { - isa = PBXGroup; - children = ( - 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, - ); - name = Products; - sourceTree = ""; - }; - 139FDEE71B06529A00C62182 /* Products */ = { - isa = PBXGroup; - children = ( - 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, - ); - name = Products; - sourceTree = ""; - }; - 13B07FAE1A68108700A75B9A /* ReactPaypal */ = { - isa = PBXGroup; - children = ( - 008F07F21AC5B25A0029DE68 /* main.jsbundle */, - 13B07FAF1A68108700A75B9A /* AppDelegate.h */, - 13B07FB01A68108700A75B9A /* AppDelegate.m */, - 13B07FB51A68108700A75B9A /* Images.xcassets */, - 13B07FB61A68108700A75B9A /* Info.plist */, - 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, - 13B07FB71A68108700A75B9A /* main.m */, - 32A2D8131B38C96C0037584B /* MFLReactNativePayPal */, - ); - name = ReactPaypal; - sourceTree = ""; - }; - 146834001AC3E56700842450 /* Products */ = { - isa = PBXGroup; - children = ( - 146834041AC3E56700842450 /* libReact.a */, - ); - name = Products; - sourceTree = ""; - }; - 32A2D8131B38C96C0037584B /* MFLReactNativePayPal */ = { - isa = PBXGroup; - children = ( - 32A2D81E1B38C9820037584B /* MFLReactNativePayPal.h */, - 32A2D81F1B38C9820037584B /* MFLReactNativePayPal.m */, - ); - path = MFLReactNativePayPal; - sourceTree = ""; - }; - 32A2D8211B38C9C30037584B /* PayPalMobile */ = { - isa = PBXGroup; - children = ( - 32A2D8221B38C9C30037584B /* CardIO.h */, - 32A2D8231B38C9C30037584B /* CardIOCreditCardInfo.h */, - 32A2D8241B38C9C30037584B /* CardIODetectionMode.h */, - 32A2D8251B38C9C30037584B /* CardIOPaymentViewController.h */, - 32A2D8261B38C9C30037584B /* CardIOPaymentViewControllerDelegate.h */, - 32A2D8271B38C9C30037584B /* CardIOUtilities.h */, - 32A2D8281B38C9C30037584B /* CardIOView.h */, - 32A2D8291B38C9C30037584B /* CardIOViewDelegate.h */, - 32A2D82A1B38C9C30037584B /* libPayPalMobile.a */, - 32A2D82B1B38C9C30037584B /* PayPalConfiguration.h */, - 32A2D82C1B38C9C30037584B /* PayPalFuturePaymentViewController.h */, - 32A2D82D1B38C9C30037584B /* PayPalMobile.h */, - 32A2D82E1B38C9C30037584B /* PayPalOAuthScopes.h */, - 32A2D82F1B38C9C30037584B /* PayPalPayment.h */, - 32A2D8301B38C9C30037584B /* PayPalPaymentViewController.h */, - 32A2D8311B38C9C30037584B /* PayPalProfileSharingViewController.h */, - ); - name = PayPalMobile; - path = lib/Paypal/PayPalMobile; - sourceTree = ""; - }; - 78C398B11ACF4ADC00677621 /* Products */ = { - isa = PBXGroup; - children = ( - 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, - ); - name = Products; - sourceTree = ""; - }; - 832341AE1AAA6A7D00B99B32 /* Libraries */ = { - isa = PBXGroup; - children = ( - 32A2D8211B38C9C30037584B /* PayPalMobile */, - 146833FF1AC3E56700842450 /* React.xcodeproj */, - 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, - 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, - 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, - 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, - 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, - 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, - 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, - 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, - 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, - ); - name = Libraries; - sourceTree = ""; - }; - 832341B11AAA6A8300B99B32 /* Products */ = { - isa = PBXGroup; - children = ( - 832341B51AAA6A8300B99B32 /* libRCTText.a */, - ); - name = Products; - sourceTree = ""; - }; - 83CBB9F61A601CBA00E9B192 = { - isa = PBXGroup; - children = ( - 32A2D8411B38D0B20037584B /* SystemConfiguration.framework */, - 32A2D83F1B38D0AC0037584B /* MobileCoreServices.framework */, - 32A2D83D1B38D0A70037584B /* MessageUI.framework */, - 32A2D83B1B38D0A30037584B /* CoreMedia.framework */, - 32A2D8391B38D09E0037584B /* CoreLocation.framework */, - 32A2D8371B38D09A0037584B /* AVFoundation.framework */, - 32A2D8351B38D0950037584B /* AudioToolbox.framework */, - 32A2D8331B38D0900037584B /* Accelerate.framework */, - 13B07FAE1A68108700A75B9A /* ReactPaypal */, - 832341AE1AAA6A7D00B99B32 /* Libraries */, - 00E356EF1AD99517003FC87E /* ReactPaypalTests */, - 83CBBA001A601CBA00E9B192 /* Products */, - ); - indentWidth = 2; - sourceTree = ""; - tabWidth = 2; - }; - 83CBBA001A601CBA00E9B192 /* Products */ = { - isa = PBXGroup; - children = ( - 13B07F961A680F5B00A75B9A /* ReactPaypal.app */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 13B07F861A680F5B00A75B9A /* ReactPaypal */ = { - isa = PBXNativeTarget; - buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactPaypal" */; - buildPhases = ( - 13B07F871A680F5B00A75B9A /* Sources */, - 13B07F8C1A680F5B00A75B9A /* Frameworks */, - 13B07F8E1A680F5B00A75B9A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ReactPaypal; - productName = "Hello World"; - productReference = 13B07F961A680F5B00A75B9A /* ReactPaypal.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 83CBB9F71A601CBA00E9B192 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0610; - ORGANIZATIONNAME = Facebook; - }; - buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactPaypal" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 83CBB9F61A601CBA00E9B192; - productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; - ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; - }, - { - ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; - ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; - }, - { - ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; - ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; - }, - { - ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; - ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; - }, - { - ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; - ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; - }, - { - ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; - ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; - }, - { - ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; - ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; - }, - { - ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; - ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; - }, - { - ProductGroup = 139FDEE71B06529A00C62182 /* Products */; - ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; - }, - { - ProductGroup = 146834001AC3E56700842450 /* Products */; - ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 13B07F861A680F5B00A75B9A /* ReactPaypal */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTActionSheet.a; - remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTGeolocation.a; - remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTImage.a; - remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTNetwork.a; - remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTVibration.a; - remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTSettings.a; - remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTWebSocket.a; - remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 146834041AC3E56700842450 /* libReact.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libReact.a; - remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTLinking.a; - remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTText.a; - remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 13B07F8E1A680F5B00A75B9A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */, - 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, - 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 13B07F871A680F5B00A75B9A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 32A2D8201B38C9820037584B /* MFLReactNativePayPal.m in Sources */, - 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, - 13B07FC11A68108700A75B9A /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - 13B07FB21A68108700A75B9A /* Base */, - ); - name = LaunchScreen.xib; - path = iOS; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 13B07F941A680F5B00A75B9A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "\"$(SRCROOT)/node_modules/react-native/React\"/**", - ); - INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/lib/Paypal/PayPalMobile", - ); - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - ); - PRODUCT_NAME = ReactPaypal; - }; - name = Debug; - }; - 13B07F951A680F5B00A75B9A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "\"$(SRCROOT)/node_modules/react-native/React\"/**", - ); - INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/lib/Paypal/PayPalMobile", - ); - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - ); - PRODUCT_NAME = ReactPaypal; - }; - name = Release; - }; - 83CBBA201A601CBA00E9B192 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/node_modules/react-native/React/**", - ); - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 83CBBA211A601CBA00E9B192 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/node_modules/react-native/React/**", - ); - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactPaypal" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 13B07F941A680F5B00A75B9A /* Debug */, - 13B07F951A680F5B00A75B9A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactPaypal" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 83CBBA201A601CBA00E9B192 /* Debug */, - 83CBBA211A601CBA00E9B192 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; -} diff --git a/ios/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme b/ios/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme deleted file mode 100644 index ec0f74b..0000000 --- a/ios/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/ReactPaypalTests/Info.plist b/ios/ReactPaypalTests/Info.plist deleted file mode 100644 index 886825c..0000000 --- a/ios/ReactPaypalTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/ios/ReactPaypalTests/ReactPaypalTests.m b/ios/ReactPaypalTests/ReactPaypalTests.m deleted file mode 100644 index 31fc729..0000000 --- a/ios/ReactPaypalTests/ReactPaypalTests.m +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import -#import - -#import "RCTAssert.h" -#import "RCTRedBox.h" -#import "RCTRootView.h" - -#define TIMEOUT_SECONDS 240 -#define TEXT_TO_LOOK_FOR @"Welcome to React Native!" - -@interface ReactPaypalTests : XCTestCase - -@end - -@implementation ReactPaypalTests - - -- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test -{ - if (test(view)) { - return YES; - } - for (UIView *subview in [view subviews]) { - if ([self findSubviewInView:subview matching:test]) { - return YES; - } - } - return NO; -} - -- (void)testRendersWelcomeScreen { - UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; - NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; - BOOL foundElement = NO; - NSString *redboxError = nil; - - while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { - [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - - redboxError = [[RCTRedBox sharedInstance] currentErrorMessage]; - - foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { - if ([view respondsToSelector:@selector(attributedText)]) { - NSString *text = [(id)view attributedText].string; - if ([text isEqualToString:TEXT_TO_LOOK_FOR]) { - return YES; - } - } - return NO; - }]; - } - - XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); - XCTAssertTrue(foundElement, @"Cound't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); -} - - -@end diff --git a/ios/iOS/AppDelegate.h b/ios/iOS/AppDelegate.h deleted file mode 100644 index a9654d5..0000000 --- a/ios/iOS/AppDelegate.h +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -@interface AppDelegate : UIResponder - -@property (nonatomic, strong) UIWindow *window; - -@end diff --git a/ios/iOS/AppDelegate.m b/ios/iOS/AppDelegate.m deleted file mode 100644 index 8b16bec..0000000 --- a/ios/iOS/AppDelegate.m +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "AppDelegate.h" - -#import "RCTRootView.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - NSURL *jsCodeLocation; - - /** - * Loading JavaScript code - uncomment the one you want. - * - * OPTION 1 - * Load from development server. Start the server from the repository root: - * - * $ npm start - * - * To run on device, change `localhost` to the IP address of your computer - * (you can get this by typing `ifconfig` into the terminal and selecting the - * `inet` value under `en0:`) and make sure your computer and iOS device are - * on the same Wi-Fi network. - */ - - jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"]; - - /** - * OPTION 2 - * Load from pre-bundled file on disk. To re-generate the static bundle - * from the root of your project directory, run - * - * $ react-native bundle --minify - * - * see http://facebook.github.io/react-native/docs/runningondevice.html - */ - -// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; - - RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation - moduleName:@"ReactPaypal" - launchOptions:launchOptions]; - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [[UIViewController alloc] init]; - rootViewController.view = rootView; - self.window.rootViewController = rootViewController; - [self.window makeKeyAndVisible]; - return YES; -} - -@end diff --git a/ios/iOS/Base.lproj/LaunchScreen.xib b/ios/iOS/Base.lproj/LaunchScreen.xib deleted file mode 100644 index 2f81a12..0000000 --- a/ios/iOS/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/iOS/Images.xcassets/AppIcon.appiconset/Contents.json b/ios/iOS/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 118c98f..0000000 --- a/ios/iOS/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ios/iOS/Info.plist b/ios/iOS/Info.plist deleted file mode 100644 index 0a56a6e..0000000 --- a/ios/iOS/Info.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - NSLocationWhenInUseUsageDescription - - - diff --git a/ios/iOS/main.jsbundle b/ios/iOS/main.jsbundle deleted file mode 100644 index b702b30..0000000 --- a/ios/iOS/main.jsbundle +++ /dev/null @@ -1,8 +0,0 @@ -// Offline JS -// To re-generate the offline bundle, run this from the root of your project: -// -// $ react-native bundle --minify -// -// See http://facebook.github.io/react-native/docs/runningondevice.html for more details. - -throw new Error('Offline JS file is empty. See iOS/main.jsbundle for instructions'); diff --git a/ios/iOS/main.m b/ios/iOS/main.m deleted file mode 100644 index 3d767fc..0000000 --- a/ios/iOS/main.m +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} From f5ddd9a2b750ba4ee4988637f3c6fa3688bda752 Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Thu, 14 Jan 2016 13:54:28 +0100 Subject: [PATCH 26/36] Simple payment working in iOS --- index.js | 40 ++++++++++++++++--- .../MFLReactNativePayPal.m | 2 +- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 11dee5c..297482c 100644 --- a/index.js +++ b/index.js @@ -1,15 +1,45 @@ 'use strict'; +var {NativeModules, Platform} = require('react-native') +var {PayPal, MFLReactNativePayPal} = NativeModules; -var {PayPal} = require('react-native').NativeModules; +var constants; -var constants = {}; -var constantNames = Object.keys(PayPal).filter(p => p == p.toUpperCase()); -constantNames.forEach(c => constants[c] = PayPal[c]); +if (Platform.OS === 'android') { + constants = {}; + var constantNames = Object.keys(PayPal).filter(p => p == p.toUpperCase()); + constantNames.forEach(c => constants[c] = PayPal[c]); +} else { + constants = { + SANDBOX: 0, + PRODUCTION: 1, + NO_NETWORK: 2, + + USER_CANCELLED: 'USER_CANCELLED', + INVALID_CONFIG: 'INVALID_CONFIG' + } +} var functions = { paymentRequest(payPalParameters) { return new Promise(function(resolve, reject) { - PayPal.paymentRequest(payPalParameters, resolve, reject); + if (Platform.OS === 'android') { + PayPal.paymentRequest(payPalParameters, resolve, reject); + } else { + MFLReactNativePayPal.initializePaypalEnvironment(payPalParameters.environment, payPalParameters.clientId); + MFLReactNativePayPal.preparePaymentOfAmount(parseFloat(payPalParameters.price), payPalParameters.currency, payPalParameters.description); + MFLReactNativePayPal.prepareConfigurationForMerchant("Shape A Future", true, "spenden@aktion-europa-hilft.de"); + MFLReactNativePayPal.presentPaymentViewControllerForPreparedPurchase((error, payload) => { + if (error) { + reject(constants.INVALID_CONFIG, error) + } else { + if (payload.status === 1) { + resolve(payload); + } else { + reject(constants.USER_CANCELLED, payload); + } + } + }); + } }); } }; diff --git a/ios/MFLReactNativePayPal/MFLReactNativePayPal.m b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m index 92e77cd..936bda9 100644 --- a/ios/MFLReactNativePayPal/MFLReactNativePayPal.m +++ b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m @@ -25,7 +25,7 @@ @implementation MFLReactNativePayPal RCT_EXPORT_MODULE(); -RCT_EXPORT_METHOD(initializePaypalEnvironment:(PayPalEnvironment)environment +RCT_EXPORT_METHOD(initializePaypalEnvironment:(int)environment forClientId:(NSString *)clientId ) { dispatch_async(dispatch_get_main_queue(), ^{ From 62e9827dd74cf9e67d10110dd3744da2ec588356 Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Thu, 14 Jan 2016 14:29:40 +0100 Subject: [PATCH 27/36] Updated package.json with information from deleted ios/package.json --- ios/package.json | 22 ---------------------- package.json | 8 ++++++-- 2 files changed, 6 insertions(+), 24 deletions(-) delete mode 100644 ios/package.json diff --git a/ios/package.json b/ios/package.json deleted file mode 100644 index 75c865a..0000000 --- a/ios/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "react-paypal", - "version": "0.0.1", - "private": false, - "scripts": { - "start": "node_modules/react-native/packager/packager.sh" - }, - "keywords": [ - "react-component", - "react-native", - "ios" - ], - "repository": { - "type": "git", - "url": "git@github.com:MattFoley/react-native-paypal.git" - }, - "dependencies": { - "react-native": "^0.5.0" - }, - "main":"index.ios.js", - "author": "iOSGuy (http://github.com/MattFoley)" -} diff --git a/package.json b/package.json index 32ca378..caeab93 100644 --- a/package.json +++ b/package.json @@ -12,13 +12,17 @@ "react-component", "react-native", "pay-pal", - "android" + "android", + "ios" ], "author": "contato@vizir.com.br", + "contributors": [ + "iOSGuy (http://github.com/MattFoley)", + "Timo Uhlmann (http://github.com/amiuhle)" + ], "license": "MIT", "bugs": { "url": "https://github.com/vizir/react-native-paypal/issues" }, "homepage": "https://github.com/vizir/react-native-paypal" } - From 2ecfd0c18b3f329fab1890d5480cb2d37058fa78 Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Thu, 14 Jan 2016 14:45:35 +0100 Subject: [PATCH 28/36] Removed ios/index.ios.js --- ios/index.ios.js | 81 ------------------------------------------------ 1 file changed, 81 deletions(-) delete mode 100644 ios/index.ios.js diff --git a/ios/index.ios.js b/ios/index.ios.js deleted file mode 100644 index a516bb2..0000000 --- a/ios/index.ios.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Sample React Native App - * https://github.com/facebook/react-native - */ -'use strict'; - -var MFLReactNativePayPal = require('NativeModules').MFLReactNativePayPal; -var React = require('react-native'); - -var { - AppRegistry, - StyleSheet, - Text, - View, - TouchableHighlight -} = React; - -var ReactPaypal = React.createClass({ - componentDidMount: function() { - console.log("Component did mount"); - MFLReactNativePayPal.initializePaypalEnvironment(0, - "AWyPKtVl7ac7SOlIscEe-dONGB-oBYav2TwimOgB1FysVGcKneAkj_1O1LV-Vnr0PEeMk5NmweJfIiLm"); - }, - - _onPressButton: function() { - MFLReactNativePayPal.preparePaymentOfAmount(100.00, "USD", "Bacon"); - MFLReactNativePayPal.prepareConfigurationForMerchant("Bacon Truck", true, "bacon@bacon.com"); - MFLReactNativePayPal.presentPaymentViewControllerForPreparedPurchase((error, payload) => { - if (error) { - //Handle Error - return; - } else { - - console.log("payload: " + payload); - if (payload.status == 1) { - console.log(payload.confirmation); - } else { - console.log("User cancelled payment"); - } - } - }); - }, - - render: function() { - return ( - - - - - Tap To Initiate Paypal Test - - - Use test user "bacon@react.com" password "Password!". - - - - - ); - } -}); - -var styles = StyleSheet.create({ - container: { - flex: 1, - justifyContent: 'center', - alignItems: 'center', - backgroundColor: '#F5FCFF', - }, - welcome: { - fontSize: 20, - textAlign: 'center', - margin: 10, - }, - instructions: { - textAlign: 'center', - color: '#333333', - marginBottom: 5, - }, -}); - -AppRegistry.registerComponent('ReactPaypal', () => ReactPaypal); From 95a4831a1ccb53cddc64176b5ceecdefc372cbb7 Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Thu, 14 Jan 2016 17:22:55 +0100 Subject: [PATCH 29/36] Updated README with iOS installation instructions --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b8fd2db..1cd4336 100644 --- a/README.md +++ b/README.md @@ -152,13 +152,19 @@ iOS --- ### TODO: -- Automated tests -- iOS version -- Future payment (subscriptions) -Paypal wrapper for React Native, currently only supports the bare minimum of buying a product. +* [ ] Automated tests +* [ ] Future payment (subscriptions) ### Integration +Install the PayPal-iOS-SDK into `node_modules/react-native-paypal/ios/lib/Paypal` + +Here's a one-liner to download and unpack version `2.13.0`: + +```shell +mkdir -p node_modules/react-native-paypal/ios/lib/Paypal && curl -L --progress https://github.com/paypal/PayPal-iOS-SDK/archive/2.13.0.tar.gz | tar -xz - -C node_modules/react-native-paypal/ios/lib/Paypal --strip-components=1 +``` + Include PayPal as normally, following their directions. Their integration steps and iOS SDK can be found [here](https://github.com/paypal/PayPal-iOS-SDK). After doing that, also drag MFLReactNativePayPal.h and MFLReactNativePayPal.m into your project. ### Initialization: From 5ca3a94625ba5072ea9ccc9a13ed7f41a9aa3090 Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Thu, 14 Jan 2016 17:51:13 +0100 Subject: [PATCH 30/36] Finished installation instructions for iOS --- README.md | 55 +++++++++++++++++-------------------------------------- 1 file changed, 17 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 1cd4336..073f16b 100644 --- a/README.md +++ b/README.md @@ -152,56 +152,35 @@ iOS --- ### TODO: + +* [ ] Refactor & cleanup * [ ] Automated tests * [ ] Future payment (subscriptions) -### Integration - -Install the PayPal-iOS-SDK into `node_modules/react-native-paypal/ios/lib/Paypal` +### Installation -Here's a one-liner to download and unpack version `2.13.0`: +Currently you have to install via `npm` from GitHub (or change the version specifier in `package.json` to `zeroseven/react-native-paypal#ios`): ```shell -mkdir -p node_modules/react-native-paypal/ios/lib/Paypal && curl -L --progress https://github.com/paypal/PayPal-iOS-SDK/archive/2.13.0.tar.gz | tar -xz - -C node_modules/react-native-paypal/ios/lib/Paypal --strip-components=1 +npm install --save zeroseven/react-native-paypal#ios ``` -Include PayPal as normally, following their directions. Their integration steps and iOS SDK can be found [here](https://github.com/paypal/PayPal-iOS-SDK). After doing that, also drag MFLReactNativePayPal.h and MFLReactNativePayPal.m into your project. - -### Initialization: - - var MFLReactNativePayPal = require('NativeModules').MFLReactNativePayPal; - MFLReactNativePayPal.initializePaypalEnvironment(, ""); - -##### Environment Values that should be used here are declared in MFLReactNativePayPal.h +#### Install the PayPal-iOS-SDK - • Sandbox = 0 - • Production = 1 - • No Network = 2 +You then have to install the PayPal-iOS-SDK into `node_modules/react-native-paypal/ios/lib/Paypal` -### Prepare a Payment: - - MFLReactNativePayPal.preparePaymentOfAmount(, , ); - ie: MFLReactNativePayPal.preparePaymentOfAmount(100.00, "USD", "Bacon"); - -### Prepare Configuration: +Here's a one-liner to download and unpack version `2.13.0`: - MFLReactNativePayPal.prepareConfigurationForMerchant(, , ); - MFLReactNativePayPal.prepareConfigurationForMerchant("Bacon Truck", true, "bacon@bacon.com"); +```shell +mkdir -p node_modules/react-native-paypal/ios/lib/Paypal && curl -L --progress https://github.com/paypal/PayPal-iOS-SDK/archive/2.13.0.tar.gz | tar -xz - -C node_modules/react-native-paypal/ios/lib/Paypal --strip-components=1 +``` +Include PayPal as normally, following their directions. Their integration steps and iOS SDK can be found [here](https://github.com/paypal/PayPal-iOS-SDK). After doing that, also drag MFLReactNativePayPal.h and MFLReactNativePayPal.m into your project. -### Present the payment flow with a completion handler: +#### Add `MFLReactNativePayPal.xcodeproj` - MFLReactNativePayPal.presentPaymentViewControllerForPreparedPurchase((error, payload) => { - if (error) { - //Handle Error - return; - } else { +Add `node_modules/react-native-paypal/ios/MFLReactNativePayPal.xcodeproj` +to the `Libraries` group in iOS and link `libMFLReactNativePayPal.a` as described in Step 2 of the +[React Native Manual Linking docs](https://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking). - console.log("payload: " + payload); - if (payload.status == 1) { - console.log(payload.confirmation); - } else { - console.log("User cancelled payment"); - } - } - }); +Follow steps 4 and 5 of [the PayPal instalation instructions](https://github.com/paypal/PayPal-iOS-SDK#if-you-dont-use-cocoapods-then), as well as the [additional steps here](https://github.com/paypal/PayPal-iOS-SDK#with-or-without-cocoapods). **This has to be done for the main app, not for the library you included.** From 18e20edda7d9c8ce41a78dd8de3eab2badded319 Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Fri, 15 Jan 2016 11:45:07 +0100 Subject: [PATCH 31/36] Using strings for price in iOS --- index.js | 2 +- ios/MFLReactNativePayPal/MFLReactNativePayPal.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 297482c..9d7793d 100644 --- a/index.js +++ b/index.js @@ -26,7 +26,7 @@ var functions = { PayPal.paymentRequest(payPalParameters, resolve, reject); } else { MFLReactNativePayPal.initializePaypalEnvironment(payPalParameters.environment, payPalParameters.clientId); - MFLReactNativePayPal.preparePaymentOfAmount(parseFloat(payPalParameters.price), payPalParameters.currency, payPalParameters.description); + MFLReactNativePayPal.preparePaymentOfAmount(payPalParameters.price, payPalParameters.currency, payPalParameters.description); MFLReactNativePayPal.prepareConfigurationForMerchant("Shape A Future", true, "spenden@aktion-europa-hilft.de"); MFLReactNativePayPal.presentPaymentViewControllerForPreparedPurchase((error, payload) => { if (error) { diff --git a/ios/MFLReactNativePayPal/MFLReactNativePayPal.m b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m index 936bda9..6601b1e 100644 --- a/ios/MFLReactNativePayPal/MFLReactNativePayPal.m +++ b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m @@ -38,12 +38,12 @@ @implementation MFLReactNativePayPal #pragma mark React Exported Methods -RCT_EXPORT_METHOD(preparePaymentOfAmount:(CGFloat)amount +RCT_EXPORT_METHOD(preparePaymentOfAmount:(NSString *)amount ofCurrency:(NSString *)currencyCode withDescription:(NSString *)description) { self.payment = [[PayPalPayment alloc] init]; - [self.payment setAmount:[[NSDecimalNumber alloc] initWithFloat:amount]]; + [self.payment setAmount:[[NSDecimalNumber alloc] initWithString:amount]]; [self.payment setCurrencyCode:currencyCode]; [self.payment setShortDescription:description]; } From a2519aea1d1482f8cdc3222d4edbb192090805fe Mon Sep 17 00:00:00 2001 From: andrey Date: Thu, 21 Apr 2016 17:12:29 +0300 Subject: [PATCH 32/36] added support for future payments --- .../java/br/com/vizir/rn/paypal/PayPal.java | 94 +++++++++++++++++-- .../br/com/vizir/rn/paypal/PayPalPackage.java | 6 +- index.js | 14 ++- 3 files changed, 102 insertions(+), 12 deletions(-) diff --git a/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java b/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java index d47300a..3bec17a 100644 --- a/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java +++ b/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java @@ -3,12 +3,15 @@ import android.app.Activity; import android.content.Context; import android.content.Intent; +import android.net.Uri; +import android.util.Log; import com.facebook.react.bridge.Callback; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableMap; +import com.facebook.react.bridge.Promise; import com.paypal.android.sdk.payments.PayPalAuthorization; import com.paypal.android.sdk.payments.PayPalConfiguration; @@ -16,14 +19,14 @@ import com.paypal.android.sdk.payments.PayPalService; import com.paypal.android.sdk.payments.PaymentActivity; import com.paypal.android.sdk.payments.PaymentConfirmation; +import com.paypal.android.sdk.payments.PayPalFuturePaymentActivity; import java.util.Map; import java.util.HashMap; import java.math.BigDecimal; -public class PayPal extends ReactContextBaseJavaModule { - private final int paymentIntentRequestCode; +public class PayPal extends ReactContextBaseJavaModule { private static final String ERROR_USER_CANCELLED = "USER_CANCELLED"; private static final String ERROR_INVALID_CONFIG = "INVALID_CONFIG"; @@ -33,11 +36,13 @@ public class PayPal extends ReactContextBaseJavaModule { private Context activityContext; private Activity currentActivity; - public PayPal(ReactApplicationContext reactContext, Context activityContext, int requestCode) { + private static final int REQUEST_CODE_PAYMENT = 1; + private static final int REQUEST_CODE_FUTURE_PAYMENT = 2; + + public PayPal(ReactApplicationContext reactContext, Context activityContext) { super(reactContext); this.activityContext = activityContext; this.currentActivity = (Activity)activityContext; - this.paymentIntentRequestCode = requestCode; } @Override @@ -57,6 +62,54 @@ public String getName() { return constants; } + @ReactMethod + public void getMetadataId( + final Callback successCallback, + final Callback errorCallback + ) { + try { + String metadataId = PayPalConfiguration.getClientMetadataId(currentActivity); + successCallback.invoke(metadataId); + } catch (Exception e) { + errorCallback.invoke(e); + } + } + + @ReactMethod + public void futurePayment( + final ReadableMap payPalParameters, + final Callback successCallback, + final Callback errorCallback + ) { + this.successCallback = successCallback; + this.errorCallback = errorCallback; + + final String environment = payPalParameters.getString("environment"); + final String clientId = payPalParameters.getString("clientId"); + final String merchantName = payPalParameters.getString("merchantName"); + final String policyUri = payPalParameters.getString("policyUri"); + final String agreementUri = payPalParameters.getString("agreementUri"); + + PayPalConfiguration config = new PayPalConfiguration() + .environment(environment) + .clientId(clientId) + .merchantName(merchantName) + .merchantPrivacyPolicyUri(Uri.parse(policyUri)) + .merchantUserAgreementUri(Uri.parse(agreementUri)); + + // start service + Intent serviceIntent = new Intent(currentActivity, PayPalService.class); + serviceIntent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config); + currentActivity.startService(serviceIntent); + + // // start activity + Intent activityIntent = + new Intent(activityContext, PayPalFuturePaymentActivity.class) + .putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config); + + currentActivity.startActivityForResult(activityIntent, REQUEST_CODE_FUTURE_PAYMENT); + } + @ReactMethod public void paymentRequest( final ReadableMap payPalParameters, @@ -86,7 +139,7 @@ public void paymentRequest( .putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config) .putExtra(PaymentActivity.EXTRA_PAYMENT, thingToBuy); - currentActivity.startActivityForResult(intent, paymentIntentRequestCode); + currentActivity.startActivityForResult(intent, REQUEST_CODE_PAYMENT); } private void startPayPalService(PayPalConfiguration config) { @@ -95,9 +148,22 @@ private void startPayPalService(PayPalConfiguration config) { currentActivity.startService(intent); } - public void handleActivityResult(final int requestCode, final int resultCode, final Intent data) { - if (requestCode != paymentIntentRequestCode) { return; } + private void handleFutureActivityResult(final int resultCode, final Intent data) { + if (resultCode == Activity.RESULT_OK) { + PayPalAuthorization auth = data + .getParcelableExtra(PayPalFuturePaymentActivity.EXTRA_RESULT_AUTHORIZATION); + if (auth != null) { + String authorization_code = auth.getAuthorizationCode(); + successCallback.invoke(authorization_code); + } + } else if (resultCode == Activity.RESULT_CANCELED) { + errorCallback.invoke(ERROR_USER_CANCELLED); + } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) { + errorCallback.invoke(ERROR_INVALID_CONFIG); + } + } + private void handlePaymentActivityResult(final int resultCode, final Intent data) { if (resultCode == Activity.RESULT_OK) { PaymentConfirmation confirm = data.getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION); @@ -112,6 +178,20 @@ public void handleActivityResult(final int requestCode, final int resultCode, fi } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) { errorCallback.invoke(ERROR_INVALID_CONFIG); } + } + + public void handleActivityResult(final int requestCode, final int resultCode, final Intent data) { + if (requestCode != REQUEST_CODE_FUTURE_PAYMENT && requestCode != REQUEST_CODE_PAYMENT) { + return; + } + + if (requestCode == REQUEST_CODE_FUTURE_PAYMENT) { + handleFutureActivityResult(resultCode, data); + } + + if (requestCode == REQUEST_CODE_PAYMENT) { + handlePaymentActivityResult(resultCode, data); + } currentActivity.stopService(new Intent(currentActivity, PayPalService.class)); } diff --git a/android/src/main/java/br/com/vizir/rn/paypal/PayPalPackage.java b/android/src/main/java/br/com/vizir/rn/paypal/PayPalPackage.java index 59496d6..5327337 100644 --- a/android/src/main/java/br/com/vizir/rn/paypal/PayPalPackage.java +++ b/android/src/main/java/br/com/vizir/rn/paypal/PayPalPackage.java @@ -16,17 +16,15 @@ public class PayPalPackage implements ReactPackage { private Context context; private PayPal paypalModule; - private int paymentIntentRequestCode; - public PayPalPackage(Context activityContext, int paymentIntentRequestCode) { + public PayPalPackage(Context activityContext) { context = activityContext; - this.paymentIntentRequestCode = paymentIntentRequestCode; } @Override public List createNativeModules(ReactApplicationContext reactContext) { List modules = new ArrayList<>(); - paypalModule = new PayPal(reactContext, context, paymentIntentRequestCode); + paypalModule = new PayPal(reactContext, context); modules.add(paypalModule); return modules; diff --git a/index.js b/index.js index 11dee5c..dc382cc 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,19 @@ var functions = { return new Promise(function(resolve, reject) { PayPal.paymentRequest(payPalParameters, resolve, reject); }); - } + }, + + futurePayment(payPalParameters) { + return new Promise(function(resolve, reject) { + PayPal.futurePayment(payPalParameters, resolve, reject); + }); + }, + + getMetadataId() { + return new Promise(function(resolve, reject) { + PayPal.getMetadataId(resolve, reject); + }); + }, }; var exported = {}; From 86d670745a45ae9adc9a76519d1d332adf1e5635 Mon Sep 17 00:00:00 2001 From: andrey Date: Wed, 27 Apr 2016 13:23:59 +0300 Subject: [PATCH 33/36] merged ios implementation. added future payments in ios --- .../MFLReactNativePayPal.m | 83 +++---------- .../MFLReactNativePayPal.old.m | 115 ++++++++++++++++++ 2 files changed, 134 insertions(+), 64 deletions(-) create mode 100644 ios/MFLReactNativePayPal/MFLReactNativePayPal.old.m diff --git a/ios/MFLReactNativePayPal/MFLReactNativePayPal.m b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m index 6601b1e..cc65ef8 100644 --- a/ios/MFLReactNativePayPal/MFLReactNativePayPal.m +++ b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m @@ -15,9 +15,8 @@ @interface MFLReactNativePayPal () -@property PayPalPayment *payment; -@property PayPalConfiguration *configuration; @property (copy) RCTResponseSenderBlock flowCompletedCallback; +@property(nonatomic, strong, readwrite) PayPalConfiguration *payPalConfig; @end @@ -25,47 +24,18 @@ @implementation MFLReactNativePayPal RCT_EXPORT_MODULE(); -RCT_EXPORT_METHOD(initializePaypalEnvironment:(int)environment - forClientId:(NSString *)clientId ) +RCT_EXPORT_METHOD(presentPaymentViewControllerForPreparedPurchase:(RCTResponseSenderBlock)flowCompletedCallback) { - dispatch_async(dispatch_get_main_queue(), ^{ - NSString *envString = [self stringFromEnvironmentEnum:environment]; - - [PayPalMobile initializeWithClientIdsForEnvironments:@{envString : clientId}]; - [PayPalMobile preconnectWithEnvironment:envString]; - }); -} + _payPalConfig = [[PayPalConfiguration alloc] init]; -#pragma mark React Exported Methods - -RCT_EXPORT_METHOD(preparePaymentOfAmount:(NSString *)amount - ofCurrency:(NSString *)currencyCode - withDescription:(NSString *)description) -{ - self.payment = [[PayPalPayment alloc] init]; - [self.payment setAmount:[[NSDecimalNumber alloc] initWithString:amount]]; - [self.payment setCurrencyCode:currencyCode]; - [self.payment setShortDescription:description]; -} + _payPalConfig.acceptCreditCards = YES; + _payPalConfig.merchantName = @"Awesome Shirts, Inc."; + _payPalConfig.merchantPrivacyPolicyURL = [NSURL URLWithString:@"https://www.paypal.com/webapps/mpp/ua/privacy-full"]; + _payPalConfig.merchantUserAgreementURL = [NSURL URLWithString:@"https://www.paypal.com/webapps/mpp/ua/useragreement-full"]; - -RCT_EXPORT_METHOD(prepareConfigurationForMerchant:(NSString *)merchantName - acceptingCreditCards:(BOOL)shouldAcceptCreditCards - withUserEmail:(NSString *)userEmail) -{ - self.configuration = [[PayPalConfiguration alloc] init]; - [self.configuration setMerchantName:merchantName]; - [self.configuration setAcceptCreditCards:shouldAcceptCreditCards]; - [self.configuration setDefaultUserEmail:userEmail]; -} - -RCT_EXPORT_METHOD(presentPaymentViewControllerForPreparedPurchase:(RCTResponseSenderBlock)flowCompletedCallback) -{ self.flowCompletedCallback = flowCompletedCallback; - PayPalPaymentViewController *vc = [[PayPalPaymentViewController alloc] initWithPayment:self.payment - configuration:self.configuration - delegate:self]; + PayPalFuturePaymentViewController *vc = [[PayPalFuturePaymentViewController alloc] initWithConfiguration:_payPalConfig delegate:self]; UIViewController *visibleVC = [[[UIApplication sharedApplication] keyWindow] rootViewController]; do { @@ -76,40 +46,25 @@ @implementation MFLReactNativePayPal } } while (visibleVC.presentedViewController); - [visibleVC presentViewController:vc animated:YES completion:nil]; -} - -#pragma mark Paypal Delegate - -- (void)payPalPaymentDidCancel:(PayPalPaymentViewController *)paymentViewController -{ - [paymentViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ - if (self.flowCompletedCallback) { - self.flowCompletedCallback(@[[NSNull null], @{kPayPalPaymentStatusKey : @(kPayPalPaymentCanceled)}]); - } + [visibleVC presentViewController:vc animated:YES completion:^{ + // self.flowCompletedCallback(@[[NSNull null]]); }]; } -- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController - didCompletePayment:(PayPalPayment *)completedPayment +- (void)payPalFuturePaymentViewController:(PayPalFuturePaymentViewController *)futurePaymentViewController + didAuthorizeFuturePayment:(NSDictionary *)futurePaymentAuthorization { - [paymentViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ + [futurePaymentViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ if (self.flowCompletedCallback) { - self.flowCompletedCallback(@[[NSNull null], @{kPayPalPaymentStatusKey : @(kPayPalPaymentCompleted), - kPayPalPaymentConfirmationKey : completedPayment.confirmation}]); + self.flowCompletedCallback(@[futurePaymentAuthorization]); } }]; } -#pragma mark Utilities - -- (NSString *)stringFromEnvironmentEnum:(PayPalEnvironment)env -{ - switch (env) { - case kPayPalEnvironmentProduction: return PayPalEnvironmentProduction; - case kPayPalEnvironmentSandbox: return PayPalEnvironmentSandbox; - case kPayPalEnvironmentSandboxNoNetwork: return PayPalEnvironmentNoNetwork; - } +- (void)payPalFuturePaymentDidCancel:(PayPalFuturePaymentViewController *)futurePaymentViewController { + [futurePaymentViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ + self.flowCompletedCallback(@[[NSNull null]]); + }]; } -@end +@end \ No newline at end of file diff --git a/ios/MFLReactNativePayPal/MFLReactNativePayPal.old.m b/ios/MFLReactNativePayPal/MFLReactNativePayPal.old.m new file mode 100644 index 0000000..6601b1e --- /dev/null +++ b/ios/MFLReactNativePayPal/MFLReactNativePayPal.old.m @@ -0,0 +1,115 @@ +// +// MFLReactNativePayPal.m +// ReactPaypal +// +// Created by Tj on 6/22/15. +// Copyright (c) 2015 Facebook. All rights reserved. +// + +#import "MFLReactNativePayPal.h" +#import "RCTBridge.h" +#import "PayPalMobile.h" + +NSString * const kPayPalPaymentStatusKey = @"status"; +NSString * const kPayPalPaymentConfirmationKey = @"confirmation"; + +@interface MFLReactNativePayPal () + +@property PayPalPayment *payment; +@property PayPalConfiguration *configuration; +@property (copy) RCTResponseSenderBlock flowCompletedCallback; + +@end + +@implementation MFLReactNativePayPal + +RCT_EXPORT_MODULE(); + +RCT_EXPORT_METHOD(initializePaypalEnvironment:(int)environment + forClientId:(NSString *)clientId ) +{ + dispatch_async(dispatch_get_main_queue(), ^{ + NSString *envString = [self stringFromEnvironmentEnum:environment]; + + [PayPalMobile initializeWithClientIdsForEnvironments:@{envString : clientId}]; + [PayPalMobile preconnectWithEnvironment:envString]; + }); +} + +#pragma mark React Exported Methods + +RCT_EXPORT_METHOD(preparePaymentOfAmount:(NSString *)amount + ofCurrency:(NSString *)currencyCode + withDescription:(NSString *)description) +{ + self.payment = [[PayPalPayment alloc] init]; + [self.payment setAmount:[[NSDecimalNumber alloc] initWithString:amount]]; + [self.payment setCurrencyCode:currencyCode]; + [self.payment setShortDescription:description]; +} + + +RCT_EXPORT_METHOD(prepareConfigurationForMerchant:(NSString *)merchantName + acceptingCreditCards:(BOOL)shouldAcceptCreditCards + withUserEmail:(NSString *)userEmail) +{ + self.configuration = [[PayPalConfiguration alloc] init]; + [self.configuration setMerchantName:merchantName]; + [self.configuration setAcceptCreditCards:shouldAcceptCreditCards]; + [self.configuration setDefaultUserEmail:userEmail]; +} + +RCT_EXPORT_METHOD(presentPaymentViewControllerForPreparedPurchase:(RCTResponseSenderBlock)flowCompletedCallback) +{ + self.flowCompletedCallback = flowCompletedCallback; + + PayPalPaymentViewController *vc = [[PayPalPaymentViewController alloc] initWithPayment:self.payment + configuration:self.configuration + delegate:self]; + + UIViewController *visibleVC = [[[UIApplication sharedApplication] keyWindow] rootViewController]; + do { + if ([visibleVC isKindOfClass:[UINavigationController class]]) { + visibleVC = [(UINavigationController *)visibleVC visibleViewController]; + } else if (visibleVC.presentedViewController) { + visibleVC = visibleVC.presentedViewController; + } + } while (visibleVC.presentedViewController); + + [visibleVC presentViewController:vc animated:YES completion:nil]; +} + +#pragma mark Paypal Delegate + +- (void)payPalPaymentDidCancel:(PayPalPaymentViewController *)paymentViewController +{ + [paymentViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ + if (self.flowCompletedCallback) { + self.flowCompletedCallback(@[[NSNull null], @{kPayPalPaymentStatusKey : @(kPayPalPaymentCanceled)}]); + } + }]; +} + +- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController + didCompletePayment:(PayPalPayment *)completedPayment +{ + [paymentViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ + if (self.flowCompletedCallback) { + self.flowCompletedCallback(@[[NSNull null], @{kPayPalPaymentStatusKey : @(kPayPalPaymentCompleted), + kPayPalPaymentConfirmationKey : completedPayment.confirmation}]); + } + }]; +} + +#pragma mark Utilities + +- (NSString *)stringFromEnvironmentEnum:(PayPalEnvironment)env +{ + switch (env) { + case kPayPalEnvironmentProduction: return PayPalEnvironmentProduction; + case kPayPalEnvironmentSandbox: return PayPalEnvironmentSandbox; + case kPayPalEnvironmentSandboxNoNetwork: return PayPalEnvironmentNoNetwork; + } +} + +@end From 46169aebae23b3f618af087a6ee2aebaacebb489 Mon Sep 17 00:00:00 2001 From: Andrey Date: Fri, 10 Jun 2016 12:40:53 +0300 Subject: [PATCH 34/36] ios future payments now receive arguments --- .../br/com/vizir/rn/paypal/PayPalPackage.java | 1 + index.js | 25 +++++++- .../project.pbxproj | 64 ------------------- .../MFLReactNativePayPal.m | 29 +++++++-- .../MFLReactNativePayPal.old.m | 16 +++++ 5 files changed, 64 insertions(+), 71 deletions(-) diff --git a/android/src/main/java/br/com/vizir/rn/paypal/PayPalPackage.java b/android/src/main/java/br/com/vizir/rn/paypal/PayPalPackage.java index 5327337..7ce86bb 100644 --- a/android/src/main/java/br/com/vizir/rn/paypal/PayPalPackage.java +++ b/android/src/main/java/br/com/vizir/rn/paypal/PayPalPackage.java @@ -2,6 +2,7 @@ import android.content.Intent; import android.content.Context; +import android.util.Log; import com.facebook.react.ReactPackage; import com.facebook.react.bridge.JavaScriptModule; diff --git a/index.js b/index.js index ea0d00c..e141573 100644 --- a/index.js +++ b/index.js @@ -44,9 +44,28 @@ var functions = { }, futurePayment(payPalParameters) { - return new Promise(function(resolve, reject) { - PayPal.futurePayment(payPalParameters, resolve, reject); - }); + if (Platform.OS === 'android') { + return new Promise(function(resolve, reject) { + let successCallback = (code) => { + resolve({response: {code}}); + }; + PayPal.futurePayment(payPalParameters, successCallback, reject); + }); + } else { + return new Promise(function(resolve, reject) { + let callback = (result) => { + result ? resolve(result) : reject(result); + }; + MFLReactNativePayPal.presentPaymentViewControllerForPreparedPurchase( + payPalParameters.clientId, + payPalParameters.environment, + payPalParameters.merchantName, + payPalParameters.policyUri, + payPalParameters.agreementUri, + callback + ); + }); + } }, getMetadataId() { diff --git a/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj b/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj index 6b8f36e..5dbf25a 100644 --- a/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj +++ b/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj @@ -7,10 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 64976FFC1C47962B00C0178E /* libCardIO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64976FF01C47962B00C0178E /* libCardIO.a */; }; - 64976FFD1C47962B00C0178E /* libopencv_core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64976FF11C47962B00C0178E /* libopencv_core.a */; }; - 64976FFE1C47962B00C0178E /* libopencv_imgproc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64976FF21C47962B00C0178E /* libopencv_imgproc.a */; }; - 64976FFF1C47962B00C0178E /* libPayPalMobile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64976FF41C47962B00C0178E /* libPayPalMobile.a */; }; 64D7A23C1C46907F008FCDA3 /* MFLReactNativePayPal.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 64D7A23B1C46907F008FCDA3 /* MFLReactNativePayPal.h */; }; 64D7A23E1C46907F008FCDA3 /* MFLReactNativePayPal.m in Sources */ = {isa = PBXBuildFile; fileRef = 64D7A23D1C46907F008FCDA3 /* MFLReactNativePayPal.m */; }; /* End PBXBuildFile section */ @@ -29,25 +25,6 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 64976FE81C47962B00C0178E /* CardIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIO.h; sourceTree = ""; }; - 64976FE91C47962B00C0178E /* CardIOCreditCardInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOCreditCardInfo.h; sourceTree = ""; }; - 64976FEA1C47962B00C0178E /* CardIODetectionMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIODetectionMode.h; sourceTree = ""; }; - 64976FEB1C47962B00C0178E /* CardIOPaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOPaymentViewController.h; sourceTree = ""; }; - 64976FEC1C47962B00C0178E /* CardIOPaymentViewControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOPaymentViewControllerDelegate.h; sourceTree = ""; }; - 64976FED1C47962B00C0178E /* CardIOUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOUtilities.h; sourceTree = ""; }; - 64976FEE1C47962B00C0178E /* CardIOView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOView.h; sourceTree = ""; }; - 64976FEF1C47962B00C0178E /* CardIOViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOViewDelegate.h; sourceTree = ""; }; - 64976FF01C47962B00C0178E /* libCardIO.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libCardIO.a; sourceTree = ""; }; - 64976FF11C47962B00C0178E /* libopencv_core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopencv_core.a; sourceTree = ""; }; - 64976FF21C47962B00C0178E /* libopencv_imgproc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopencv_imgproc.a; sourceTree = ""; }; - 64976FF41C47962B00C0178E /* libPayPalMobile.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libPayPalMobile.a; sourceTree = ""; }; - 64976FF51C47962B00C0178E /* PayPalConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalConfiguration.h; sourceTree = ""; }; - 64976FF61C47962B00C0178E /* PayPalFuturePaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalFuturePaymentViewController.h; sourceTree = ""; }; - 64976FF71C47962B00C0178E /* PayPalMobile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalMobile.h; sourceTree = ""; }; - 64976FF81C47962B00C0178E /* PayPalOAuthScopes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalOAuthScopes.h; sourceTree = ""; }; - 64976FF91C47962B00C0178E /* PayPalPayment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalPayment.h; sourceTree = ""; }; - 64976FFA1C47962B00C0178E /* PayPalPaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalPaymentViewController.h; sourceTree = ""; }; - 64976FFB1C47962B00C0178E /* PayPalProfileSharingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalProfileSharingViewController.h; sourceTree = ""; }; 64D7A2381C46907F008FCDA3 /* libMFLReactNativePayPal.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMFLReactNativePayPal.a; sourceTree = BUILT_PRODUCTS_DIR; }; 64D7A23B1C46907F008FCDA3 /* MFLReactNativePayPal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MFLReactNativePayPal.h; sourceTree = ""; }; 64D7A23D1C46907F008FCDA3 /* MFLReactNativePayPal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MFLReactNativePayPal.m; sourceTree = ""; }; @@ -58,56 +35,15 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 64976FFC1C47962B00C0178E /* libCardIO.a in Frameworks */, - 64976FFD1C47962B00C0178E /* libopencv_core.a in Frameworks */, - 64976FFF1C47962B00C0178E /* libPayPalMobile.a in Frameworks */, - 64976FFE1C47962B00C0178E /* libopencv_imgproc.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 64976FE71C47962B00C0178E /* CardIO */ = { - isa = PBXGroup; - children = ( - 64976FE81C47962B00C0178E /* CardIO.h */, - 64976FE91C47962B00C0178E /* CardIOCreditCardInfo.h */, - 64976FEA1C47962B00C0178E /* CardIODetectionMode.h */, - 64976FEB1C47962B00C0178E /* CardIOPaymentViewController.h */, - 64976FEC1C47962B00C0178E /* CardIOPaymentViewControllerDelegate.h */, - 64976FED1C47962B00C0178E /* CardIOUtilities.h */, - 64976FEE1C47962B00C0178E /* CardIOView.h */, - 64976FEF1C47962B00C0178E /* CardIOViewDelegate.h */, - 64976FF01C47962B00C0178E /* libCardIO.a */, - 64976FF11C47962B00C0178E /* libopencv_core.a */, - 64976FF21C47962B00C0178E /* libopencv_imgproc.a */, - ); - name = CardIO; - path = lib/Paypal/CardIO; - sourceTree = ""; - }; - 64976FF31C47962B00C0178E /* PayPalMobile */ = { - isa = PBXGroup; - children = ( - 64976FF41C47962B00C0178E /* libPayPalMobile.a */, - 64976FF51C47962B00C0178E /* PayPalConfiguration.h */, - 64976FF61C47962B00C0178E /* PayPalFuturePaymentViewController.h */, - 64976FF71C47962B00C0178E /* PayPalMobile.h */, - 64976FF81C47962B00C0178E /* PayPalOAuthScopes.h */, - 64976FF91C47962B00C0178E /* PayPalPayment.h */, - 64976FFA1C47962B00C0178E /* PayPalPaymentViewController.h */, - 64976FFB1C47962B00C0178E /* PayPalProfileSharingViewController.h */, - ); - name = PayPalMobile; - path = lib/Paypal/PayPalMobile; - sourceTree = ""; - }; 64D7A22F1C46907F008FCDA3 = { isa = PBXGroup; children = ( - 64976FE71C47962B00C0178E /* CardIO */, - 64976FF31C47962B00C0178E /* PayPalMobile */, 64D7A23A1C46907F008FCDA3 /* MFLReactNativePayPal */, 64D7A2391C46907F008FCDA3 /* Products */, ); diff --git a/ios/MFLReactNativePayPal/MFLReactNativePayPal.m b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m index cc65ef8..ee87b43 100644 --- a/ios/MFLReactNativePayPal/MFLReactNativePayPal.m +++ b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m @@ -24,14 +24,25 @@ @implementation MFLReactNativePayPal RCT_EXPORT_MODULE(); -RCT_EXPORT_METHOD(presentPaymentViewControllerForPreparedPurchase:(RCTResponseSenderBlock)flowCompletedCallback) +RCT_EXPORT_METHOD(presentPaymentViewControllerForPreparedPurchase:(NSString *)clientId + forEnv:(int)environment + forMerchantName:(NSString *)merchantName + forMerchantPolicy:(NSString *)merchantPrivacyPolicyURL + forMerchantAgreement:(NSString *)merchantUserAgreementURL + forCallback:(RCTResponseSenderBlock)flowCompletedCallback) + { + NSString *envString = [self stringFromEnvironmentEnum:environment]; + + [PayPalMobile initializeWithClientIdsForEnvironments:@{envString : clientId}]; + [PayPalMobile preconnectWithEnvironment:envString]; + _payPalConfig = [[PayPalConfiguration alloc] init]; _payPalConfig.acceptCreditCards = YES; - _payPalConfig.merchantName = @"Awesome Shirts, Inc."; - _payPalConfig.merchantPrivacyPolicyURL = [NSURL URLWithString:@"https://www.paypal.com/webapps/mpp/ua/privacy-full"]; - _payPalConfig.merchantUserAgreementURL = [NSURL URLWithString:@"https://www.paypal.com/webapps/mpp/ua/useragreement-full"]; + _payPalConfig.merchantName = merchantName; + _payPalConfig.merchantPrivacyPolicyURL = [NSURL URLWithString:merchantPrivacyPolicyURL]; + _payPalConfig.merchantUserAgreementURL = [NSURL URLWithString:merchantUserAgreementURL]; self.flowCompletedCallback = flowCompletedCallback; @@ -51,6 +62,7 @@ @implementation MFLReactNativePayPal }]; } + - (void)payPalFuturePaymentViewController:(PayPalFuturePaymentViewController *)futurePaymentViewController didAuthorizeFuturePayment:(NSDictionary *)futurePaymentAuthorization { @@ -67,4 +79,13 @@ - (void)payPalFuturePaymentDidCancel:(PayPalFuturePaymentViewController *)future }]; } +- (NSString *)stringFromEnvironmentEnum:(PayPalEnvironment)env +{ + switch (env) { + case kPayPalEnvironmentProduction: return PayPalEnvironmentProduction; + case kPayPalEnvironmentSandbox: return PayPalEnvironmentSandbox; + case kPayPalEnvironmentSandboxNoNetwork: return PayPalEnvironmentNoNetwork; + } +} + @end \ No newline at end of file diff --git a/ios/MFLReactNativePayPal/MFLReactNativePayPal.old.m b/ios/MFLReactNativePayPal/MFLReactNativePayPal.old.m index 6601b1e..5c58cf6 100644 --- a/ios/MFLReactNativePayPal/MFLReactNativePayPal.old.m +++ b/ios/MFLReactNativePayPal/MFLReactNativePayPal.old.m @@ -113,3 +113,19 @@ - (NSString *)stringFromEnvironmentEnum:(PayPalEnvironment)env } @end +// RCT_EXPORT_METHOD(presentPaymentViewControllerForPreparedPurchase:(NSString *)clientId +// forEnv:(int)environment +// forMerchantName:(NSString *)merchantName +// forMerchantPolicy:(NSString *)merchantPrivacyPolicyURL +// forMerchantAgreement:(NSString *)merchantUserAgreementURL +// forCallback:(RCTResponseSenderBlock)flowCompletedCallback) + +// { +// NSString *envString = [self stringFromEnvironmentEnum:environment]; + +// _payPalConfig = [[PayPalConfiguration alloc] init]; + +// _payPalConfig.acceptCreditCards = YES; +// _payPalConfig.merchantName = @"Awesome Shirts, Inc."; +// _payPalConfig.merchantPrivacyPolicyURL = [NSURL URLWithString:@"https://www.paypal.com/webapps/mpp/ua/privacy-full"]; +// _payPalConfig.merchantUserAgreementURL = [NSURL URLWithString:@"https://www.paypal.com/webapps/mpp/ua/useragreement-full"]; \ No newline at end of file From 652f4d811bcbf3499464d3a9875613421e55ca69 Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 29 Aug 2016 14:00:24 +0300 Subject: [PATCH 35/36] minor fixes --- .../java/br/com/vizir/rn/paypal/PayPal.java | 4 +- index.js | 45 +++++++------- .../MFLReactNativePayPal.m | 62 ++++++++++++++++++- 3 files changed, 83 insertions(+), 28 deletions(-) diff --git a/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java b/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java index 3bec17a..32592f0 100644 --- a/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java +++ b/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java @@ -36,8 +36,8 @@ public class PayPal extends ReactContextBaseJavaModule { private Context activityContext; private Activity currentActivity; - private static final int REQUEST_CODE_PAYMENT = 1; - private static final int REQUEST_CODE_FUTURE_PAYMENT = 2; + private static final int REQUEST_CODE_PAYMENT = 179 + 1; + private static final int REQUEST_CODE_FUTURE_PAYMENT = 179 + 2; public PayPal(ReactApplicationContext reactContext, Context activityContext) { super(reactContext); diff --git a/index.js b/index.js index e141573..59e1913 100644 --- a/index.js +++ b/index.js @@ -20,29 +20,6 @@ if (Platform.OS === 'android') { } var functions = { - paymentRequest(payPalParameters) { - return new Promise(function(resolve, reject) { - if (Platform.OS === 'android') { - PayPal.paymentRequest(payPalParameters, resolve, reject); - } else { - MFLReactNativePayPal.initializePaypalEnvironment(payPalParameters.environment, payPalParameters.clientId); - MFLReactNativePayPal.preparePaymentOfAmount(payPalParameters.price, payPalParameters.currency, payPalParameters.description); - MFLReactNativePayPal.prepareConfigurationForMerchant("Shape A Future", true, "spenden@aktion-europa-hilft.de"); - MFLReactNativePayPal.presentPaymentViewControllerForPreparedPurchase((error, payload) => { - if (error) { - reject(constants.INVALID_CONFIG, error) - } else { - if (payload.status === 1) { - resolve(payload); - } else { - reject(constants.USER_CANCELLED, payload); - } - } - }); - } - }); - }, - futurePayment(payPalParameters) { if (Platform.OS === 'android') { return new Promise(function(resolve, reject) { @@ -56,7 +33,27 @@ var functions = { let callback = (result) => { result ? resolve(result) : reject(result); }; - MFLReactNativePayPal.presentPaymentViewControllerForPreparedPurchase( + MFLReactNativePayPal.futurePayment( + payPalParameters.clientId, + payPalParameters.environment, + payPalParameters.merchantName, + payPalParameters.policyUri, + payPalParameters.agreementUri, + callback + ); + }); + } + }, + + shareProfile(payPalParameters) { + if (Platform.OS === 'android') { + alert('not yet!'); + } else { + return new Promise(function(resolve, reject) { + let callback = (result) => { + result ? resolve(result) : reject(result); + }; + MFLReactNativePayPal.shareProfile( payPalParameters.clientId, payPalParameters.environment, payPalParameters.merchantName, diff --git a/ios/MFLReactNativePayPal/MFLReactNativePayPal.m b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m index ee87b43..8f36c5e 100644 --- a/ios/MFLReactNativePayPal/MFLReactNativePayPal.m +++ b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m @@ -10,10 +10,11 @@ #import "RCTBridge.h" #import "PayPalMobile.h" + NSString * const kPayPalPaymentStatusKey = @"status"; NSString * const kPayPalPaymentConfirmationKey = @"confirmation"; -@interface MFLReactNativePayPal () +@interface MFLReactNativePayPal () @property (copy) RCTResponseSenderBlock flowCompletedCallback; @property(nonatomic, strong, readwrite) PayPalConfiguration *payPalConfig; @@ -24,7 +25,7 @@ @implementation MFLReactNativePayPal RCT_EXPORT_MODULE(); -RCT_EXPORT_METHOD(presentPaymentViewControllerForPreparedPurchase:(NSString *)clientId +RCT_EXPORT_METHOD(futurePayment:(NSString *)clientId forEnv:(int)environment forMerchantName:(NSString *)merchantName forMerchantPolicy:(NSString *)merchantPrivacyPolicyURL @@ -34,6 +35,8 @@ @implementation MFLReactNativePayPal { NSString *envString = [self stringFromEnvironmentEnum:environment]; + NSLog(clientId); + [PayPalMobile initializeWithClientIdsForEnvironments:@{envString : clientId}]; [PayPalMobile preconnectWithEnvironment:envString]; @@ -62,6 +65,61 @@ @implementation MFLReactNativePayPal }]; } +RCT_EXPORT_METHOD(shareProfile:(NSString *)clientId + forEnv:(int)environment + forMerchantName:(NSString *)merchantName + forMerchantPolicy:(NSString *)merchantPrivacyPolicyURL + forMerchantAgreement:(NSString *)merchantUserAgreementURL + forCallback:(RCTResponseSenderBlock)flowCompletedCallback) + +{ + NSString *envString = [self stringFromEnvironmentEnum:environment]; + + [PayPalMobile initializeWithClientIdsForEnvironments:@{envString : clientId}]; + [PayPalMobile preconnectWithEnvironment:envString]; + + _payPalConfig = [[PayPalConfiguration alloc] init]; + + _payPalConfig.merchantName = merchantName; + _payPalConfig.merchantPrivacyPolicyURL = [NSURL URLWithString:merchantPrivacyPolicyURL]; + _payPalConfig.merchantUserAgreementURL = [NSURL URLWithString:merchantUserAgreementURL]; + + self.flowCompletedCallback = flowCompletedCallback; + + NSSet *scopeValues = [NSSet setWithArray:@[kPayPalOAuth2ScopeOpenId, kPayPalOAuth2ScopeEmail, kPayPalOAuth2ScopeAddress, kPayPalOAuth2ScopePhone]]; + PayPalProfileSharingViewController *vc = [[PayPalProfileSharingViewController alloc] initWithScopeValues:scopeValues configuration:_payPalConfig delegate:self]; + + UIViewController *visibleVC = [[[UIApplication sharedApplication] keyWindow] rootViewController]; + do { + if ([visibleVC isKindOfClass:[UINavigationController class]]) { + visibleVC = [(UINavigationController *)visibleVC visibleViewController]; + } else if (visibleVC.presentedViewController) { + visibleVC = visibleVC.presentedViewController; + } + } while (visibleVC.presentedViewController); + + [visibleVC presentViewController:vc animated:YES completion:^{ + // self.flowCompletedCallback(@[[NSNull null]]); + }]; +} + +- (void)payPalProfileSharingViewController:(PayPalProfileSharingViewController *)profileSharingViewController + userDidLogInWithAuthorization:(NSDictionary *)profileSharingAuthorization { + [profileSharingViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ + NSLog(@"SUCCESS"); + + // if (self.flowCompletedCallback) { + // self.flowCompletedCallback(@[profileSharingAuthorization]); + // } + }]; +} + +- (void)userDidCancelPayPalProfileSharingViewController:(PayPalProfileSharingViewController *)profileSharingViewController { + NSLog(@"PayPal Profile Sharing Authorization Canceled"); + [profileSharingViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ + self.flowCompletedCallback(@[[NSNull null]]); + }]; +} - (void)payPalFuturePaymentViewController:(PayPalFuturePaymentViewController *)futurePaymentViewController didAuthorizeFuturePayment:(NSDictionary *)futurePaymentAuthorization From 0b1daed987e276d588cc4acc2005f718851d6193 Mon Sep 17 00:00:00 2001 From: Andrey Date: Fri, 2 Sep 2016 16:07:32 +0300 Subject: [PATCH 36/36] added method for sharing paypal profile on android --- .../java/br/com/vizir/rn/paypal/PayPal.java | 80 +++++++++++++++++-- index.js | 11 ++- .../MFLReactNativePayPal.m | 10 ++- 3 files changed, 86 insertions(+), 15 deletions(-) diff --git a/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java b/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java index 32592f0..f7fbfb3 100644 --- a/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java +++ b/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java @@ -20,11 +20,15 @@ import com.paypal.android.sdk.payments.PaymentActivity; import com.paypal.android.sdk.payments.PaymentConfirmation; import com.paypal.android.sdk.payments.PayPalFuturePaymentActivity; +import com.paypal.android.sdk.payments.PayPalProfileSharingActivity; +import com.paypal.android.sdk.payments.PayPalOAuthScopes; import java.util.Map; import java.util.HashMap; import java.math.BigDecimal; - +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; public class PayPal extends ReactContextBaseJavaModule { private static final String ERROR_USER_CANCELLED = "USER_CANCELLED"; @@ -38,6 +42,7 @@ public class PayPal extends ReactContextBaseJavaModule { private static final int REQUEST_CODE_PAYMENT = 179 + 1; private static final int REQUEST_CODE_FUTURE_PAYMENT = 179 + 2; + private static final int REQUEST_CODE_PROFILE_SHARING = 179 + 3; public PayPal(ReactApplicationContext reactContext, Context activityContext) { super(reactContext); @@ -75,6 +80,42 @@ public void getMetadataId( } } + @ReactMethod + public void shareProfile( + final ReadableMap payPalParameters, + final Callback successCallback, + final Callback errorCallback + ) { + this.successCallback = successCallback; + this.errorCallback = errorCallback; + + final String environment = payPalParameters.getString("environment"); + final String clientId = payPalParameters.getString("clientId"); + final String merchantName = payPalParameters.getString("merchantName"); + final String policyUri = payPalParameters.getString("policyUri"); + final String agreementUri = payPalParameters.getString("agreementUri"); + + PayPalConfiguration config = new PayPalConfiguration() + .environment(environment) + .clientId(clientId) + .merchantName(merchantName) + .merchantPrivacyPolicyUri(Uri.parse(policyUri)) + .merchantUserAgreementUri(Uri.parse(agreementUri)); + + // start service + Intent serviceIntent = new Intent(currentActivity, PayPalService.class); + serviceIntent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config); + currentActivity.startService(serviceIntent); + + // // start activity + Intent activityIntent = + new Intent(activityContext, PayPalProfileSharingActivity.class) + .putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config) + .putExtra(PayPalProfileSharingActivity.EXTRA_REQUESTED_SCOPES, getOauthScopes()); + + currentActivity.startActivityForResult(activityIntent, REQUEST_CODE_PROFILE_SHARING); + } + @ReactMethod public void futurePayment( final ReadableMap payPalParameters, @@ -148,6 +189,31 @@ private void startPayPalService(PayPalConfiguration config) { currentActivity.startService(intent); } + private PayPalOAuthScopes getOauthScopes() { + /* create the set of required scopes + * Note: see https://developer.paypal.com/docs/integration/direct/identity/attributes/ for mapping between the + * attributes you select for this app in the PayPal developer portal and the scopes required here. + */ + Set scopes = new HashSet( + Arrays.asList(PayPalOAuthScopes.PAYPAL_SCOPE_EMAIL, PayPalOAuthScopes.PAYPAL_SCOPE_ADDRESS) ); + return new PayPalOAuthScopes(scopes); + } + + private void handleShareProfileActivityResult(final int resultCode, final Intent data) { + if (resultCode == Activity.RESULT_OK) { + PayPalAuthorization auth = data + .getParcelableExtra(PayPalProfileSharingActivity.EXTRA_RESULT_AUTHORIZATION); + if (auth != null) { + String authorization_code = auth.getAuthorizationCode(); + successCallback.invoke(authorization_code); + } + } else if (resultCode == Activity.RESULT_CANCELED) { + errorCallback.invoke(ERROR_USER_CANCELLED); + } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) { + errorCallback.invoke(ERROR_INVALID_CONFIG); + } + } + private void handleFutureActivityResult(final int resultCode, final Intent data) { if (resultCode == Activity.RESULT_OK) { PayPalAuthorization auth = data @@ -181,16 +247,14 @@ private void handlePaymentActivityResult(final int resultCode, final Intent data } public void handleActivityResult(final int requestCode, final int resultCode, final Intent data) { - if (requestCode != REQUEST_CODE_FUTURE_PAYMENT && requestCode != REQUEST_CODE_PAYMENT) { - return; - } - if (requestCode == REQUEST_CODE_FUTURE_PAYMENT) { handleFutureActivityResult(resultCode, data); - } - - if (requestCode == REQUEST_CODE_PAYMENT) { + } else if (requestCode == REQUEST_CODE_PAYMENT) { handlePaymentActivityResult(resultCode, data); + } else if (requestCode == REQUEST_CODE_PROFILE_SHARING) { + handleShareProfileActivityResult(resultCode, data); + } else { + return; } currentActivity.stopService(new Intent(currentActivity, PayPalService.class)); diff --git a/index.js b/index.js index 59e1913..07ceeb3 100644 --- a/index.js +++ b/index.js @@ -23,8 +23,8 @@ var functions = { futurePayment(payPalParameters) { if (Platform.OS === 'android') { return new Promise(function(resolve, reject) { - let successCallback = (code) => { - resolve({response: {code}}); + let successCallback = (result) => { + resolve(result); }; PayPal.futurePayment(payPalParameters, successCallback, reject); }); @@ -47,7 +47,12 @@ var functions = { shareProfile(payPalParameters) { if (Platform.OS === 'android') { - alert('not yet!'); + return new Promise(function(resolve, reject) { + let successCallback = (code) => { + resolve({response: {code}}); + }; + PayPal.shareProfile(payPalParameters, successCallback, reject); + }); } else { return new Promise(function(resolve, reject) { let callback = (result) => { diff --git a/ios/MFLReactNativePayPal/MFLReactNativePayPal.m b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m index 8f36c5e..47b6421 100644 --- a/ios/MFLReactNativePayPal/MFLReactNativePayPal.m +++ b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m @@ -78,6 +78,8 @@ @implementation MFLReactNativePayPal [PayPalMobile initializeWithClientIdsForEnvironments:@{envString : clientId}]; [PayPalMobile preconnectWithEnvironment:envString]; + NSLog(@"SHARE!"); + _payPalConfig = [[PayPalConfiguration alloc] init]; _payPalConfig.merchantName = merchantName; @@ -86,7 +88,7 @@ @implementation MFLReactNativePayPal self.flowCompletedCallback = flowCompletedCallback; - NSSet *scopeValues = [NSSet setWithArray:@[kPayPalOAuth2ScopeOpenId, kPayPalOAuth2ScopeEmail, kPayPalOAuth2ScopeAddress, kPayPalOAuth2ScopePhone]]; + NSSet *scopeValues = [NSSet setWithArray:@[kPayPalOAuth2ScopeEmail, kPayPalOAuth2ScopeFuturePayments, kPayPalOAuth2ScopePhone]]; PayPalProfileSharingViewController *vc = [[PayPalProfileSharingViewController alloc] initWithScopeValues:scopeValues configuration:_payPalConfig delegate:self]; UIViewController *visibleVC = [[[UIApplication sharedApplication] keyWindow] rootViewController]; @@ -108,9 +110,9 @@ - (void)payPalProfileSharingViewController:(PayPalProfileSharingViewController * [profileSharingViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ NSLog(@"SUCCESS"); - // if (self.flowCompletedCallback) { - // self.flowCompletedCallback(@[profileSharingAuthorization]); - // } + if (self.flowCompletedCallback) { + self.flowCompletedCallback(@[profileSharingAuthorization]); + } }]; }