├── .buckconfig ├── .flowconfig ├── .gitignore ├── .watchmanconfig ├── LICENSE ├── README.md ├── android ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── oncethere │ └── reactnativepayworks │ ├── ReactNativePayworksModule.java │ └── ReactNativePayworksPackage.java ├── example ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── rnpdemo │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── index.android.js ├── index.ios.js ├── ios │ ├── Podfile │ ├── Podfile.lock │ ├── RNPDemo.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── RNPDemo.xcscheme │ ├── RNPDemo.xcworkspace │ │ └── contents.xcworkspacedata │ ├── RNPDemo │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── RNPDemoTests │ │ ├── Info.plist │ │ └── RNPDemoTests.m ├── package.json └── style.js ├── index.js ├── ios ├── Podfile ├── Podfile.lock ├── ReactNativePayworks.xcodeproj │ └── project.pbxproj ├── ReactNativePayworks.xcworkspace │ └── contents.xcworkspacedata ├── ReactNativePayworks │ ├── ReactNativePayworks.h │ └── ReactNativePayworks.m └── react-native-payworks.podspec └── package.json /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*[.]android.js 5 | 6 | # Ignore templates with `@flow` in header 7 | .*/local-cli/generator.* 8 | 9 | # Ignore malformed json 10 | .*/node_modules/y18n/test/.*\.json 11 | 12 | # Ignore the website subdir 13 | /website/.* 14 | 15 | # Ignore BUCK generated dirs 16 | /\.buckd/ 17 | 18 | # Ignore unexpected extra @providesModule 19 | .*/node_modules/commoner/test/source/widget/share.js 20 | 21 | # Ignore duplicate module providers 22 | # For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root 23 | .*/Libraries/react-native/React.js 24 | .*/Libraries/react-native/ReactNative.js 25 | .*/node_modules/jest-runtime/build/__tests__/.* 26 | 27 | [include] 28 | 29 | [libs] 30 | node_modules/react-native/Libraries/react-native/react-native-interface.js 31 | node_modules/react-native/flow 32 | flow/ 33 | 34 | [options] 35 | module.system=haste 36 | 37 | esproposal.class_static_fields=enable 38 | esproposal.class_instance_fields=enable 39 | 40 | experimental.strict_type_args=true 41 | 42 | munge_underscores=true 43 | 44 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 45 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 46 | 47 | suppress_type=$FlowIssue 48 | suppress_type=$FlowFixMe 49 | suppress_type=$FixMe 50 | 51 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-2]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 52 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-2]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 53 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 54 | 55 | unsafe.enable_getters_and_setters=true 56 | 57 | [version] 58 | ^0.32.0 59 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | Pods/ 25 | 26 | # Android/IJ 27 | # 28 | *.iml 29 | .idea 30 | .gradle 31 | local.properties 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | android/app/libs 42 | android/keystores/debug.keystore 43 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2019 OnceThere, Inc. 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React Native Payworks Integration 2 | 3 | This is a React Native library that wraps the [Payworks](http://www.payworks.mpymnt.com/) native library for interfacing with Miura hardware readers. 4 | 5 | The initial release supports iOS and Stripe only. Android support is TBD. Pull requests are welcome. 6 | 7 | ## Usage 8 | 9 | * `npm install react-native-payworks --save` 10 | * `react-native link` 11 | * Import the module in a RN app: 12 | `import ReactNativePayworks from 'react-native-payworks';` 13 | * Platform-specific dependencies are listed under the Example section. 14 | 15 | ## API 16 | 17 | All available methods are promise-based: 18 | 19 | * `transaction(paramObj)` -- Initiate a charge on the card reader. Upon completion of a transaction, the promise resolves with a _status_ key. The _transaction_ method accepts an object as the first parameter containing the following fields: 20 | * _providerMode_: [MPProviderMode](http://www.payworks.mpymnt.com/node/272): LIVE=1, TEST=2, MOCK=3, JUNGLE=4, LIVE_FIXED=5, TEST_FIXED=6. 21 | * _merchantIdentifier_: Payworks-generated merchant ID. 22 | * _merchantSecretKey_: Payworks-generated merchant secret key. 23 | * _chargeWithAmount_: Amount to charge. 24 | * _currency_: Currency to use for the charge (22 indicates USD). 25 | * _optionals_: Additional data to pass to Payworks such as applicationFee. Refer to the [Payworks Transactions with Stripe documentation](http://www.payworks.mpymnt.com/node/268) for details. 26 | 27 | * `submitSignature(image)` -- Send a captured signature when a _PayworksTransactionEvent_ event contains the _action_ key with value _MPTransactionActionCustomerSignature_. The _image_ parameter is anything supported by [RCTConvert](https://github.com/facebook/react-native/blob/master/React/Base/RCTConvert.m). 28 | 29 | * `cancelSignature()` -- [Abort the transaction](http://www.payworks.mpymnt.com/node/100). 30 | 31 | #### Events 32 | Events are emitted by NativeAppEventEmitter under the name `PayworksTransactionEvent`. During the transaction, the response payload contains a _details_ key. If an action is required (e.g. signature), the _action_ key will be populated. 33 | 34 | #### Example code snippet 35 | ```Javascript 36 | import ReactNativePayworks from 'react-native-payworks'; 37 | import { NativeAppEventEmitter } from 'react-native'; 38 | 39 | // Initiate a transaction on the card reader. 40 | ReactNativePayworks.transaction({ 41 | merchantIdentifier: "myMerchantId", 42 | merchantSecretKey: "myMerchantKey", 43 | chargeWithAmount: 10, 44 | currency: 22, //USD 45 | optionals: { 46 | subject: "My purchase", 47 | customIdentifier: "purchase_id_123", 48 | applicationFee: 0.99, 49 | metadata: { 50 | customField1: "test1", 51 | customField2: "test2", 52 | } 53 | } 54 | }).then( 55 | (transaction) =>{ 56 | console.log("PayworksNative transaction completed:" + JSON.stringify(transaction)); 57 | }); 58 | 59 | componentWillMount() { 60 | // Listen for events from the card reader. 61 | this.payworksEventSub = NativeAppEventEmitter.addListener( 62 | 'PayworksTransactionEvent', 63 | (data) => { 64 | if (data.details) { 65 | console.log("PayworksNative ongoing transaction details: " + JSON.stringify(data.details)); 66 | } 67 | else if (data.action && data.action === "MPTransactionActionCustomerSignature") { 68 | console.log("Capture signature now."); 69 | ReactNativePayworks.submitSignature(capturedSignatureImage); // you supply capturedSignatureImage 70 | } 71 | } 72 | ); 73 | } 74 | 75 | componentWillUnmount() { 76 | this.payworksEventSub.remove(); 77 | } 78 | ``` 79 | 80 | ## Example 81 | The `example/` directory has a sample project using the ReactNativePayworks library. 82 | 83 | * Install npm dependencies ```npm install``` 84 | * Install React Native CLI globally ```sudo npm install -g react-native-cli``` 85 | * ```react-native link``` 86 | 87 | #### iOS dependencies 88 | * Xcode 89 | * Install Cocoapods ```sudo gem install cocoapods``` 90 | * Install pods ```cd example/ios && pod install && cd ../..``` 91 | * Open `example/ios/RNPDemo.xcworkspace` in Xcode. 92 | * Add the necessary protocols to the Xcode project ([Payworks instructions](http://www.payworks.mpymnt.com/node/101)). 93 | * Build and run on a real iOS device (card reader should be paired with the iDevice). 94 | 95 | 96 | #### Android Dependencies 97 | * ... 98 | 99 | ## ToDo 100 | * Payworks iOS library is built without Bitcode, requiring the RN app to be built without it. 101 | * Update example project for Android. 102 | * Tests 103 | 104 | ## License 105 | 106 | React Native Payworks is [Apache Licensed](./LICENSE). 107 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | import groovy.json.JsonSlurper 2 | 3 | def computeVersionName() { 4 | // dynamically retrieve version from package.json 5 | def slurper = new JsonSlurper() 6 | def json = slurper.parse(file('../package.json'), "utf-8") 7 | return json.version 8 | } 9 | 10 | buildscript { 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | dependencies { 16 | classpath 'com.android.tools.build:gradle:1.5.0' 17 | } 18 | } 19 | 20 | apply plugin: 'com.android.library' 21 | 22 | android { 23 | compileSdkVersion 23 24 | buildToolsVersion "23.0.1" 25 | 26 | defaultConfig { 27 | minSdkVersion 16 28 | targetSdkVersion 22 29 | versionCode 1 30 | // get version name from package.json version 31 | versionName computeVersionName() 32 | } 33 | lintOptions { 34 | abortOnError false 35 | } 36 | } 37 | 38 | repositories { 39 | mavenCentral() 40 | } 41 | 42 | dependencies { 43 | compile 'com.facebook.react:react-native:+' 44 | } 45 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/com/oncethere/reactnativepayworks/ReactNativePayworksModule.java: -------------------------------------------------------------------------------- 1 | // 2 | // ReactNativePayworks 3 | // 4 | // Created by Peace Chen on 2/27/2018. 5 | // Copyright OnceThere. All rights reserved. 6 | // 7 | 8 | package com.oncethere.reactnativepayworks; 9 | 10 | import com.facebook.react.bridge.ReactApplicationContext; 11 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 12 | import com.facebook.react.bridge.ReactMethod; 13 | import com.facebook.react.bridge.ReadableMap; 14 | import com.facebook.react.bridge.WritableMap; 15 | import com.facebook.react.bridge.Arguments; 16 | import com.facebook.react.bridge.Promise; 17 | 18 | import java.util.HashMap; 19 | import java.util.Map; 20 | 21 | public class ReactNativePayworksModule extends ReactContextBaseJavaModule { 22 | 23 | private static final String SOME_KEY = "MY_KEY"; 24 | 25 | public ReactNativePayworksModule(ReactApplicationContext reactContext) { 26 | super(reactContext); 27 | } 28 | 29 | @Override 30 | public String getName() { 31 | return "PayworksNative"; 32 | } 33 | 34 | @Override 35 | public Map getConstants() { 36 | final Map constants = new HashMap<>(); 37 | // constants.put(SOME_KEY, 1); 38 | return constants; 39 | } 40 | 41 | @ReactMethod 42 | public void transaction(ReadableMap xactionParams, Promise promise) { 43 | //ToDo 44 | 45 | WritableMap result = Arguments.createMap(); 46 | result.putString("status", "status string"); //ToDo 47 | result.putString("transaction", "transaction msg"); //ToDo 48 | result.putString("details", "details msg"); //ToDo 49 | promise.resolve(result); 50 | } 51 | 52 | public void submitSignature(Object signature, Promise promise) { 53 | //ToDo 54 | } 55 | 56 | @ReactMethod 57 | public void cancelSignature(Promise promise) { 58 | //ToDo 59 | } 60 | 61 | @ReactMethod 62 | public void abortTransaction(Promise promise) { 63 | //ToDo 64 | } 65 | 66 | @ReactMethod 67 | public void disconnect(Promise promise) { 68 | //ToDo 69 | 70 | WritableMap result = Arguments.createMap(); 71 | result.putInt("MPAccessoryProcessDetailsState", 1); //ToDo 72 | promise.resolve(result); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /android/src/main/java/com/oncethere/reactnativepayworks/ReactNativePayworksPackage.java: -------------------------------------------------------------------------------- 1 | // 2 | // ReactNativePayworks 3 | // 4 | // Created by Peace Chen on 2/27/2018. 5 | // Copyright OnceThere. All rights reserved. 6 | // 7 | 8 | package com.oncethere.reactnativepayworks; 9 | 10 | import com.facebook.react.ReactPackage; 11 | import com.facebook.react.bridge.NativeModule; 12 | import com.facebook.react.bridge.ReactApplicationContext; 13 | import com.facebook.react.uimanager.ViewManager; 14 | 15 | import java.util.ArrayList; 16 | import java.util.Collections; 17 | import java.util.List; 18 | 19 | public class ReactNativePayworksPackage implements ReactPackage { 20 | 21 | @Override 22 | public List createViewManagers(ReactApplicationContext reactContext) { 23 | return Collections.emptyList(); 24 | } 25 | 26 | @Override 27 | public List createNativeModules(ReactApplicationContext reactContext) { 28 | List modules = new ArrayList<>(); 29 | 30 | modules.add(new ReactNativePayworksModule(reactContext)); 31 | 32 | return modules; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /example/android/app/BUCK: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | # To learn about Buck see [Docs](https://buckbuild.com/). 4 | # To run your application with Buck: 5 | # - install Buck 6 | # - `npm start` - to start the packager 7 | # - `cd android` 8 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 9 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 10 | # - `buck install -r android/app` - compile, install and run application 11 | # 12 | 13 | lib_deps = [] 14 | for jarfile in glob(['libs/*.jar']): 15 | name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) 16 | lib_deps.append(':' + name) 17 | prebuilt_jar( 18 | name = name, 19 | binary_jar = jarfile, 20 | ) 21 | 22 | for aarfile in glob(['libs/*.aar']): 23 | name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) 24 | lib_deps.append(':' + name) 25 | android_prebuilt_aar( 26 | name = name, 27 | aar = aarfile, 28 | ) 29 | 30 | android_library( 31 | name = 'all-libs', 32 | exported_deps = lib_deps 33 | ) 34 | 35 | android_library( 36 | name = 'app-code', 37 | srcs = glob([ 38 | 'src/main/java/**/*.java', 39 | ]), 40 | deps = [ 41 | ':all-libs', 42 | ':build_config', 43 | ':res', 44 | ], 45 | ) 46 | 47 | android_build_config( 48 | name = 'build_config', 49 | package = 'com.rnpdemo', 50 | ) 51 | 52 | android_resource( 53 | name = 'res', 54 | res = 'src/main/res', 55 | package = 'com.rnpdemo', 56 | ) 57 | 58 | android_binary( 59 | name = 'app', 60 | package_type = 'debug', 61 | manifest = 'src/main/AndroidManifest.xml', 62 | keystore = '//android/keystores:debug', 63 | deps = [ 64 | ':app-code', 65 | ], 66 | ) 67 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // the root of your project, i.e. where "package.json" lives 37 | * root: "../../", 38 | * 39 | * // where to put the JS bundle asset in debug mode 40 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 41 | * 42 | * // where to put the JS bundle asset in release mode 43 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 44 | * 45 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 46 | * // require('./image.png')), in debug mode 47 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 48 | * 49 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 50 | * // require('./image.png')), in release mode 51 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 52 | * 53 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 54 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 55 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 56 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 57 | * // for example, you might want to remove it from here. 58 | * inputExcludes: ["android/**", "ios/**"], 59 | * 60 | * // override which node gets called and with what additional arguments 61 | * nodeExecutableAndArgs: ["node"] 62 | * 63 | * // supply additional arguments to the packager 64 | * extraPackagerArgs: [] 65 | * ] 66 | */ 67 | 68 | apply from: "../../node_modules/react-native/react.gradle" 69 | 70 | /** 71 | * Set this to true to create two separate APKs instead of one: 72 | * - An APK that only works on ARM devices 73 | * - An APK that only works on x86 devices 74 | * The advantage is the size of the APK is reduced by about 4MB. 75 | * Upload all the APKs to the Play Store and people will download 76 | * the correct one based on the CPU architecture of their device. 77 | */ 78 | def enableSeparateBuildPerCPUArchitecture = false 79 | 80 | /** 81 | * Run Proguard to shrink the Java bytecode in release builds. 82 | */ 83 | def enableProguardInReleaseBuilds = false 84 | 85 | android { 86 | compileSdkVersion 23 87 | buildToolsVersion "23.0.1" 88 | 89 | defaultConfig { 90 | applicationId "com.rnpdemo" 91 | minSdkVersion 16 92 | targetSdkVersion 22 93 | versionCode 1 94 | versionName "1.0" 95 | ndk { 96 | abiFilters "armeabi-v7a", "x86" 97 | } 98 | } 99 | splits { 100 | abi { 101 | reset() 102 | enable enableSeparateBuildPerCPUArchitecture 103 | universalApk false // If true, also generate a universal APK 104 | include "armeabi-v7a", "x86" 105 | } 106 | } 107 | buildTypes { 108 | release { 109 | minifyEnabled enableProguardInReleaseBuilds 110 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 111 | } 112 | } 113 | // applicationVariants are e.g. debug, release 114 | applicationVariants.all { variant -> 115 | variant.outputs.each { output -> 116 | // For each separate APK per architecture, set a unique version code as described here: 117 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 118 | def versionCodes = ["armeabi-v7a":1, "x86":2] 119 | def abi = output.getFilter(OutputFile.ABI) 120 | if (abi != null) { // null for the universal-debug, universal-release variants 121 | output.versionCodeOverride = 122 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 123 | } 124 | } 125 | } 126 | } 127 | 128 | dependencies { 129 | compile fileTree(dir: "libs", include: ["*.jar"]) 130 | compile "com.android.support:appcompat-v7:23.0.1" 131 | compile "com.facebook.react:react-native:+" // From node_modules 132 | } 133 | 134 | // Run this once to be able to run the application with BUCK 135 | // puts all compile dependencies into folder libs for BUCK to use 136 | task copyDownloadableDepsToLibs(type: Copy) { 137 | from configurations.compile 138 | into 'libs' 139 | } 140 | -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # okhttp 54 | 55 | -keepattributes Signature 56 | -keepattributes *Annotation* 57 | -keep class okhttp3.** { *; } 58 | -keep interface okhttp3.** { *; } 59 | -dontwarn okhttp3.** 60 | 61 | # okio 62 | 63 | -keep class sun.misc.Unsafe { *; } 64 | -dontwarn java.nio.file.* 65 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 66 | -dontwarn okio.** 67 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/rnpdemo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.rnpdemo; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "RNPDemo"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/rnpdemo/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.rnpdemo; 2 | 3 | import android.app.Application; 4 | import android.util.Log; 5 | 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.shell.MainReactPackage; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | public class MainApplication extends Application implements ReactApplication { 16 | 17 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 18 | @Override 19 | protected boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | return Arrays.asList( 26 | new MainReactPackage() 27 | ); 28 | } 29 | }; 30 | 31 | @Override 32 | public ReactNativeHost getReactNativeHost() { 33 | return mReactNativeHost; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oncethere/react-native-payworks/0e1a3e9e23def66588d13fe974b2be39988baac5/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RNPDemo 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.1' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oncethere/react-native-payworks/0e1a3e9e23def66588d13fe974b2be39988baac5/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /example/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = 'debug', 3 | store = 'debug.keystore', 4 | properties = 'debug.keystore.properties', 5 | visibility = [ 6 | 'PUBLIC', 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /example/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'RNPDemo' 2 | 3 | include ':app' 4 | -------------------------------------------------------------------------------- /example/index.android.js: -------------------------------------------------------------------------------- 1 | // 2 | // ReactNativePayworks 3 | // 4 | // Copyright OnceThere. All rights reserved. 5 | // Created by Peace Chen on 2/27/2018. 6 | // 7 | 8 | /** 9 | * React Native integration Demo using PayworksNative library 10 | * 11 | * The Android implementation is untested and needs work 12 | */ 13 | 14 | import React, { Component } from 'react'; 15 | import { 16 | AppRegistry, 17 | StyleSheet, 18 | Text, 19 | View, 20 | TouchableHighlight, 21 | NativeAppEventEmitter 22 | } from 'react-native'; 23 | import ReactNativePayworks from 'react-native-payworks'; 24 | import styles from './style'; 25 | 26 | class ReactNativePayworks extends Component { 27 | constructor(props) { 28 | super(props); 29 | 30 | this.state = { 31 | details: [], 32 | processing: false, 33 | showSignature: false 34 | }; 35 | 36 | this.payNowClick = this.payNowClick.bind(this); 37 | } 38 | 39 | componentWillMount() { 40 | this.payworksEventSub = NativeAppEventEmitter.addListener( 41 | 'PayworksTransactionEvent', 42 | (data) => { 43 | if (data.details) { 44 | let details = []; 45 | for (let i=0; i 48 | {data.details[i]} 49 | 50 | ); 51 | } 52 | this.setState({details}); 53 | } 54 | else if (data.action) { 55 | //ToDo: signature 56 | console.log("PayworksNative action:" + JSON.stringify(data.action)); 57 | } 58 | } 59 | ); 60 | } 61 | 62 | componentWillUnmount() { 63 | this.payworksEventSub.remove(); 64 | } 65 | 66 | payNowClick() { 67 | if(this.state.processing) { 68 | return; 69 | } 70 | this.setState({ processing: true }); 71 | ReactNativePayworks.transaction({ 72 | merchantIdentifier: "ff4487b8-f820-4204-a304-4fb96dc94016", 73 | merchantSecretKey: "5Hchy5Ws6Dn5xUiqJH7Q1VoPdIT3FTw9", 74 | chargeWithAmount: 10, 75 | currency: 22, 76 | optionals: { 77 | subject: "My purchase", 78 | customIdentifier: "purchase_id_123", 79 | applicationFee: 0.99, 80 | metadata: { 81 | customField1: "test1", 82 | customField2: "test2", 83 | } 84 | } 85 | }).then( 86 | (transaction) =>{ 87 | this.setState({ processing: false }); 88 | console.log("PayworksNative transaction:" + JSON.stringify(transaction)); 89 | }); 90 | } 91 | 92 | render() { 93 | let buttonStyle = this.state.processing? styles.buttonDisabled : null; 94 | return ( 95 | 96 | 97 | React Native Payworks Integration Demo 98 | 99 | 100 | {this.state.details} 101 | 102 | 106 | Pay Now 107 | 108 | 109 | {this.renderSignature(this.state.showSignature)} 110 | 111 | ); 112 | } 113 | 114 | renderSignature(showSig) { 115 | if (showSig) { 116 | return ( 117 | ToDo: Android signature pad 118 | ) 119 | } 120 | } 121 | 122 | } 123 | 124 | AppRegistry.registerComponent('ReactNativePayworks', () => ReactNativePayworks); 125 | -------------------------------------------------------------------------------- /example/index.ios.js: -------------------------------------------------------------------------------- 1 | // 2 | // ReactNativePayworks 3 | // 4 | // Created by Peace Chen on 2/27/2018. 5 | // Copyright OnceThere. All rights reserved. 6 | // 7 | 8 | /** 9 | * React Native integration Demo using PayworksNative library 10 | */ 11 | 12 | import React, { Component } from 'react'; 13 | import { 14 | AppRegistry, 15 | StyleSheet, 16 | Text, 17 | View, 18 | TouchableHighlight, 19 | NativeAppEventEmitter 20 | } from 'react-native'; 21 | import styles from './style'; 22 | import ReactNativePayworks from 'react-native-payworks'; 23 | import Sketch from 'react-native-sketch'; 24 | 25 | class RNPDemo extends Component { 26 | constructor(props) { 27 | super(props); 28 | 29 | this.state = { 30 | details: [], 31 | processing: false, 32 | encodedSignature: null, 33 | showSignature: false 34 | }; 35 | 36 | this.onSave = this.onSave.bind(this); 37 | this.onUpdate = this.onUpdate.bind(this); 38 | this.payNowClick = this.payNowClick.bind(this); 39 | this.cancelTransaction = this.cancelTransaction.bind(this); 40 | } 41 | 42 | componentWillMount() { 43 | this.payworksEventSub = NativeAppEventEmitter.addListener( 44 | 'PayworksTransactionEvent', 45 | (data) => { 46 | if (data.details && data.details.information) { 47 | let details = []; 48 | for (let i=0; i 51 | {data.details.information[i]} 52 | 53 | ); 54 | } 55 | this.setState({details}); 56 | } 57 | else if (data.action && data.action === "MPTransactionActionCustomerSignature") { 58 | console.log("PayworksNative action:" + JSON.stringify(data.action)); 59 | this.setState( {showSignature: true} ); 60 | } 61 | } 62 | ); 63 | } 64 | 65 | componentWillUnmount() { 66 | this.payworksEventSub.remove(); 67 | } 68 | 69 | onSave() { //Sketch 70 | if (!this.state.encodedSignature) { 71 | return; 72 | } 73 | this.sketch.saveImage(this.state.encodedSignature) 74 | .then((data) => { 75 | console.log(data); 76 | this.sketch.clear(); 77 | ReactNativePayworks.submitSignature(data.path); 78 | this.setState( {showSignature: false} ); 79 | }) 80 | .catch((error) => console.log(error)); 81 | } 82 | 83 | onUpdate(base64Image) { // Sketch 84 | this.setState({ encodedSignature: base64Image }); 85 | } 86 | 87 | payNowClick() { 88 | if(this.state.processing) { 89 | return; 90 | } 91 | this.setState({ processing: true }); 92 | ReactNativePayworks.transaction({ 93 | providerMode: 2, // Test 94 | merchantIdentifier: "ff4487b8-f820-4204-a304-4fb96dc94016", 95 | merchantSecretKey: "5Hchy5Ws6Dn5xUiqJH7Q1VoPdIT3FTw9", 96 | chargeWithAmount: 10, 97 | currency: 22, 98 | optionals: { 99 | subject: "My purchase", 100 | customIdentifier: "purchase_id_123", 101 | applicationFee: 0.99, 102 | metadata: { 103 | customField1: "test1", 104 | customField2: "test2", 105 | } 106 | } 107 | }).then( 108 | (transaction) =>{ 109 | this.setState({ processing: false }); 110 | console.log("PayworksNative transaction:" + JSON.stringify(transaction)); 111 | }); 112 | } 113 | 114 | cancelTransaction() { 115 | if(!this.state.processing) { 116 | return; 117 | } 118 | ReactNativePayworks.abortTransaction().then( 119 | (response) =>{ 120 | this.setState({ processing: false }); 121 | console.log("PayworksNative transaction cancel status " + JSON.stringify(response)); 122 | }); 123 | } 124 | 125 | render() { 126 | let buttonStyle = this.state.processing? styles.buttonDisabled : null; 127 | return ( 128 | 129 | 130 | React Native Payworks Integration Demo 131 | 132 | 133 | {this.state.details} 134 | 135 | { !this.state.processing ? 136 | 140 | Pay Now 141 | 142 | : 143 | 147 | Cancel Transaction 148 | 149 | } 150 | 151 | {this.renderSignature(this.state.showSignature)} 152 | 153 | ); 154 | } 155 | 156 | renderSignature(showSig) { 157 | if (showSig) { 158 | return ( 159 | 160 | { this.sketch = sketch; }} 166 | style={styles.signature} 167 | /> 168 | 169 | 173 | Save Signature 174 | 175 | 176 | ) 177 | } 178 | } 179 | 180 | } 181 | 182 | AppRegistry.registerComponent('RNPDemo', () => RNPDemo); 183 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '8.0' 2 | project 'RNPDemo.xcodeproj' 3 | source 'https://github.com/CocoaPods/Specs.git' 4 | source 'https://bitbucket.org/mpymnt/io.mpymnt.repo.pods.git' 5 | 6 | def pods 7 | pod 'react-native-payworks', :path => '../node_modules/react-native-payworks/ios' 8 | pod 'React', :path => '../node_modules/react-native' 9 | end 10 | 11 | target 'RNPDemo' do 12 | pods 13 | end 14 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CocoaLumberjack (2.0.3): 3 | - CocoaLumberjack/Default (= 2.0.3) 4 | - CocoaLumberjack/Extensions (= 2.0.3) 5 | - CocoaLumberjack/Core (2.0.3) 6 | - CocoaLumberjack/Default (2.0.3): 7 | - CocoaLumberjack/Core 8 | - CocoaLumberjack/Extensions (2.0.3): 9 | - CocoaLumberjack/Default 10 | - payworks (2.16.0): 11 | - payworks/mpos (= 2.16.0) 12 | - payworks/mpos (2.16.0): 13 | - payworks/mpos/accessories (= 2.16.0) 14 | - payworks/mpos/comlinks (= 2.16.0) 15 | - payworks/mpos/core (= 2.16.0) 16 | - payworks/mpos/accessories (2.16.0): 17 | - payworks/mpos/accessories/miura (= 2.16.0) 18 | - payworks/mpos/accessories/sewoo (= 2.16.0) 19 | - payworks/mpos/accessories/verifone-e105 (= 2.16.0) 20 | - payworks/mpos/accessories/miura (2.16.0): 21 | - payworks/mpos/comlinks/externalaccessory 22 | - payworks/mpos/comlinks/tcp 23 | - payworks/mpos/core 24 | - payworks/mpos/accessories/sewoo (2.16.0): 25 | - payworks/mpos/core 26 | - payworks/mpos/accessories/verifone-e105 (2.16.0): 27 | - payworks/mpos/comlinks/verifone 28 | - payworks/mpos/core 29 | - payworks/mpos/comlinks (2.16.0): 30 | - payworks/mpos/comlinks/externalaccessory (= 2.16.0) 31 | - payworks/mpos/comlinks/tcp (= 2.16.0) 32 | - payworks/mpos/comlinks/verifone (= 2.16.0) 33 | - payworks/mpos/comlinks/externalaccessory (2.16.0): 34 | - payworks/mpos/core 35 | - payworks/mpos/comlinks/tcp (2.16.0): 36 | - payworks/mpos/core 37 | - payworks/mpos/comlinks/verifone (2.16.0): 38 | - payworks/mpos/core 39 | - payworks/mpos/core (2.16.0): 40 | - CocoaLumberjack (~> 2.0.0) 41 | - React (0.34.1): 42 | - React/Core (= 0.34.1) 43 | - react-native-payworks (0.1.0): 44 | - payworks (~> 2.16.0) 45 | - React/Core (0.34.1) 46 | 47 | DEPENDENCIES: 48 | - React (from `../node_modules/react-native`) 49 | - react-native-payworks (from `../node_modules/react-native-payworks/ios`) 50 | 51 | EXTERNAL SOURCES: 52 | React: 53 | :path: ../node_modules/react-native 54 | react-native-payworks: 55 | :path: ../node_modules/react-native-payworks/ios 56 | 57 | SPEC CHECKSUMS: 58 | CocoaLumberjack: f58d8a19629f4d8379ae14bb3534def24161430e 59 | payworks: 8dcb08fc088d66ba64e0725dbe70a3dba69346aa 60 | React: fc15d22bec0ec10fe15c12749fbefdac37ddc541 61 | react-native-payworks: 41c7d7d6363b8d4e7621ebcc437bc7310fcf438d 62 | 63 | PODFILE CHECKSUM: cda4252bc6afe80b47acac4b2cb2cfb534f5ecf8 64 | 65 | COCOAPODS: 1.1.1 66 | -------------------------------------------------------------------------------- /example/ios/RNPDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 15 | 00E356F31AD99517003FC87E /* RNPDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* RNPDemoTests.m */; }; 16 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 17 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 18 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 19 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 20 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 21 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 22 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 23 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 24 | 2D90584C033D179272D3933A /* libPods-RNPDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 55B47EDFBFAA9A31EC9AD238 /* libPods-RNPDemo.a */; }; 25 | 808C6D7AD40B47BA9B7FD191 /* libRNSketch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F6D96F1606E4A598C9B3AE7 /* libRNSketch.a */; }; 26 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 27 | CE90BE6A1E3962AB0018FD59 /* libReactNativePayworks.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CE8FD5071E39548F0055AAFA /* libReactNativePayworks.a */; }; 28 | CEA9CF721E3A4E920031A71A /* libReactNativePayworks.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CE8FD5071E39548F0055AAFA /* libReactNativePayworks.a */; }; 29 | CEA9CF7F1E3A4E970031A71A /* libCocoaLumberjack.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CEA9CF7E1E3A4E970031A71A /* libCocoaLumberjack.a */; }; 30 | CEF540EB1EA963F900A20F4A /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CEF540E81EA9639200A20F4A /* libReact.a */; }; 31 | /* End PBXBuildFile section */ 32 | 33 | /* Begin PBXContainerItemProxy section */ 34 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 37 | proxyType = 2; 38 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 39 | remoteInfo = RCTActionSheet; 40 | }; 41 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 44 | proxyType = 2; 45 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 46 | remoteInfo = RCTGeolocation; 47 | }; 48 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 49 | isa = PBXContainerItemProxy; 50 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 51 | proxyType = 2; 52 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 53 | remoteInfo = RCTImage; 54 | }; 55 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 56 | isa = PBXContainerItemProxy; 57 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 58 | proxyType = 2; 59 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 60 | remoteInfo = RCTNetwork; 61 | }; 62 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 63 | isa = PBXContainerItemProxy; 64 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 65 | proxyType = 2; 66 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 67 | remoteInfo = RCTVibration; 68 | }; 69 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 70 | isa = PBXContainerItemProxy; 71 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 72 | proxyType = 1; 73 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 74 | remoteInfo = RNPDemo; 75 | }; 76 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 77 | isa = PBXContainerItemProxy; 78 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 79 | proxyType = 2; 80 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 81 | remoteInfo = RCTSettings; 82 | }; 83 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 84 | isa = PBXContainerItemProxy; 85 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 86 | proxyType = 2; 87 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 88 | remoteInfo = RCTWebSocket; 89 | }; 90 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 91 | isa = PBXContainerItemProxy; 92 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 93 | proxyType = 2; 94 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 95 | remoteInfo = React; 96 | }; 97 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 98 | isa = PBXContainerItemProxy; 99 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 100 | proxyType = 2; 101 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 102 | remoteInfo = RCTLinking; 103 | }; 104 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 105 | isa = PBXContainerItemProxy; 106 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 107 | proxyType = 2; 108 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 109 | remoteInfo = RCTText; 110 | }; 111 | CE2660C71E3958890011881D /* PBXContainerItemProxy */ = { 112 | isa = PBXContainerItemProxy; 113 | containerPortal = C7D943E6AC1D40F294F6DC5F /* RNSketch.xcodeproj */; 114 | proxyType = 2; 115 | remoteGlobalIDString = D03120661CD1FA5200897D5B; 116 | remoteInfo = RNSketch; 117 | }; 118 | CE8FD5061E39548F0055AAFA /* PBXContainerItemProxy */ = { 119 | isa = PBXContainerItemProxy; 120 | containerPortal = CE8FD4F71E39548F0055AAFA /* ReactNativePayworks.xcodeproj */; 121 | proxyType = 2; 122 | remoteGlobalIDString = 13B07F961A680F5B00A75B9A; 123 | remoteInfo = ReactNativePayworks; 124 | }; 125 | /* End PBXContainerItemProxy section */ 126 | 127 | /* Begin PBXFileReference section */ 128 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 129 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 130 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 131 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 132 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 133 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 134 | 00E356EE1AD99517003FC87E /* RNPDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNPDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 135 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 136 | 00E356F21AD99517003FC87E /* RNPDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNPDemoTests.m; sourceTree = ""; }; 137 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 138 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 139 | 13B07F961A680F5B00A75B9A /* RNPDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RNPDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 140 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = RNPDemo/AppDelegate.h; sourceTree = ""; }; 141 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = RNPDemo/AppDelegate.m; sourceTree = ""; }; 142 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 143 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNPDemo/Images.xcassets; sourceTree = ""; }; 144 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNPDemo/Info.plist; sourceTree = ""; }; 145 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = RNPDemo/main.m; sourceTree = ""; }; 146 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 147 | 4F6D96F1606E4A598C9B3AE7 /* libRNSketch.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNSketch.a; sourceTree = ""; }; 148 | 55B47EDFBFAA9A31EC9AD238 /* libPods-RNPDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNPDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 149 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 150 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 151 | A28C6B1116217E29DB00D5A0 /* Pods-RNPDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNPDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNPDemo/Pods-RNPDemo.debug.xcconfig"; sourceTree = ""; }; 152 | C7D943E6AC1D40F294F6DC5F /* RNSketch.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNSketch.xcodeproj; path = "../node_modules/react-native-sketch/RNSketch.xcodeproj"; sourceTree = ""; }; 153 | CE8FD4F71E39548F0055AAFA /* ReactNativePayworks.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactNativePayworks.xcodeproj; path = ../../ios/ReactNativePayworks.xcodeproj; sourceTree = ""; }; 154 | CEA9CF7E1E3A4E970031A71A /* libCocoaLumberjack.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libCocoaLumberjack.a; path = "../../../../Library/Developer/Xcode/DerivedData/RNPDemo-agaylqixelmghndmethovdofchcd/Build/Products/Debug-iphoneos/CocoaLumberjack/libCocoaLumberjack.a"; sourceTree = ""; }; 155 | CEF540E81EA9639200A20F4A /* libReact.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libReact.a; path = "../../../../Library/Developer/Xcode/DerivedData/RNPDemo-agaylqixelmghndmethovdofchcd/Build/Products/Debug-iphoneos/React/libReact.a"; sourceTree = ""; }; 156 | D32A628EAE8953C99B8952F0 /* Pods-RNPDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNPDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-RNPDemo/Pods-RNPDemo.release.xcconfig"; sourceTree = ""; }; 157 | /* End PBXFileReference section */ 158 | 159 | /* Begin PBXFrameworksBuildPhase section */ 160 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 161 | isa = PBXFrameworksBuildPhase; 162 | buildActionMask = 2147483647; 163 | files = ( 164 | CE90BE6A1E3962AB0018FD59 /* libReactNativePayworks.a in Frameworks */, 165 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 170 | isa = PBXFrameworksBuildPhase; 171 | buildActionMask = 2147483647; 172 | files = ( 173 | CEF540EB1EA963F900A20F4A /* libReact.a in Frameworks */, 174 | CEA9CF7F1E3A4E970031A71A /* libCocoaLumberjack.a in Frameworks */, 175 | CEA9CF721E3A4E920031A71A /* libReactNativePayworks.a in Frameworks */, 176 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 177 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 178 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 179 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 180 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 181 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 182 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 183 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 184 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 185 | 2D90584C033D179272D3933A /* libPods-RNPDemo.a in Frameworks */, 186 | 808C6D7AD40B47BA9B7FD191 /* libRNSketch.a in Frameworks */, 187 | ); 188 | runOnlyForDeploymentPostprocessing = 0; 189 | }; 190 | /* End PBXFrameworksBuildPhase section */ 191 | 192 | /* Begin PBXGroup section */ 193 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 194 | isa = PBXGroup; 195 | children = ( 196 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 197 | ); 198 | name = Products; 199 | sourceTree = ""; 200 | }; 201 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 202 | isa = PBXGroup; 203 | children = ( 204 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 205 | ); 206 | name = Products; 207 | sourceTree = ""; 208 | }; 209 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 210 | isa = PBXGroup; 211 | children = ( 212 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 213 | ); 214 | name = Products; 215 | sourceTree = ""; 216 | }; 217 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 218 | isa = PBXGroup; 219 | children = ( 220 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 221 | ); 222 | name = Products; 223 | sourceTree = ""; 224 | }; 225 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 226 | isa = PBXGroup; 227 | children = ( 228 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 229 | ); 230 | name = Products; 231 | sourceTree = ""; 232 | }; 233 | 00E356EF1AD99517003FC87E /* RNPDemoTests */ = { 234 | isa = PBXGroup; 235 | children = ( 236 | 00E356F21AD99517003FC87E /* RNPDemoTests.m */, 237 | 00E356F01AD99517003FC87E /* Supporting Files */, 238 | ); 239 | path = RNPDemoTests; 240 | sourceTree = ""; 241 | }; 242 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 243 | isa = PBXGroup; 244 | children = ( 245 | 00E356F11AD99517003FC87E /* Info.plist */, 246 | ); 247 | name = "Supporting Files"; 248 | sourceTree = ""; 249 | }; 250 | 139105B71AF99BAD00B5F7CC /* Products */ = { 251 | isa = PBXGroup; 252 | children = ( 253 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 254 | ); 255 | name = Products; 256 | sourceTree = ""; 257 | }; 258 | 139FDEE71B06529A00C62182 /* Products */ = { 259 | isa = PBXGroup; 260 | children = ( 261 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 262 | ); 263 | name = Products; 264 | sourceTree = ""; 265 | }; 266 | 13B07FAE1A68108700A75B9A /* RNPDemo */ = { 267 | isa = PBXGroup; 268 | children = ( 269 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 270 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 271 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 272 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 273 | 13B07FB61A68108700A75B9A /* Info.plist */, 274 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 275 | 13B07FB71A68108700A75B9A /* main.m */, 276 | ); 277 | name = RNPDemo; 278 | sourceTree = ""; 279 | }; 280 | 146834001AC3E56700842450 /* Products */ = { 281 | isa = PBXGroup; 282 | children = ( 283 | 146834041AC3E56700842450 /* libReact.a */, 284 | ); 285 | name = Products; 286 | sourceTree = ""; 287 | }; 288 | 3A380D956B7799A021CE0837 /* Pods */ = { 289 | isa = PBXGroup; 290 | children = ( 291 | A28C6B1116217E29DB00D5A0 /* Pods-RNPDemo.debug.xcconfig */, 292 | D32A628EAE8953C99B8952F0 /* Pods-RNPDemo.release.xcconfig */, 293 | ); 294 | name = Pods; 295 | sourceTree = ""; 296 | }; 297 | 44326D4666971FBC05456A0F /* Frameworks */ = { 298 | isa = PBXGroup; 299 | children = ( 300 | CEF540E81EA9639200A20F4A /* libReact.a */, 301 | CEA9CF7E1E3A4E970031A71A /* libCocoaLumberjack.a */, 302 | 55B47EDFBFAA9A31EC9AD238 /* libPods-RNPDemo.a */, 303 | ); 304 | name = Frameworks; 305 | sourceTree = ""; 306 | }; 307 | 78C398B11ACF4ADC00677621 /* Products */ = { 308 | isa = PBXGroup; 309 | children = ( 310 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 311 | ); 312 | name = Products; 313 | sourceTree = ""; 314 | }; 315 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 316 | isa = PBXGroup; 317 | children = ( 318 | CE8FD4F71E39548F0055AAFA /* ReactNativePayworks.xcodeproj */, 319 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 320 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 321 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 322 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 323 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 324 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 325 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 326 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 327 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 328 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 329 | C7D943E6AC1D40F294F6DC5F /* RNSketch.xcodeproj */, 330 | ); 331 | name = Libraries; 332 | sourceTree = ""; 333 | }; 334 | 832341B11AAA6A8300B99B32 /* Products */ = { 335 | isa = PBXGroup; 336 | children = ( 337 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 338 | ); 339 | name = Products; 340 | sourceTree = ""; 341 | }; 342 | 83CBB9F61A601CBA00E9B192 = { 343 | isa = PBXGroup; 344 | children = ( 345 | 13B07FAE1A68108700A75B9A /* RNPDemo */, 346 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 347 | 00E356EF1AD99517003FC87E /* RNPDemoTests */, 348 | 83CBBA001A601CBA00E9B192 /* Products */, 349 | 3A380D956B7799A021CE0837 /* Pods */, 350 | 44326D4666971FBC05456A0F /* Frameworks */, 351 | ); 352 | indentWidth = 2; 353 | sourceTree = ""; 354 | tabWidth = 2; 355 | }; 356 | 83CBBA001A601CBA00E9B192 /* Products */ = { 357 | isa = PBXGroup; 358 | children = ( 359 | 13B07F961A680F5B00A75B9A /* RNPDemo.app */, 360 | 00E356EE1AD99517003FC87E /* RNPDemoTests.xctest */, 361 | ); 362 | name = Products; 363 | sourceTree = ""; 364 | }; 365 | CE2660B81E3958890011881D /* Products */ = { 366 | isa = PBXGroup; 367 | children = ( 368 | CE2660C81E3958890011881D /* libRNSketch.a */, 369 | ); 370 | name = Products; 371 | sourceTree = ""; 372 | }; 373 | CE8FD4F81E39548F0055AAFA /* Products */ = { 374 | isa = PBXGroup; 375 | children = ( 376 | CE8FD5071E39548F0055AAFA /* libReactNativePayworks.a */, 377 | ); 378 | name = Products; 379 | sourceTree = ""; 380 | }; 381 | /* End PBXGroup section */ 382 | 383 | /* Begin PBXNativeTarget section */ 384 | 00E356ED1AD99517003FC87E /* RNPDemoTests */ = { 385 | isa = PBXNativeTarget; 386 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "RNPDemoTests" */; 387 | buildPhases = ( 388 | 00E356EA1AD99517003FC87E /* Sources */, 389 | 00E356EB1AD99517003FC87E /* Frameworks */, 390 | 00E356EC1AD99517003FC87E /* Resources */, 391 | ); 392 | buildRules = ( 393 | ); 394 | dependencies = ( 395 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 396 | ); 397 | name = RNPDemoTests; 398 | productName = RNPDemoTests; 399 | productReference = 00E356EE1AD99517003FC87E /* RNPDemoTests.xctest */; 400 | productType = "com.apple.product-type.bundle.unit-test"; 401 | }; 402 | 13B07F861A680F5B00A75B9A /* RNPDemo */ = { 403 | isa = PBXNativeTarget; 404 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "RNPDemo" */; 405 | buildPhases = ( 406 | 0A0D169500A318FB30B45EA9 /* [CP] Check Pods Manifest.lock */, 407 | 13B07F871A680F5B00A75B9A /* Sources */, 408 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 409 | 13B07F8E1A680F5B00A75B9A /* Resources */, 410 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 411 | 80476B87DD8A0CAEF93091C5 /* [CP] Embed Pods Frameworks */, 412 | 0E8FD3D3B72014943FA41EB4 /* [CP] Copy Pods Resources */, 413 | ); 414 | buildRules = ( 415 | ); 416 | dependencies = ( 417 | ); 418 | name = RNPDemo; 419 | productName = "Hello World"; 420 | productReference = 13B07F961A680F5B00A75B9A /* RNPDemo.app */; 421 | productType = "com.apple.product-type.application"; 422 | }; 423 | /* End PBXNativeTarget section */ 424 | 425 | /* Begin PBXProject section */ 426 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 427 | isa = PBXProject; 428 | attributes = { 429 | LastUpgradeCheck = 610; 430 | ORGANIZATIONNAME = Facebook; 431 | TargetAttributes = { 432 | 00E356ED1AD99517003FC87E = { 433 | CreatedOnToolsVersion = 6.2; 434 | DevelopmentTeam = Q553658QDY; 435 | TestTargetID = 13B07F861A680F5B00A75B9A; 436 | }; 437 | 13B07F861A680F5B00A75B9A = { 438 | DevelopmentTeam = Q553658QDY; 439 | }; 440 | }; 441 | }; 442 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "RNPDemo" */; 443 | compatibilityVersion = "Xcode 3.2"; 444 | developmentRegion = English; 445 | hasScannedForEncodings = 0; 446 | knownRegions = ( 447 | en, 448 | Base, 449 | ); 450 | mainGroup = 83CBB9F61A601CBA00E9B192; 451 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 452 | projectDirPath = ""; 453 | projectReferences = ( 454 | { 455 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 456 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 457 | }, 458 | { 459 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 460 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 461 | }, 462 | { 463 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 464 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 465 | }, 466 | { 467 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 468 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 469 | }, 470 | { 471 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 472 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 473 | }, 474 | { 475 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 476 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 477 | }, 478 | { 479 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 480 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 481 | }, 482 | { 483 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 484 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 485 | }, 486 | { 487 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 488 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 489 | }, 490 | { 491 | ProductGroup = 146834001AC3E56700842450 /* Products */; 492 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 493 | }, 494 | { 495 | ProductGroup = CE8FD4F81E39548F0055AAFA /* Products */; 496 | ProjectRef = CE8FD4F71E39548F0055AAFA /* ReactNativePayworks.xcodeproj */; 497 | }, 498 | { 499 | ProductGroup = CE2660B81E3958890011881D /* Products */; 500 | ProjectRef = C7D943E6AC1D40F294F6DC5F /* RNSketch.xcodeproj */; 501 | }, 502 | ); 503 | projectRoot = ""; 504 | targets = ( 505 | 13B07F861A680F5B00A75B9A /* RNPDemo */, 506 | 00E356ED1AD99517003FC87E /* RNPDemoTests */, 507 | ); 508 | }; 509 | /* End PBXProject section */ 510 | 511 | /* Begin PBXReferenceProxy section */ 512 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 513 | isa = PBXReferenceProxy; 514 | fileType = archive.ar; 515 | path = libRCTActionSheet.a; 516 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 517 | sourceTree = BUILT_PRODUCTS_DIR; 518 | }; 519 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 520 | isa = PBXReferenceProxy; 521 | fileType = archive.ar; 522 | path = libRCTGeolocation.a; 523 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 524 | sourceTree = BUILT_PRODUCTS_DIR; 525 | }; 526 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 527 | isa = PBXReferenceProxy; 528 | fileType = archive.ar; 529 | path = libRCTImage.a; 530 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 531 | sourceTree = BUILT_PRODUCTS_DIR; 532 | }; 533 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 534 | isa = PBXReferenceProxy; 535 | fileType = archive.ar; 536 | path = libRCTNetwork.a; 537 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 538 | sourceTree = BUILT_PRODUCTS_DIR; 539 | }; 540 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 541 | isa = PBXReferenceProxy; 542 | fileType = archive.ar; 543 | path = libRCTVibration.a; 544 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 545 | sourceTree = BUILT_PRODUCTS_DIR; 546 | }; 547 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 548 | isa = PBXReferenceProxy; 549 | fileType = archive.ar; 550 | path = libRCTSettings.a; 551 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 552 | sourceTree = BUILT_PRODUCTS_DIR; 553 | }; 554 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 555 | isa = PBXReferenceProxy; 556 | fileType = archive.ar; 557 | path = libRCTWebSocket.a; 558 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 559 | sourceTree = BUILT_PRODUCTS_DIR; 560 | }; 561 | 146834041AC3E56700842450 /* libReact.a */ = { 562 | isa = PBXReferenceProxy; 563 | fileType = archive.ar; 564 | path = libReact.a; 565 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 566 | sourceTree = BUILT_PRODUCTS_DIR; 567 | }; 568 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 569 | isa = PBXReferenceProxy; 570 | fileType = archive.ar; 571 | path = libRCTLinking.a; 572 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 573 | sourceTree = BUILT_PRODUCTS_DIR; 574 | }; 575 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 576 | isa = PBXReferenceProxy; 577 | fileType = archive.ar; 578 | path = libRCTText.a; 579 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 580 | sourceTree = BUILT_PRODUCTS_DIR; 581 | }; 582 | CE2660C81E3958890011881D /* libRNSketch.a */ = { 583 | isa = PBXReferenceProxy; 584 | fileType = archive.ar; 585 | path = libRNSketch.a; 586 | remoteRef = CE2660C71E3958890011881D /* PBXContainerItemProxy */; 587 | sourceTree = BUILT_PRODUCTS_DIR; 588 | }; 589 | CE8FD5071E39548F0055AAFA /* libReactNativePayworks.a */ = { 590 | isa = PBXReferenceProxy; 591 | fileType = archive.ar; 592 | path = libReactNativePayworks.a; 593 | remoteRef = CE8FD5061E39548F0055AAFA /* PBXContainerItemProxy */; 594 | sourceTree = BUILT_PRODUCTS_DIR; 595 | }; 596 | /* End PBXReferenceProxy section */ 597 | 598 | /* Begin PBXResourcesBuildPhase section */ 599 | 00E356EC1AD99517003FC87E /* Resources */ = { 600 | isa = PBXResourcesBuildPhase; 601 | buildActionMask = 2147483647; 602 | files = ( 603 | ); 604 | runOnlyForDeploymentPostprocessing = 0; 605 | }; 606 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 607 | isa = PBXResourcesBuildPhase; 608 | buildActionMask = 2147483647; 609 | files = ( 610 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 611 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 612 | ); 613 | runOnlyForDeploymentPostprocessing = 0; 614 | }; 615 | /* End PBXResourcesBuildPhase section */ 616 | 617 | /* Begin PBXShellScriptBuildPhase section */ 618 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 619 | isa = PBXShellScriptBuildPhase; 620 | buildActionMask = 2147483647; 621 | files = ( 622 | ); 623 | inputPaths = ( 624 | ); 625 | name = "Bundle React Native code and images"; 626 | outputPaths = ( 627 | ); 628 | runOnlyForDeploymentPostprocessing = 0; 629 | shellPath = /bin/sh; 630 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; 631 | }; 632 | 0A0D169500A318FB30B45EA9 /* [CP] Check Pods Manifest.lock */ = { 633 | isa = PBXShellScriptBuildPhase; 634 | buildActionMask = 2147483647; 635 | files = ( 636 | ); 637 | inputPaths = ( 638 | ); 639 | name = "[CP] Check Pods Manifest.lock"; 640 | outputPaths = ( 641 | ); 642 | runOnlyForDeploymentPostprocessing = 0; 643 | shellPath = /bin/sh; 644 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; 645 | showEnvVarsInLog = 0; 646 | }; 647 | 0E8FD3D3B72014943FA41EB4 /* [CP] Copy Pods Resources */ = { 648 | isa = PBXShellScriptBuildPhase; 649 | buildActionMask = 2147483647; 650 | files = ( 651 | ); 652 | inputPaths = ( 653 | ); 654 | name = "[CP] Copy Pods Resources"; 655 | outputPaths = ( 656 | ); 657 | runOnlyForDeploymentPostprocessing = 0; 658 | shellPath = /bin/sh; 659 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RNPDemo/Pods-RNPDemo-resources.sh\"\n"; 660 | showEnvVarsInLog = 0; 661 | }; 662 | 80476B87DD8A0CAEF93091C5 /* [CP] Embed Pods Frameworks */ = { 663 | isa = PBXShellScriptBuildPhase; 664 | buildActionMask = 2147483647; 665 | files = ( 666 | ); 667 | inputPaths = ( 668 | ); 669 | name = "[CP] Embed Pods Frameworks"; 670 | outputPaths = ( 671 | ); 672 | runOnlyForDeploymentPostprocessing = 0; 673 | shellPath = /bin/sh; 674 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RNPDemo/Pods-RNPDemo-frameworks.sh\"\n"; 675 | showEnvVarsInLog = 0; 676 | }; 677 | /* End PBXShellScriptBuildPhase section */ 678 | 679 | /* Begin PBXSourcesBuildPhase section */ 680 | 00E356EA1AD99517003FC87E /* Sources */ = { 681 | isa = PBXSourcesBuildPhase; 682 | buildActionMask = 2147483647; 683 | files = ( 684 | 00E356F31AD99517003FC87E /* RNPDemoTests.m in Sources */, 685 | ); 686 | runOnlyForDeploymentPostprocessing = 0; 687 | }; 688 | 13B07F871A680F5B00A75B9A /* Sources */ = { 689 | isa = PBXSourcesBuildPhase; 690 | buildActionMask = 2147483647; 691 | files = ( 692 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 693 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 694 | ); 695 | runOnlyForDeploymentPostprocessing = 0; 696 | }; 697 | /* End PBXSourcesBuildPhase section */ 698 | 699 | /* Begin PBXTargetDependency section */ 700 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 701 | isa = PBXTargetDependency; 702 | target = 13B07F861A680F5B00A75B9A /* RNPDemo */; 703 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 704 | }; 705 | /* End PBXTargetDependency section */ 706 | 707 | /* Begin PBXVariantGroup section */ 708 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 709 | isa = PBXVariantGroup; 710 | children = ( 711 | 13B07FB21A68108700A75B9A /* Base */, 712 | ); 713 | name = LaunchScreen.xib; 714 | path = RNPDemo; 715 | sourceTree = ""; 716 | }; 717 | /* End PBXVariantGroup section */ 718 | 719 | /* Begin XCBuildConfiguration section */ 720 | 00E356F61AD99517003FC87E /* Debug */ = { 721 | isa = XCBuildConfiguration; 722 | buildSettings = { 723 | BUNDLE_LOADER = "$(TEST_HOST)"; 724 | DEVELOPMENT_TEAM = Q553658QDY; 725 | GCC_PREPROCESSOR_DEFINITIONS = ( 726 | "DEBUG=1", 727 | "$(inherited)", 728 | ); 729 | INFOPLIST_FILE = RNPDemoTests/Info.plist; 730 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 731 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 732 | LIBRARY_SEARCH_PATHS = ( 733 | "$(inherited)", 734 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 735 | ); 736 | PRODUCT_NAME = "$(TARGET_NAME)"; 737 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RNPDemo.app/RNPDemo"; 738 | }; 739 | name = Debug; 740 | }; 741 | 00E356F71AD99517003FC87E /* Release */ = { 742 | isa = XCBuildConfiguration; 743 | buildSettings = { 744 | BUNDLE_LOADER = "$(TEST_HOST)"; 745 | COPY_PHASE_STRIP = NO; 746 | DEVELOPMENT_TEAM = Q553658QDY; 747 | INFOPLIST_FILE = RNPDemoTests/Info.plist; 748 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 749 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 750 | LIBRARY_SEARCH_PATHS = ( 751 | "$(inherited)", 752 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 753 | ); 754 | PRODUCT_NAME = "$(TARGET_NAME)"; 755 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RNPDemo.app/RNPDemo"; 756 | }; 757 | name = Release; 758 | }; 759 | 13B07F941A680F5B00A75B9A /* Debug */ = { 760 | isa = XCBuildConfiguration; 761 | baseConfigurationReference = A28C6B1116217E29DB00D5A0 /* Pods-RNPDemo.debug.xcconfig */; 762 | buildSettings = { 763 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 764 | CURRENT_PROJECT_VERSION = 1; 765 | DEAD_CODE_STRIPPING = NO; 766 | DEVELOPMENT_TEAM = Q553658QDY; 767 | ENABLE_BITCODE = NO; 768 | HEADER_SEARCH_PATHS = ( 769 | "$(inherited)", 770 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 771 | "$(SRCROOT)/../node_modules/react-native/React/**", 772 | "$(SRCROOT)/../node_modules/react-native-sketch/RNSketch", 773 | ); 774 | INFOPLIST_FILE = RNPDemo/Info.plist; 775 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 776 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 777 | OTHER_LDFLAGS = ( 778 | "$(inherited)", 779 | "-ObjC", 780 | "-lc++", 781 | ); 782 | PRODUCT_NAME = RNPDemo; 783 | TARGETED_DEVICE_FAMILY = "1,2"; 784 | VERSIONING_SYSTEM = "apple-generic"; 785 | }; 786 | name = Debug; 787 | }; 788 | 13B07F951A680F5B00A75B9A /* Release */ = { 789 | isa = XCBuildConfiguration; 790 | baseConfigurationReference = D32A628EAE8953C99B8952F0 /* Pods-RNPDemo.release.xcconfig */; 791 | buildSettings = { 792 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 793 | CURRENT_PROJECT_VERSION = 1; 794 | DEVELOPMENT_TEAM = Q553658QDY; 795 | ENABLE_BITCODE = NO; 796 | HEADER_SEARCH_PATHS = ( 797 | "$(inherited)", 798 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 799 | "$(SRCROOT)/../node_modules/react-native/React/**", 800 | "$(SRCROOT)/../node_modules/react-native-sketch/RNSketch", 801 | ); 802 | INFOPLIST_FILE = RNPDemo/Info.plist; 803 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 804 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 805 | OTHER_LDFLAGS = ( 806 | "$(inherited)", 807 | "-ObjC", 808 | "-lc++", 809 | ); 810 | PRODUCT_NAME = RNPDemo; 811 | TARGETED_DEVICE_FAMILY = "1,2"; 812 | VERSIONING_SYSTEM = "apple-generic"; 813 | }; 814 | name = Release; 815 | }; 816 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 817 | isa = XCBuildConfiguration; 818 | buildSettings = { 819 | ALWAYS_SEARCH_USER_PATHS = NO; 820 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 821 | CLANG_CXX_LIBRARY = "libc++"; 822 | CLANG_ENABLE_MODULES = YES; 823 | CLANG_ENABLE_OBJC_ARC = YES; 824 | CLANG_WARN_BOOL_CONVERSION = YES; 825 | CLANG_WARN_CONSTANT_CONVERSION = YES; 826 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 827 | CLANG_WARN_EMPTY_BODY = YES; 828 | CLANG_WARN_ENUM_CONVERSION = YES; 829 | CLANG_WARN_INT_CONVERSION = YES; 830 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 831 | CLANG_WARN_UNREACHABLE_CODE = YES; 832 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 833 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 834 | COPY_PHASE_STRIP = NO; 835 | ENABLE_STRICT_OBJC_MSGSEND = YES; 836 | GCC_C_LANGUAGE_STANDARD = gnu99; 837 | GCC_DYNAMIC_NO_PIC = NO; 838 | GCC_OPTIMIZATION_LEVEL = 0; 839 | GCC_PREPROCESSOR_DEFINITIONS = ( 840 | "DEBUG=1", 841 | "$(inherited)", 842 | ); 843 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 844 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 845 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 846 | GCC_WARN_UNDECLARED_SELECTOR = YES; 847 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 848 | GCC_WARN_UNUSED_FUNCTION = YES; 849 | GCC_WARN_UNUSED_VARIABLE = YES; 850 | HEADER_SEARCH_PATHS = ( 851 | "$(inherited)", 852 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 853 | "$(SRCROOT)/../node_modules/react-native/React/**", 854 | "$(SRCROOT)/../node_modules/react-native-sketch/RNSketch", 855 | ); 856 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 857 | MTL_ENABLE_DEBUG_INFO = YES; 858 | ONLY_ACTIVE_ARCH = YES; 859 | SDKROOT = iphoneos; 860 | }; 861 | name = Debug; 862 | }; 863 | 83CBBA211A601CBA00E9B192 /* Release */ = { 864 | isa = XCBuildConfiguration; 865 | buildSettings = { 866 | ALWAYS_SEARCH_USER_PATHS = NO; 867 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 868 | CLANG_CXX_LIBRARY = "libc++"; 869 | CLANG_ENABLE_MODULES = YES; 870 | CLANG_ENABLE_OBJC_ARC = YES; 871 | CLANG_WARN_BOOL_CONVERSION = YES; 872 | CLANG_WARN_CONSTANT_CONVERSION = YES; 873 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 874 | CLANG_WARN_EMPTY_BODY = YES; 875 | CLANG_WARN_ENUM_CONVERSION = YES; 876 | CLANG_WARN_INT_CONVERSION = YES; 877 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 878 | CLANG_WARN_UNREACHABLE_CODE = YES; 879 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 880 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 881 | COPY_PHASE_STRIP = YES; 882 | ENABLE_NS_ASSERTIONS = NO; 883 | ENABLE_STRICT_OBJC_MSGSEND = YES; 884 | GCC_C_LANGUAGE_STANDARD = gnu99; 885 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 886 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 887 | GCC_WARN_UNDECLARED_SELECTOR = YES; 888 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 889 | GCC_WARN_UNUSED_FUNCTION = YES; 890 | GCC_WARN_UNUSED_VARIABLE = YES; 891 | HEADER_SEARCH_PATHS = ( 892 | "$(inherited)", 893 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 894 | "$(SRCROOT)/../node_modules/react-native/React/**", 895 | "$(SRCROOT)/../node_modules/react-native-sketch/RNSketch", 896 | ); 897 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 898 | MTL_ENABLE_DEBUG_INFO = NO; 899 | SDKROOT = iphoneos; 900 | VALIDATE_PRODUCT = YES; 901 | }; 902 | name = Release; 903 | }; 904 | /* End XCBuildConfiguration section */ 905 | 906 | /* Begin XCConfigurationList section */ 907 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "RNPDemoTests" */ = { 908 | isa = XCConfigurationList; 909 | buildConfigurations = ( 910 | 00E356F61AD99517003FC87E /* Debug */, 911 | 00E356F71AD99517003FC87E /* Release */, 912 | ); 913 | defaultConfigurationIsVisible = 0; 914 | defaultConfigurationName = Release; 915 | }; 916 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "RNPDemo" */ = { 917 | isa = XCConfigurationList; 918 | buildConfigurations = ( 919 | 13B07F941A680F5B00A75B9A /* Debug */, 920 | 13B07F951A680F5B00A75B9A /* Release */, 921 | ); 922 | defaultConfigurationIsVisible = 0; 923 | defaultConfigurationName = Release; 924 | }; 925 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "RNPDemo" */ = { 926 | isa = XCConfigurationList; 927 | buildConfigurations = ( 928 | 83CBBA201A601CBA00E9B192 /* Debug */, 929 | 83CBBA211A601CBA00E9B192 /* Release */, 930 | ); 931 | defaultConfigurationIsVisible = 0; 932 | defaultConfigurationName = Release; 933 | }; 934 | /* End XCConfigurationList section */ 935 | }; 936 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 937 | } 938 | -------------------------------------------------------------------------------- /example/ios/RNPDemo.xcodeproj/xcshareddata/xcschemes/RNPDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /example/ios/RNPDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/RNPDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /example/ios/RNPDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import "RCTBundleURLProvider.h" 13 | #import "RCTRootView.h" 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"RNPDemo" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /example/ios/RNPDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /example/ios/RNPDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /example/ios/RNPDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIBackgroundModes 6 | 7 | external-accessory 8 | 9 | UISupportedExternalAccessoryProtocols 10 | 11 | com.miura.shuttle 12 | 13 | CFBundleDevelopmentRegion 14 | en 15 | CFBundleExecutable 16 | $(EXECUTABLE_NAME) 17 | CFBundleIdentifier 18 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 19 | CFBundleInfoDictionaryVersion 20 | 6.0 21 | CFBundleName 22 | $(PRODUCT_NAME) 23 | CFBundlePackageType 24 | APPL 25 | CFBundleShortVersionString 26 | 1.0 27 | CFBundleSignature 28 | ???? 29 | CFBundleVersion 30 | 1 31 | LSRequiresIPhoneOS 32 | 33 | NSAppTransportSecurity 34 | 35 | NSExceptionDomains 36 | 37 | localhost 38 | 39 | NSTemporaryExceptionAllowsInsecureHTTPLoads 40 | 41 | 42 | 43 | 44 | NSLocationWhenInUseUsageDescription 45 | 46 | UILaunchStoryboardName 47 | LaunchScreen 48 | UIRequiredDeviceCapabilities 49 | 50 | armv7 51 | 52 | UISupportedInterfaceOrientations 53 | 54 | UIInterfaceOrientationPortrait 55 | UIInterfaceOrientationLandscapeLeft 56 | UIInterfaceOrientationLandscapeRight 57 | UIInterfaceOrientationPortraitUpsideDown 58 | 59 | UIViewControllerBasedStatusBarAppearance 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /example/ios/RNPDemo/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example/ios/RNPDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/RNPDemoTests/RNPDemoTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "RCTLog.h" 14 | #import "RCTRootView.h" 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface RNPDemoTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation RNPDemoTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RNPDemo", 3 | "version": "0.0.1", 4 | "scripts": { 5 | "start": "node node_modules/react-native/local-cli/cli.js start" 6 | }, 7 | "dependencies": { 8 | "react": "15.3.2", 9 | "react-native": "0.34.1", 10 | "react-native-sketch": "^0.3.0", 11 | "react-native-payworks": "file:.." 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/style.js: -------------------------------------------------------------------------------- 1 | // 2 | // ReactNativePayworks 3 | // 4 | // Created by Peace Chen on 2/27/2018. 5 | // Copyright OnceThere. All rights reserved. 6 | // 7 | 8 | import { StyleSheet } from 'react-native'; 9 | 10 | export default StyleSheet.create( { 11 | container: { 12 | flex: 1, 13 | justifyContent: 'center', 14 | alignItems: 'center', 15 | backgroundColor: '#F5FCFF', 16 | }, 17 | welcome: { 18 | fontSize: 20, 19 | textAlign: 'center', 20 | margin: 10, 21 | }, 22 | instructions: { 23 | textAlign: 'center', 24 | color: '#333333', 25 | marginBottom: 5, 26 | }, 27 | button: { 28 | borderWidth: 0.5, 29 | borderRadius: 8, 30 | backgroundColor: 'blue', 31 | padding: 10, 32 | }, 33 | buttonDisabled: { 34 | backgroundColor: 'grey', 35 | }, 36 | buttonText: { 37 | color: 'white', 38 | }, 39 | signature: { 40 | width: 200, 41 | height: 150, // Height needed; Default: 200px 42 | } 43 | }) 44 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | // 2 | // ReactNativePayworks 3 | // 4 | // Created by Peace Chen on 2/27/2018. 5 | // Copyright OnceThere. All rights reserved. 6 | // 7 | 8 | var PayworksNative = require('react-native').NativeModules.PayworksNative; 9 | 10 | module.exports = { 11 | transaction: PayworksNative.transaction, 12 | submitSignature: PayworksNative.submitSignature, 13 | cancelSignature: PayworksNative.cancelSignature, 14 | abortTransaction: PayworksNative.abortTransaction, 15 | disconnect: PayworksNative.disconnect, 16 | }; 17 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '8.0' 2 | project 'ReactNativePayworks.xcodeproj' 3 | source 'https://github.com/CocoaPods/Specs.git' 4 | source 'https://bitbucket.org/mpymnt/io.mpymnt.repo.pods.git' 5 | 6 | def pods 7 | pod 'payworks', '~> 2.31.2' 8 | end 9 | 10 | target 'ReactNativePayworks' do 11 | pods 12 | end 13 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CocoaLumberjack (3.4.1): 3 | - CocoaLumberjack/Default (= 3.4.1) 4 | - CocoaLumberjack/Extensions (= 3.4.1) 5 | - CocoaLumberjack/Default (3.4.1) 6 | - CocoaLumberjack/Extensions (3.4.1): 7 | - CocoaLumberjack/Default 8 | - MPAFNetworking (2.5.4): 9 | - MPAFNetworking/NSURLConnection (= 2.5.4) 10 | - MPAFNetworking/NSURLSession (= 2.5.4) 11 | - MPAFNetworking/Reachability (= 2.5.4) 12 | - MPAFNetworking/Security (= 2.5.4) 13 | - MPAFNetworking/Serialization (= 2.5.4) 14 | - MPAFNetworking/UIKit (= 2.5.4) 15 | - MPAFNetworking/NSURLConnection (2.5.4): 16 | - MPAFNetworking/Reachability 17 | - MPAFNetworking/Security 18 | - MPAFNetworking/Serialization 19 | - MPAFNetworking/NSURLSession (2.5.4): 20 | - MPAFNetworking/Reachability 21 | - MPAFNetworking/Security 22 | - MPAFNetworking/Serialization 23 | - MPAFNetworking/Reachability (2.5.4) 24 | - MPAFNetworking/Security (2.5.4) 25 | - MPAFNetworking/Serialization (2.5.4) 26 | - MPAFNetworking/UIKit (2.5.4): 27 | - MPAFNetworking/NSURLConnection 28 | - MPAFNetworking/NSURLSession 29 | - payworks (2.31.2): 30 | - payworks/mpos (= 2.31.2) 31 | - payworks/mpos (2.31.2): 32 | - payworks/mpos/accessories (= 2.31.2) 33 | - payworks/mpos/comlinks (= 2.31.2) 34 | - payworks/mpos/core (= 2.31.2) 35 | - payworks/mpos/accessories (2.31.2): 36 | - payworks/mpos/accessories/miura (= 2.31.2) 37 | - payworks/mpos/accessories/sewoo (= 2.31.2) 38 | - payworks/mpos/accessories/verifone (= 2.31.2) 39 | - payworks/mpos/accessories/vipa (= 2.31.2) 40 | - payworks/mpos/accessories/miura (2.31.2): 41 | - payworks/mpos/comlinks/externalaccessory 42 | - payworks/mpos/comlinks/tcp 43 | - payworks/mpos/core 44 | - payworks/mpos/accessories/sewoo (2.31.2): 45 | - payworks/mpos/core 46 | - payworks/mpos/accessories/verifone (2.31.2): 47 | - payworks/mpos/comlinks/verifone 48 | - payworks/mpos/core 49 | - payworks/mpos/accessories/vipa (2.31.2): 50 | - payworks/mpos/comlinks/tcp 51 | - payworks/mpos/core 52 | - payworks/mpos/comlinks (2.31.2): 53 | - payworks/mpos/comlinks/externalaccessory (= 2.31.2) 54 | - payworks/mpos/comlinks/tcp (= 2.31.2) 55 | - payworks/mpos/comlinks/verifone (= 2.31.2) 56 | - payworks/mpos/comlinks/externalaccessory (2.31.2): 57 | - payworks/mpos/core 58 | - payworks/mpos/comlinks/tcp (2.31.2): 59 | - payworks/mpos/core 60 | - payworks/mpos/comlinks/verifone (2.31.2): 61 | - payworks/mpos/core 62 | - payworks/mpos/core (2.31.2): 63 | - CocoaLumberjack (~> 3.2) 64 | - MPAFNetworking (~> 2.5.4) 65 | 66 | DEPENDENCIES: 67 | - payworks (~> 2.31.2) 68 | 69 | SPEC REPOS: 70 | https://bitbucket.org/mpymnt/io.mpymnt.repo.pods.git: 71 | - MPAFNetworking 72 | - payworks 73 | https://github.com/CocoaPods/Specs.git: 74 | - CocoaLumberjack 75 | 76 | SPEC CHECKSUMS: 77 | CocoaLumberjack: 2e258a064cacc8eb9a2aca318e24d02a0a7fd56d 78 | MPAFNetworking: 7a85f28e8af049ff2de164b1f54724e8eebe0aac 79 | payworks: edba6d9b3f19cd6458a0f0982df49fb0c029e32c 80 | 81 | PODFILE CHECKSUM: bc23a630d59a3173f77f08740184252f0e549495 82 | 83 | COCOAPODS: 1.5.0 84 | -------------------------------------------------------------------------------- /ios/ReactNativePayworks.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BA5DD9DA69A8FAAA548C118B /* libPods-ReactNativePayworks.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A0B0E96DC0CCFE0B77786D7C /* libPods-ReactNativePayworks.a */; }; 11 | CEE22B241E3967C40052DA54 /* ReactNativePayworks.m in Sources */ = {isa = PBXBuildFile; fileRef = CEE22B231E3967C40052DA54 /* ReactNativePayworks.m */; }; 12 | CEE22B251E3967C40052DA54 /* ReactNativePayworks.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CEE22B221E3967C40052DA54 /* ReactNativePayworks.h */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXCopyFilesBuildPhase section */ 16 | CEE22B1D1E3967C40052DA54 /* CopyFiles */ = { 17 | isa = PBXCopyFilesBuildPhase; 18 | buildActionMask = 2147483647; 19 | dstPath = "include/$(PRODUCT_NAME)"; 20 | dstSubfolderSpec = 16; 21 | files = ( 22 | CEE22B251E3967C40052DA54 /* ReactNativePayworks.h in CopyFiles */, 23 | ); 24 | runOnlyForDeploymentPostprocessing = 0; 25 | }; 26 | /* End PBXCopyFilesBuildPhase section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | 19EF6D95003C75CCEA4AD406 /* Pods-ReactNativePayworks.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativePayworks.release.xcconfig"; path = "Pods/Target Support Files/Pods-ReactNativePayworks/Pods-ReactNativePayworks.release.xcconfig"; sourceTree = ""; }; 30 | A0B0E96DC0CCFE0B77786D7C /* libPods-ReactNativePayworks.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ReactNativePayworks.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | CEE22B1F1E3967C40052DA54 /* libReactNativePayworks.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReactNativePayworks.a; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | CEE22B221E3967C40052DA54 /* ReactNativePayworks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReactNativePayworks.h; sourceTree = ""; }; 33 | CEE22B231E3967C40052DA54 /* ReactNativePayworks.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactNativePayworks.m; sourceTree = ""; }; 34 | E9C9DBD1550F70FB392A8583 /* Pods-ReactNativePayworks.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativePayworks.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ReactNativePayworks/Pods-ReactNativePayworks.debug.xcconfig"; sourceTree = ""; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | CEE22B1C1E3967C40052DA54 /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | BA5DD9DA69A8FAAA548C118B /* libPods-ReactNativePayworks.a in Frameworks */, 43 | ); 44 | runOnlyForDeploymentPostprocessing = 0; 45 | }; 46 | /* End PBXFrameworksBuildPhase section */ 47 | 48 | /* Begin PBXGroup section */ 49 | 9FC7EA3E51AF7079041C7722 /* Pods */ = { 50 | isa = PBXGroup; 51 | children = ( 52 | E9C9DBD1550F70FB392A8583 /* Pods-ReactNativePayworks.debug.xcconfig */, 53 | 19EF6D95003C75CCEA4AD406 /* Pods-ReactNativePayworks.release.xcconfig */, 54 | ); 55 | name = Pods; 56 | sourceTree = ""; 57 | }; 58 | A79E1E26DE79127F0EBCED34 /* Frameworks */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | A0B0E96DC0CCFE0B77786D7C /* libPods-ReactNativePayworks.a */, 62 | ); 63 | name = Frameworks; 64 | sourceTree = ""; 65 | }; 66 | CEE22B161E3967C40052DA54 = { 67 | isa = PBXGroup; 68 | children = ( 69 | CEE22B211E3967C40052DA54 /* ReactNativePayworks */, 70 | CEE22B201E3967C40052DA54 /* Products */, 71 | 9FC7EA3E51AF7079041C7722 /* Pods */, 72 | A79E1E26DE79127F0EBCED34 /* Frameworks */, 73 | ); 74 | sourceTree = ""; 75 | }; 76 | CEE22B201E3967C40052DA54 /* Products */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | CEE22B1F1E3967C40052DA54 /* libReactNativePayworks.a */, 80 | ); 81 | name = Products; 82 | sourceTree = ""; 83 | }; 84 | CEE22B211E3967C40052DA54 /* ReactNativePayworks */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | CEE22B221E3967C40052DA54 /* ReactNativePayworks.h */, 88 | CEE22B231E3967C40052DA54 /* ReactNativePayworks.m */, 89 | ); 90 | path = ReactNativePayworks; 91 | sourceTree = ""; 92 | }; 93 | /* End PBXGroup section */ 94 | 95 | /* Begin PBXNativeTarget section */ 96 | CEE22B1E1E3967C40052DA54 /* ReactNativePayworks */ = { 97 | isa = PBXNativeTarget; 98 | buildConfigurationList = CEE22B281E3967C40052DA54 /* Build configuration list for PBXNativeTarget "ReactNativePayworks" */; 99 | buildPhases = ( 100 | C0CA6145330C6F8690A903C2 /* [CP] Check Pods Manifest.lock */, 101 | CEE22B1B1E3967C40052DA54 /* Sources */, 102 | CEE22B1C1E3967C40052DA54 /* Frameworks */, 103 | CEE22B1D1E3967C40052DA54 /* CopyFiles */, 104 | 4027ED5C5CD8E64A472D20F6 /* [CP] Copy Pods Resources */, 105 | ); 106 | buildRules = ( 107 | ); 108 | dependencies = ( 109 | ); 110 | name = ReactNativePayworks; 111 | productName = ReactNativePayworks; 112 | productReference = CEE22B1F1E3967C40052DA54 /* libReactNativePayworks.a */; 113 | productType = "com.apple.product-type.library.static"; 114 | }; 115 | /* End PBXNativeTarget section */ 116 | 117 | /* Begin PBXProject section */ 118 | CEE22B171E3967C40052DA54 /* Project object */ = { 119 | isa = PBXProject; 120 | attributes = { 121 | LastUpgradeCheck = 0810; 122 | ORGANIZATIONNAME = OnceThere; 123 | TargetAttributes = { 124 | CEE22B1E1E3967C40052DA54 = { 125 | CreatedOnToolsVersion = 8.1; 126 | ProvisioningStyle = Automatic; 127 | }; 128 | }; 129 | }; 130 | buildConfigurationList = CEE22B1A1E3967C40052DA54 /* Build configuration list for PBXProject "ReactNativePayworks" */; 131 | compatibilityVersion = "Xcode 3.2"; 132 | developmentRegion = English; 133 | hasScannedForEncodings = 0; 134 | knownRegions = ( 135 | en, 136 | ); 137 | mainGroup = CEE22B161E3967C40052DA54; 138 | productRefGroup = CEE22B201E3967C40052DA54 /* Products */; 139 | projectDirPath = ""; 140 | projectRoot = ""; 141 | targets = ( 142 | CEE22B1E1E3967C40052DA54 /* ReactNativePayworks */, 143 | ); 144 | }; 145 | /* End PBXProject section */ 146 | 147 | /* Begin PBXShellScriptBuildPhase section */ 148 | 4027ED5C5CD8E64A472D20F6 /* [CP] Copy Pods Resources */ = { 149 | isa = PBXShellScriptBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | ); 153 | inputPaths = ( 154 | "${SRCROOT}/Pods/Target Support Files/Pods-ReactNativePayworks/Pods-ReactNativePayworks-resources.sh", 155 | "${PODS_ROOT}/payworks/mpos_core_resources.bundle", 156 | ); 157 | name = "[CP] Copy Pods Resources"; 158 | outputPaths = ( 159 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/mpos_core_resources.bundle", 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | shellPath = /bin/sh; 163 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ReactNativePayworks/Pods-ReactNativePayworks-resources.sh\"\n"; 164 | showEnvVarsInLog = 0; 165 | }; 166 | C0CA6145330C6F8690A903C2 /* [CP] Check Pods Manifest.lock */ = { 167 | isa = PBXShellScriptBuildPhase; 168 | buildActionMask = 2147483647; 169 | files = ( 170 | ); 171 | inputPaths = ( 172 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 173 | "${PODS_ROOT}/Manifest.lock", 174 | ); 175 | name = "[CP] Check Pods Manifest.lock"; 176 | outputPaths = ( 177 | "$(DERIVED_FILE_DIR)/Pods-ReactNativePayworks-checkManifestLockResult.txt", 178 | ); 179 | runOnlyForDeploymentPostprocessing = 0; 180 | shellPath = /bin/sh; 181 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 182 | showEnvVarsInLog = 0; 183 | }; 184 | /* End PBXShellScriptBuildPhase section */ 185 | 186 | /* Begin PBXSourcesBuildPhase section */ 187 | CEE22B1B1E3967C40052DA54 /* Sources */ = { 188 | isa = PBXSourcesBuildPhase; 189 | buildActionMask = 2147483647; 190 | files = ( 191 | CEE22B241E3967C40052DA54 /* ReactNativePayworks.m in Sources */, 192 | ); 193 | runOnlyForDeploymentPostprocessing = 0; 194 | }; 195 | /* End PBXSourcesBuildPhase section */ 196 | 197 | /* Begin XCBuildConfiguration section */ 198 | CEE22B261E3967C40052DA54 /* Debug */ = { 199 | isa = XCBuildConfiguration; 200 | buildSettings = { 201 | ALWAYS_SEARCH_USER_PATHS = NO; 202 | CLANG_ANALYZER_NONNULL = YES; 203 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 204 | CLANG_CXX_LIBRARY = "libc++"; 205 | CLANG_ENABLE_MODULES = YES; 206 | CLANG_ENABLE_OBJC_ARC = YES; 207 | CLANG_WARN_BOOL_CONVERSION = YES; 208 | CLANG_WARN_CONSTANT_CONVERSION = YES; 209 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 210 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 211 | CLANG_WARN_EMPTY_BODY = YES; 212 | CLANG_WARN_ENUM_CONVERSION = YES; 213 | CLANG_WARN_INFINITE_RECURSION = YES; 214 | CLANG_WARN_INT_CONVERSION = YES; 215 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 216 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 217 | CLANG_WARN_UNREACHABLE_CODE = YES; 218 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 219 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 220 | COPY_PHASE_STRIP = NO; 221 | DEBUG_INFORMATION_FORMAT = dwarf; 222 | ENABLE_STRICT_OBJC_MSGSEND = YES; 223 | ENABLE_TESTABILITY = YES; 224 | GCC_C_LANGUAGE_STANDARD = gnu99; 225 | GCC_DYNAMIC_NO_PIC = NO; 226 | GCC_NO_COMMON_BLOCKS = YES; 227 | GCC_OPTIMIZATION_LEVEL = 0; 228 | GCC_PREPROCESSOR_DEFINITIONS = ( 229 | "DEBUG=1", 230 | "$(inherited)", 231 | ); 232 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 233 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 234 | GCC_WARN_UNDECLARED_SELECTOR = YES; 235 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 236 | GCC_WARN_UNUSED_FUNCTION = YES; 237 | GCC_WARN_UNUSED_VARIABLE = YES; 238 | IPHONEOS_DEPLOYMENT_TARGET = 10.1; 239 | MTL_ENABLE_DEBUG_INFO = YES; 240 | ONLY_ACTIVE_ARCH = YES; 241 | SDKROOT = iphoneos; 242 | }; 243 | name = Debug; 244 | }; 245 | CEE22B271E3967C40052DA54 /* Release */ = { 246 | isa = XCBuildConfiguration; 247 | buildSettings = { 248 | ALWAYS_SEARCH_USER_PATHS = NO; 249 | CLANG_ANALYZER_NONNULL = YES; 250 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 251 | CLANG_CXX_LIBRARY = "libc++"; 252 | CLANG_ENABLE_MODULES = YES; 253 | CLANG_ENABLE_OBJC_ARC = YES; 254 | CLANG_WARN_BOOL_CONVERSION = YES; 255 | CLANG_WARN_CONSTANT_CONVERSION = YES; 256 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 257 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 258 | CLANG_WARN_EMPTY_BODY = YES; 259 | CLANG_WARN_ENUM_CONVERSION = YES; 260 | CLANG_WARN_INFINITE_RECURSION = YES; 261 | CLANG_WARN_INT_CONVERSION = YES; 262 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 263 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 264 | CLANG_WARN_UNREACHABLE_CODE = YES; 265 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 266 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 267 | COPY_PHASE_STRIP = NO; 268 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 269 | ENABLE_NS_ASSERTIONS = NO; 270 | ENABLE_STRICT_OBJC_MSGSEND = YES; 271 | GCC_C_LANGUAGE_STANDARD = gnu99; 272 | GCC_NO_COMMON_BLOCKS = YES; 273 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 274 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 275 | GCC_WARN_UNDECLARED_SELECTOR = YES; 276 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 277 | GCC_WARN_UNUSED_FUNCTION = YES; 278 | GCC_WARN_UNUSED_VARIABLE = YES; 279 | IPHONEOS_DEPLOYMENT_TARGET = 10.1; 280 | MTL_ENABLE_DEBUG_INFO = NO; 281 | SDKROOT = iphoneos; 282 | VALIDATE_PRODUCT = YES; 283 | }; 284 | name = Release; 285 | }; 286 | CEE22B291E3967C40052DA54 /* Debug */ = { 287 | isa = XCBuildConfiguration; 288 | baseConfigurationReference = E9C9DBD1550F70FB392A8583 /* Pods-ReactNativePayworks.debug.xcconfig */; 289 | buildSettings = { 290 | HEADER_SEARCH_PATHS = ( 291 | "$(inherited)", 292 | "\"${PODS_ROOT}/Headers/Public\"", 293 | "\"${PODS_ROOT}/Headers/Public/CocoaLumberjack\"", 294 | "\"${PODS_ROOT}/Headers/Public/payworks\"", 295 | "$(SRCROOT)/../node_modules/react-native/React/**", 296 | ); 297 | OTHER_LDFLAGS = "-ObjC"; 298 | PRODUCT_NAME = "$(TARGET_NAME)"; 299 | SKIP_INSTALL = YES; 300 | }; 301 | name = Debug; 302 | }; 303 | CEE22B2A1E3967C40052DA54 /* Release */ = { 304 | isa = XCBuildConfiguration; 305 | baseConfigurationReference = 19EF6D95003C75CCEA4AD406 /* Pods-ReactNativePayworks.release.xcconfig */; 306 | buildSettings = { 307 | HEADER_SEARCH_PATHS = ( 308 | "$(inherited)", 309 | "\"${PODS_ROOT}/Headers/Public\"", 310 | "\"${PODS_ROOT}/Headers/Public/CocoaLumberjack\"", 311 | "$(SRCROOT)/../node_modules/react-native/React/**", 312 | ); 313 | OTHER_LDFLAGS = "-ObjC"; 314 | PRODUCT_NAME = "$(TARGET_NAME)"; 315 | SKIP_INSTALL = YES; 316 | }; 317 | name = Release; 318 | }; 319 | /* End XCBuildConfiguration section */ 320 | 321 | /* Begin XCConfigurationList section */ 322 | CEE22B1A1E3967C40052DA54 /* Build configuration list for PBXProject "ReactNativePayworks" */ = { 323 | isa = XCConfigurationList; 324 | buildConfigurations = ( 325 | CEE22B261E3967C40052DA54 /* Debug */, 326 | CEE22B271E3967C40052DA54 /* Release */, 327 | ); 328 | defaultConfigurationIsVisible = 0; 329 | defaultConfigurationName = Release; 330 | }; 331 | CEE22B281E3967C40052DA54 /* Build configuration list for PBXNativeTarget "ReactNativePayworks" */ = { 332 | isa = XCConfigurationList; 333 | buildConfigurations = ( 334 | CEE22B291E3967C40052DA54 /* Debug */, 335 | CEE22B2A1E3967C40052DA54 /* Release */, 336 | ); 337 | defaultConfigurationIsVisible = 0; 338 | defaultConfigurationName = Release; 339 | }; 340 | /* End XCConfigurationList section */ 341 | }; 342 | rootObject = CEE22B171E3967C40052DA54 /* Project object */; 343 | } 344 | -------------------------------------------------------------------------------- /ios/ReactNativePayworks.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/ReactNativePayworks/ReactNativePayworks.h: -------------------------------------------------------------------------------- 1 | // 2 | // PayworksNative.h 3 | // ReactNativePayworks 4 | // 5 | // Created by Peace Chen on 1/19/17. 6 | // Copyright © 2017 OnceThere. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #if __has_include() 13 | // React Native >= 0.40 14 | #import 15 | #import 16 | #import 17 | #else 18 | // React Native <= 0.39 19 | #import "RCTConvert.h" 20 | #import "RCTEventDispatcher.h" 21 | #import "RCTBridgeModule.h" 22 | #endif 23 | 24 | @interface PayworksNative : NSObject 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /ios/ReactNativePayworks/ReactNativePayworks.m: -------------------------------------------------------------------------------- 1 | // 2 | // PayworksNative.m 3 | // ReactNativePayworks 4 | // 5 | // Created by Peace Chen on 1/19/17. 6 | // Copyright © 2017 OnceThere. All rights reserved. 7 | // 8 | 9 | #import "ReactNativePayworks.h" 10 | 11 | @implementation PayworksNative 12 | 13 | @synthesize bridge = _bridge; 14 | 15 | MPTransactionProvider* transactionProvider; 16 | MPTransactionProcess *_process; 17 | 18 | RCT_EXPORT_MODULE() 19 | 20 | RCT_REMAP_METHOD(transaction, 21 | xactionParams:(NSDictionary *)xactionParams 22 | resolver:(RCTPromiseResolveBlock)resolve 23 | rejecter:(RCTPromiseRejectBlock)reject) 24 | { 25 | transactionProvider = 26 | [MPMpos transactionProviderForMode:[RCTConvert int:xactionParams[@"providerMode"]] 27 | merchantIdentifier:xactionParams[@"merchantIdentifier"] 28 | merchantSecretKey:xactionParams[@"merchantSecretKey"] ]; 29 | 30 | MPTransactionParameters *transactionParameters = 31 | [MPTransactionParameters chargeWithAmount:xactionParams[@"chargeWithAmount"] 32 | currency:[RCTConvert int:xactionParams[@"currency"]] 33 | optionals:^(id _Nonnull optionals) 34 | { 35 | optionals.subject = xactionParams[@"optionals"][@"subject"]; 36 | optionals.customIdentifier = xactionParams[@"optionals"][@"customIdentifier"]; 37 | optionals.applicationFee = xactionParams[@"optionals"][@"applicationFee"]; 38 | // Specify up to 20 key-value pairs (See https://stripe.com/docs/api#metadata) 39 | optionals.metadata = xactionParams[@"optionals"][@"metadata"]; 40 | }]; 41 | 42 | MPAccessoryParameters *ap; 43 | if ([xactionParams[@"linkType"] isEqualToString:@"WiFi"]) { 44 | // When using the WiFi Miura M010, use the following parameters: 45 | ap = [MPAccessoryParameters tcpAccessoryParametersWithFamily:MPAccessoryFamilyMiuraMPI 46 | remote:@"192.168.254.123" 47 | port:38521 48 | optionals:nil]; 49 | } else if ([xactionParams[@"linkType"] isEqualToString:@"Verifone"]) { 50 | // When using Verifone readers via WiFi or Ethernet, use the following parameters: 51 | ap = [MPAccessoryParameters tcpAccessoryParametersWithFamily:MPAccessoryFamilyVerifoneVIPA 52 | remote:@"192.168.254.123" 53 | port:16107 54 | optionals:nil]; 55 | } else { 56 | // When using the Bluetooth Miura Shuttle / M007 / M010, use the following parameters: 57 | ap = [MPAccessoryParameters externalAccessoryParametersWithFamily:MPAccessoryFamilyMiuraMPI 58 | protocol:@"com.miura.shuttle" 59 | optionals:nil]; 60 | } 61 | 62 | // MPTransactionProcess *process = 63 | [transactionProvider startTransactionWithParameters:transactionParameters 64 | accessoryParameters:ap 65 | registered:^(MPTransactionProcess *process, 66 | MPTransaction *transaction) 67 | { 68 | // NSLog(@"registered MPTransactionProcess, transaction id: %@", transaction.identifier); 69 | _process = process; 70 | [self.bridge.eventDispatcher sendAppEventWithName:@"PayworksTransactionEvent" 71 | body:[self createTransactionDetailsObject:transaction details:nil]]; 72 | } 73 | statusChanged:^(MPTransactionProcess *process, 74 | MPTransaction *transaction, 75 | MPTransactionProcessDetails *details) 76 | { 77 | // NSLog(@"%@\n%@", details.information[0], details.information[1]); 78 | _process = process; 79 | [self.bridge.eventDispatcher sendAppEventWithName:@"PayworksTransactionEvent" 80 | body:[self createTransactionDetailsObject:transaction details:details]]; 81 | } 82 | actionRequired:^(MPTransactionProcess *process, 83 | MPTransaction *transaction, 84 | MPTransactionAction action, 85 | MPTransactionActionSupport *support) 86 | { 87 | switch (action) { 88 | case MPTransactionActionCustomerSignature: { 89 | // NSLog(@"show a UI that let's the customer provide his/her signature!"); 90 | [self.bridge.eventDispatcher sendAppEventWithName:@"PayworksTransactionEvent" 91 | body:@{@"action": @"MPTransactionActionCustomerSignature"}]; 92 | break; 93 | } 94 | case MPTransactionActionCustomerIdentification: { 95 | // always return NO here 96 | [process continueWithCustomerIdentityVerified:NO]; 97 | break; 98 | } 99 | case MPTransactionActionApplicationSelection: { 100 | // This happens only for readers that don't support application selection on their screen 101 | break; 102 | } 103 | default: { 104 | break; 105 | } 106 | } 107 | } 108 | 109 | completed:^(MPTransactionProcess *process, 110 | MPTransaction *transaction, 111 | MPTransactionProcessDetails *details) 112 | { 113 | // NSLog(@"Transaction ended, transaction status is %lu", (unsigned long) transaction.status); 114 | NSString* status; 115 | 116 | switch(transaction.status) { 117 | default: 118 | case MPTransactionStatusUnknown: 119 | // Unknown or not available 120 | status = @"MPTransactionStatusUnknown"; 121 | break; 122 | case MPTransactionStatusInitialized: 123 | // Transaction is initialized and can be started 124 | status = @"MPTransactionStatusInitialized"; 125 | break; 126 | case MPTransactionStatusPending: 127 | // Transaction result is still pending (e.g. not finished or waiting for async workflow) 128 | status = @"MPTransactionStatusPending"; 129 | break; 130 | case MPTransactionStatusApproved: 131 | // Transaction was approved. 132 | // Ask the merchant, whether the shopper wants to have a receipt 133 | // and close the checkout UI 134 | status = @"MPTransactionStatusApproved"; 135 | break; 136 | case MPTransactionStatusDeclined: 137 | // Transaction was declined 138 | status = @"MPTransactionStatusDeclined"; 139 | break; 140 | case MPTransactionStatusAborted: 141 | // Transaction was aborted (by merchant or shopper) 142 | status = @"MPTransactionStatusAborted"; 143 | break; 144 | case MPTransactionStatusError: 145 | // An error occured, see [MPTransaction.error] for more details 146 | status = @"MPTransactionStatusError"; 147 | break; 148 | case MPTransactionStatusInconclusive: 149 | // The transaction ended in a state that is inconclusive and the SDK cannot derive 150 | // the outcome (e.g. due to no internet connection). This is a special case of failure. 151 | status = @"MPTransactionStatusInconclusive"; 152 | break; 153 | } 154 | 155 | NSDictionary* transDet = [self createTransactionDetailsObject:transaction details:details]; 156 | resolve(@{ 157 | @"status": status, 158 | @"transaction": transDet[@"transaction"], 159 | @"details": transDet[@"details"] 160 | }); 161 | }]; 162 | } 163 | 164 | RCT_REMAP_METHOD(submitSignature, 165 | signature:(UIImage *)signature 166 | resolver:(RCTPromiseResolveBlock)resolve 167 | rejecter:(RCTPromiseRejectBlock)reject) 168 | { 169 | [_process continueWithCustomerSignature:signature verified:YES]; 170 | 171 | // Add this instead, if you would like to collect the customer signature on the printed merchant receipt 172 | // [process continueWithCustomerSignatureOnReceipt]; 173 | 174 | resolve( @{} ); 175 | } 176 | 177 | RCT_REMAP_METHOD(cancelSignature, 178 | resolver:(RCTPromiseResolveBlock)resolve 179 | rejecter:(RCTPromiseRejectBlock)reject) 180 | { 181 | [_process continueWithCustomerSignature:nil verified:NO]; 182 | resolve( @{} ); 183 | } 184 | 185 | RCT_REMAP_METHOD(abortTransaction, 186 | abort_resolver:(RCTPromiseResolveBlock)resolve 187 | abort_rejecter:(RCTPromiseRejectBlock)reject) 188 | { 189 | bool abortResponse = [_process requestAbort]; 190 | resolve( @{@"aborted": [NSNumber numberWithBool:abortResponse]} ); 191 | } 192 | 193 | RCT_REMAP_METHOD(disconnect, 194 | disconnect_resolver:(RCTPromiseResolveBlock)resolve 195 | disconnect_rejecter:(RCTPromiseRejectBlock)reject) 196 | { 197 | MPAccessoryModule *accessoryModule = transactionProvider.accessoryModule; 198 | MPAccessory *accessory = [[accessoryModule connectedAccesories] firstObject]; 199 | 200 | [accessoryModule disconnectFromAccessory:accessory statusChanged:^(MPAccessoryProcess *accesoryProcess, MPAccessory *accessory, MPAccessoryProcessDetails *details) { 201 | // status updates on the disconnect process 202 | } completed:^(MPAccessoryProcess *accesoryProcess, MPAccessory *accessory, MPAccessoryProcessDetails *details) { 203 | resolve( @{@"MPAccessoryProcessDetailsState": [NSNumber numberWithUnsignedLong:details.state]} ); 204 | }]; 205 | } 206 | 207 | // Create RCT-serializable transaction/details object 208 | - (NSDictionary*) createTransactionDetailsObject: (MPTransaction*)transaction 209 | details: (MPTransactionProcessDetails*)details 210 | { 211 | MPTransaction* _transaction; 212 | MPTransactionProcessDetails* _details; 213 | 214 | if (transaction == nil) { 215 | _transaction = [NSNull null]; 216 | } 217 | else { 218 | MPCardDetails* _cardDetails; 219 | MPClearingDetails* _clearingDetails; 220 | 221 | if (transaction.cardDetails == nil) { 222 | _cardDetails = [NSNull null]; 223 | } 224 | else { 225 | _cardDetails = @{ 226 | @"cardHolderName": transaction.cardDetails.cardHolderName ?: [NSNull null], 227 | @"expiryMonth": [NSNumber numberWithUnsignedLong:transaction.cardDetails.expiryMonth], 228 | @"expiryYear": [NSNumber numberWithUnsignedLong:transaction.cardDetails.expiryYear], 229 | @"fingerprint": transaction.cardDetails.fingerprint ?: [NSNull null], 230 | @"maskedCardNumber": transaction.cardDetails.maskedCardNumber ?: [NSNull null], 231 | @"scheme": [NSNumber numberWithUnsignedLong:transaction.cardDetails.scheme] 232 | }; 233 | } 234 | if (transaction.clearingDetails == nil) { 235 | _clearingDetails = [NSNull null]; 236 | } 237 | else { 238 | _clearingDetails = @{ 239 | @"institute": transaction.clearingDetails.institute ?: [NSNull null], 240 | @"transactionIdentifier": transaction.clearingDetails.transactionIdentifier ?: [NSNull null], 241 | @"originalTransactionIdentifier": transaction.clearingDetails.originalTransactionIdentifier ?: [NSNull null], 242 | @"completed": transaction.clearingDetails.completed ? 243 | [NSDateFormatter localizedStringFromDate:transaction.clearingDetails.completed 244 | dateStyle:NSDateFormatterShortStyle 245 | timeStyle:NSDateFormatterFullStyle] 246 | : [NSNull null], 247 | @"authorizationCode": transaction.clearingDetails.authorizationCode ?: [NSNull null], 248 | @"merchantId": transaction.clearingDetails.merchantId ?: [NSNull null], 249 | @"terminalId": transaction.clearingDetails.terminalId ?: [NSNull null], 250 | @"statusText": transaction.clearingDetails.statusText ?: [NSNull null] 251 | }; 252 | } 253 | 254 | _transaction = @{ 255 | @"captured": [NSNumber numberWithBool:transaction.captured], 256 | @"amount": transaction.amount ?: [NSNull null], 257 | @"subject": transaction.subject ?: [NSNull null], 258 | @"type": [NSNumber numberWithUnsignedLong:transaction.type], 259 | @"status": [NSNumber numberWithUnsignedLong:transaction.status], 260 | @"state": [NSNumber numberWithUnsignedLong:transaction.state], 261 | @"error": transaction.error ? transaction.error.localizedDescription : [NSNull null], 262 | @"identifier": transaction.identifier ?: [NSNull null], 263 | @"customIdentifier": transaction.customIdentifier ?: [NSNull null], 264 | @"cardDetails": _cardDetails, 265 | @"clearingDetails": _clearingDetails 266 | }; 267 | } 268 | 269 | if (details == nil) { 270 | _details = [NSNull null]; 271 | } 272 | else { 273 | _details = @{ 274 | @"state": [NSNumber numberWithInt:details.state], 275 | @"stateDetails": [NSNumber numberWithUnsignedLong:details.stateDetails], 276 | @"information": details.information ?: [NSNull null], 277 | @"error": details.error ? details.error.localizedDescription : [NSNull null], 278 | }; 279 | } 280 | 281 | return @{ 282 | @"transaction": _transaction, 283 | @"details": _details 284 | }; 285 | } 286 | 287 | @end 288 | -------------------------------------------------------------------------------- /ios/react-native-payworks.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "react-native-payworks" 3 | s.version = "0.2.2" 4 | s.license = "MIT" 5 | s.homepage = "https://github.com/oncethere/react-native-payworks" 6 | s.authors = { 'Peace Chen' => ''} 7 | s.summary = "React Native integration with Payworks" 8 | s.source = { :git => "https://github.com/oncethere/react-native-payworks" } 9 | s.source_files = "ReactNativePayworks/*.{h,m}" 10 | 11 | s.platform = :ios, "8.0" 12 | s.dependency 'payworks', '~> 2.31.2' 13 | end 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-payworks", 3 | "version": "0.2.2", 4 | "main": "index.js", 5 | "author": "Peace Chen", 6 | "license": "MIT", 7 | "scripts": { 8 | "start": "node node_modules/react-native/local-cli/cli.js start" 9 | }, 10 | "devDependencies": { 11 | "react": "*", 12 | "react-native": "*" 13 | }, 14 | "dependencies": { 15 | } 16 | } 17 | --------------------------------------------------------------------------------