diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..306486a --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,34 @@ +{ + "rules": { + "indent": [ + 2, + 2 + ], + "quotes": [ + 2, + "single" + ], + "linebreak-style": [ + 2, + "unix" + ], + "semi": [ + 2, + "always" + ] + }, + "env": { + "es6": true, + "browser": false, + "node": true + }, + "extends": "eslint:recommended", + "ecmaFeatures": { + "jsx": true, + "experimentalObjectRestSpread": true + }, + "plugins": [ + "react", + "react-native" + ] +} diff --git a/.gitignore b/.gitignore index b04c94f..5be94be 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# OSX +# +.DS_Store + # Xcode # build/ @@ -16,11 +20,19 @@ DerivedData *.hmap *.ipa *.xcuserstate -node_modules/ -# CocoaPods +project.xcworkspace + +# Android/IJ # -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control +.idea +.gradle +local.properties + +# node.js # -#Pods/ +node_modules/ +npm-debug.log + +/android/build +/android/react-native-paypal.iml +/.tern-port diff --git a/.gitmodules b/.gitmodules index 617a2b1..eb9dee3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "ReactPaypal/lib/Paypal"] - path = ReactPaypal/lib/Paypal +[submodule "ios/lib/Paypal"] + path = ios/lib/Paypal url = git@github.com:paypal/PayPal-iOS-SDK.git diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1250207 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Vizir Software Studio + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index cff6f7e..d4a9aff 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,211 @@ # react-native-paypal -Paypal wrapper for React Native, currently only supports the bare minimum of buying a product. +A Cross platform React Native interface for the PayPal Payment UI. Supports both iOS and Android currently, but can be used seperately. -###Integration +![Demo of a Payment using PayPal](/react-native-paypal.gif?raw=true "react-native-paypal") + +## Usage +-- + +Initiating a payment is as simple as creating a single promise + +```javascript +let PayPal = require('react-native-paypal'); +PayPal.paymentRequest({ + clientId: 'AbyfNDFV53djg6w4yYgiug_JaDfBSUiYI7o6NM9HE1CQ_qk9XxbUX0nwcPXXQHaNAWYtDfphQtWB3q4R', + environment: PayPalAndroid.SANDBOX, + price: '42.00', + currency: 'USD', + description: 'PayPal Test' +}).then((confirm, payment) => console.log('Paid'); /* At this point you should verify payment independently */) +.catch((error_code) => console.error('Failed to pay through PayPal')); +``` + +#### Callback parameters: + +If all goes OK with the payment than the paymentRequest promise is resolved with +the following arguments as JSON strings: +- A confirm: +``` json +{ + "client": { + "environment": "mock", + "paypal_sdk_version": "2.12.4", + "platform": "Android", + "product_name": "PayPal-Android-SDK" + }, + "response": { + "create_time": "2014-02-12T22:29:49Z", + "id": "PAY-6RV70583SB702805EKEYSZ6Y", + "intent": "sale", + "state": "approved" + }, + "response_type": "payment" +} +``` + +- A payment: +```json +{ + "amount": "1.00", + "currency_code": "USD", + "short_description": "PayPal Test", + "intent": "sale" +} +``` + +Handling callbacks: +```javascript +PayPal.paymentRequest(...).then(function (payment, confirm) { + sendPaymentToConfirmInServer(payment, confirm); +}) +``` + +If anything fails the promise will be notify an error with a code which will be +one of: +- USER\_CANCELLED +- INVALID\_CONFIG + +Handling failures: + +``` javascript +PayPal.paymentRequest(...).catch(function (error_code) { + if (error_code == PayPal.USER_CANCELLED) { + // User didn't complete the payment + } else if (error_code == PayPal.INVALID_CONFIG) { + // Invalid config was sent to PayPal + } +}) +``` + +## Setup + +Android +------- + +1. Add react-navive-paypal to your project + +``` bash +npm install --save react-native-paypal +``` + +2. Add the following to android/app/build.gradle + +``` groovy +dependencies { + // ... + compile project(':react-native-paypal') +} +``` + +3. Add the following to android/settings.gradle + +``` groovy +include ':react-native-paypal' +project(':react-native-paypal').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-paypal/android') +``` + +4. Edit android/src/.../MainActivity.java + +``` java +// ... +import br.com.vizir.rn.paypal.PayPalPackage; // <-- +import br.com.vizir.rn.paypal.PayPal; // <-- +import android.content.Intent; // <-- + +public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler { + // ... + private static final int PAY_PAL_REQUEST_ID = 9; // <-- Can be any unique number + private PayPalPackage payPalPackage; // <-- + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + // ... + payPalPackage = new PayPalPackage(this, PAY_PAL_REQUEST_ID); // <-- + + mReactInstanceManager = ReactInstanceManager.builder() + .setApplication(getApplication()) + .setBundleAssetName("index.android.bundle") + .setJSMainModuleName("index.android") + .addPackage(new MainReactPackage()) + // ... + .addPackage(payPalPackage) // <-- + .setUseDeveloperSupport(BuildConfig.DEBUG) + .setInitialLifecycleState(LifecycleState.RESUMED) + .build(); + // ... + } + + // ... + + @Override + public void onActivityResult(final int requestCode, final int resultCode, final Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == PAY_PAL_REQUEST_ID) { + payPalPackage.handleActivityResult(requestCode, resultCode, data); // <-- + } else { + otherModulesHandlers(requestCode, resultCode, data); + } + } +} +``` + +iOS +--- + +### Sample App + +You'll find an iOS example in `/ios/Example/`. You will need to run npm install in that directory in order to download the dependencies required by the sample application. Note this sample still uses manual NativeModule usage, and you'll likely find the above Javascript simpler than the JS used in this sample. + +### Installation + +Currently you have to install via `npm` from GitHub (or change the version specifier in `package.json` to `MattFoley/react-native-paypal`): + +```shell +npm install --save MattFoley/react-native-paypal +``` + +There will be an updated npm release shortly, which will allow + +#### Install the PayPal-iOS-SDK + +You then have to install the PayPal-iOS-SDK into `node_modules/react-native-paypal/ios/lib/Paypal` + +Here's a one-liner to download and unpack version `2.13.0`: + +```shell +mkdir -p node_modules/react-native-paypal/ios/lib/Paypal && curl -L --progress https://github.com/paypal/PayPal-iOS-SDK/archive/2.13.0.tar.gz | tar -xz - -C node_modules/react-native-paypal/ios/lib/Paypal --strip-components=1 +``` Include PayPal as normally, following their directions. Their integration steps and iOS SDK can be found [here](https://github.com/paypal/PayPal-iOS-SDK). After doing that, also drag MFLReactNativePayPal.h and MFLReactNativePayPal.m into your project. +#### Add `MFLReactNativePayPal.xcodeproj` + +Add `node_modules/react-native-paypal/ios/MFLReactNativePayPal.xcodeproj` +to the `Libraries` group in iOS and link `libMFLReactNativePayPal.a` as described in Step 2 of the +[React Native Manual Linking docs](https://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking). + +Follow steps 4 and 5 of [the PayPal instalation instructions](https://github.com/paypal/PayPal-iOS-SDK#if-you-dont-use-cocoapods-then), as well as the [additional steps here](https://github.com/paypal/PayPal-iOS-SDK#with-or-without-cocoapods). **This has to be done for the main app, not for the library you included.** + +### Manual Usage (iOS Only) + +You can access the NativeModule directly on iOS using the following instructions, if you'd like to modify the functionality. + ###Initialization: - var MFLReactNativePayPal = require('NativeModules').MFLReactNativePayPal; + import { + NativeModules + } from 'react-native'; + let MFLReactNativePayPal = NativeModules.MFLReactNativePayPal; MFLReactNativePayPal.initializePaypalEnvironment(, ""); -#####Environment Values that should be used here are declared in MFLReactNativePayPal.h +#####Environment Values that should be used here are declared in MFLReactNativePayPal.h • Sandbox = 0 • Production = 1 • No Network = 2 - + ###Prepare a Payment: MFLReactNativePayPal.preparePaymentOfAmount(, , ); @@ -35,7 +224,7 @@ Include PayPal as normally, following their directions. Their integration steps //Handle Error return; } else { - + console.log("payload: " + payload); if (payload.status == 1) { console.log(payload.confirmation); @@ -44,3 +233,15 @@ Include PayPal as normally, following their directions. Their integration steps } } }); + +## TODO: + + * [ ] Android Sample App + * [ ] Refactor & cleanup + * [ ] Automated tests + * [ ] Future payment (subscriptions) + * [ ] Invoice and optional fields - https://github.com/MattFoley/react-native-paypal/issues/6 + +## Thanks + +The Android portion of this library was originally built by https://github.com/Vizir for https://github.com/Vizir/react-native-paypal. The merging of the API in order to provide cross platform support was done almost entirely by https://github.com/amiuhle. diff --git a/ReactPaypal/ReactPaypalTests/Info.plist b/ReactPaypal/ReactPaypalTests/Info.plist deleted file mode 100644 index 886825c..0000000 --- a/ReactPaypal/ReactPaypalTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/ReactPaypal/ReactPaypalTests/ReactPaypalTests.m b/ReactPaypal/ReactPaypalTests/ReactPaypalTests.m deleted file mode 100644 index 31fc729..0000000 --- a/ReactPaypal/ReactPaypalTests/ReactPaypalTests.m +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import -#import - -#import "RCTAssert.h" -#import "RCTRedBox.h" -#import "RCTRootView.h" - -#define TIMEOUT_SECONDS 240 -#define TEXT_TO_LOOK_FOR @"Welcome to React Native!" - -@interface ReactPaypalTests : XCTestCase - -@end - -@implementation ReactPaypalTests - - -- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test -{ - if (test(view)) { - return YES; - } - for (UIView *subview in [view subviews]) { - if ([self findSubviewInView:subview matching:test]) { - return YES; - } - } - return NO; -} - -- (void)testRendersWelcomeScreen { - UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; - NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; - BOOL foundElement = NO; - NSString *redboxError = nil; - - while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { - [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - - redboxError = [[RCTRedBox sharedInstance] currentErrorMessage]; - - foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { - if ([view respondsToSelector:@selector(attributedText)]) { - NSString *text = [(id)view attributedText].string; - if ([text isEqualToString:TEXT_TO_LOOK_FOR]) { - return YES; - } - } - return NO; - }]; - } - - XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); - XCTAssertTrue(foundElement, @"Cound't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); -} - - -@end diff --git a/ReactPaypal/lib/Paypal b/ReactPaypal/lib/Paypal deleted file mode 160000 index b0ce036..0000000 --- a/ReactPaypal/lib/Paypal +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b0ce03658222b1195e2769520bce634326dd3083 diff --git a/ReactPaypal/package.json b/ReactPaypal/package.json deleted file mode 100644 index 956ae53..0000000 --- a/ReactPaypal/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "react-paypal", - "version": "0.0.3", - "private": false, - "scripts": { - "start": "node_modules/react-native/packager/packager.sh" - }, - "description": "Basic wrapper for PayPal payment handling within iOS React Native", - "keywords": [ - "react-component", - "react-native", - "ios" - ], - "repository": { - "type": "git", - "url": "git@github.com:MattFoley/react-native-paypal.git" - }, - "peerDependencies": { - "react-native": ">=0.18.0" - }, - "main":"index.ios.js", - "author": "iOSGuy (http://github.com/MattFoley)" -} diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..a3a1a59 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,28 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.1" + + defaultConfig { + minSdkVersion 16 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false // Set this to true to enable Proguard + proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + } + } +} + +repositories { + mavenCentral() +} + +dependencies { + compile 'com.facebook.react:react-native:0.18.+' + compile 'com.paypal.sdk:paypal-android-sdk:2.13.0' +} diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml new file mode 100644 index 0000000..b726200 --- /dev/null +++ b/android/src/main/AndroidManifest.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java b/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java new file mode 100644 index 0000000..d47300a --- /dev/null +++ b/android/src/main/java/br/com/vizir/rn/paypal/PayPal.java @@ -0,0 +1,118 @@ +package br.com.vizir.rn.paypal; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; + +import com.facebook.react.bridge.Callback; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.bridge.ReactContextBaseJavaModule; +import com.facebook.react.bridge.ReactMethod; +import com.facebook.react.bridge.ReadableMap; + +import com.paypal.android.sdk.payments.PayPalAuthorization; +import com.paypal.android.sdk.payments.PayPalConfiguration; +import com.paypal.android.sdk.payments.PayPalPayment; +import com.paypal.android.sdk.payments.PayPalService; +import com.paypal.android.sdk.payments.PaymentActivity; +import com.paypal.android.sdk.payments.PaymentConfirmation; + +import java.util.Map; +import java.util.HashMap; +import java.math.BigDecimal; + +public class PayPal extends ReactContextBaseJavaModule { + private final int paymentIntentRequestCode; + + private static final String ERROR_USER_CANCELLED = "USER_CANCELLED"; + private static final String ERROR_INVALID_CONFIG = "INVALID_CONFIG"; + + private Callback successCallback; + private Callback errorCallback; + + private Context activityContext; + private Activity currentActivity; + + public PayPal(ReactApplicationContext reactContext, Context activityContext, int requestCode) { + super(reactContext); + this.activityContext = activityContext; + this.currentActivity = (Activity)activityContext; + this.paymentIntentRequestCode = requestCode; + } + + @Override + public String getName() { + return "PayPal"; + } + + @Override public Map getConstants() { + final Map constants = new HashMap<>(); + + constants.put("NO_NETWORK", PayPalConfiguration.ENVIRONMENT_NO_NETWORK); + constants.put("SANDBOX", PayPalConfiguration.ENVIRONMENT_SANDBOX); + constants.put("PRODUCTION", PayPalConfiguration.ENVIRONMENT_PRODUCTION); + constants.put(ERROR_USER_CANCELLED, ERROR_USER_CANCELLED); + constants.put(ERROR_INVALID_CONFIG, ERROR_INVALID_CONFIG); + + return constants; + } + + @ReactMethod + public void paymentRequest( + final ReadableMap payPalParameters, + final Callback successCallback, + final Callback errorCallback + ) { + this.successCallback = successCallback; + this.errorCallback = errorCallback; + + final String environment = payPalParameters.getString("environment"); + final String clientId = payPalParameters.getString("clientId"); + final String price = payPalParameters.getString("price"); + final String currency = payPalParameters.getString("currency"); + final String description = payPalParameters.getString("description"); + + PayPalConfiguration config = + new PayPalConfiguration().environment(environment).clientId(clientId); + + startPayPalService(config); + + PayPalPayment thingToBuy = + new PayPalPayment(new BigDecimal(price), currency, description, + PayPalPayment.PAYMENT_INTENT_SALE); + + Intent intent = + new Intent(activityContext, PaymentActivity.class) + .putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config) + .putExtra(PaymentActivity.EXTRA_PAYMENT, thingToBuy); + + currentActivity.startActivityForResult(intent, paymentIntentRequestCode); + } + + private void startPayPalService(PayPalConfiguration config) { + Intent intent = new Intent(currentActivity, PayPalService.class); + intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config); + currentActivity.startService(intent); + } + + public void handleActivityResult(final int requestCode, final int resultCode, final Intent data) { + if (requestCode != paymentIntentRequestCode) { return; } + + if (resultCode == Activity.RESULT_OK) { + PaymentConfirmation confirm = + data.getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION); + if (confirm != null) { + successCallback.invoke( + confirm.toJSONObject().toString(), + confirm.getPayment().toJSONObject().toString() + ); + } + } else if (resultCode == Activity.RESULT_CANCELED) { + errorCallback.invoke(ERROR_USER_CANCELLED); + } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) { + errorCallback.invoke(ERROR_INVALID_CONFIG); + } + + currentActivity.stopService(new Intent(currentActivity, PayPalService.class)); + } +} diff --git a/android/src/main/java/br/com/vizir/rn/paypal/PayPalPackage.java b/android/src/main/java/br/com/vizir/rn/paypal/PayPalPackage.java new file mode 100644 index 0000000..59496d6 --- /dev/null +++ b/android/src/main/java/br/com/vizir/rn/paypal/PayPalPackage.java @@ -0,0 +1,48 @@ +package br.com.vizir.rn.paypal; + +import android.content.Intent; +import android.content.Context; + +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.JavaScriptModule; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.ViewManager; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class PayPalPackage implements ReactPackage { + private Context context; + private PayPal paypalModule; + private int paymentIntentRequestCode; + + public PayPalPackage(Context activityContext, int paymentIntentRequestCode) { + context = activityContext; + this.paymentIntentRequestCode = paymentIntentRequestCode; + } + + @Override + public List createNativeModules(ReactApplicationContext reactContext) { + List modules = new ArrayList<>(); + paypalModule = new PayPal(reactContext, context, paymentIntentRequestCode); + + modules.add(paypalModule); + return modules; + } + + @Override + public List> createJSModules() { + return Collections.emptyList(); + } + + @Override + public List createViewManagers(ReactApplicationContext reactContext) { + return Collections.emptyList(); + } + + public void handleActivityResult(final int requestCode, final int resultCode, final Intent data) { + paypalModule.handleActivityResult(requestCode, resultCode, data); + } +} diff --git a/index.js b/index.js new file mode 100644 index 0000000..eee37dc --- /dev/null +++ b/index.js @@ -0,0 +1,50 @@ +'use strict'; +let {NativeModules, Platform} = require('react-native') +let {PayPal, MFLReactNativePayPal} = NativeModules; + +let constants; + +if (Platform.OS === 'android') { + constants = {}; + let constantNames = Object.keys(PayPal).filter(p => p == p.toUpperCase()); + constantNames.forEach(c => constants[c] = PayPal[c]); +} else { + constants = { + SANDBOX: 0, + PRODUCTION: 1, + NO_NETWORK: 2, + + USER_CANCELLED: 'USER_CANCELLED', + INVALID_CONFIG: 'INVALID_CONFIG' + } +} + +let functions = { + paymentRequest(payPalParameters) { + return new Promise(function(resolve, reject) { + if (Platform.OS === 'android') { + PayPal.paymentRequest(payPalParameters, resolve, reject); + } else { + MFLReactNativePayPal.initializePaypalEnvironment(payPalParameters.environment, payPalParameters.clientId); + MFLReactNativePayPal.preparePaymentOfAmount(payPalParameters.price, payPalParameters.currency, payPalParameters.description); + MFLReactNativePayPal.prepareConfigurationForMerchant("Shape A Future", true, "spenden@aktion-europa-hilft.de"); + MFLReactNativePayPal.presentPaymentViewControllerForPreparedPurchase((error, payload) => { + if (error) { + reject(constants.INVALID_CONFIG, error) + } else { + if (payload.status === 1) { + resolve(payload); + } else { + reject(constants.USER_CANCELLED, payload); + } + } + }); + } + }); + } +}; + +var exported = {}; +Object.assign(exported, constants, functions); + +module.exports = exported; diff --git a/ReactPaypal/.flowconfig b/ios/.flowconfig similarity index 100% rename from ReactPaypal/.flowconfig rename to ios/.flowconfig diff --git a/ReactPaypal/.gitignore b/ios/.gitignore similarity index 100% rename from ReactPaypal/.gitignore rename to ios/.gitignore diff --git a/ReactPaypal/.npmignore b/ios/.npmignore similarity index 100% rename from ReactPaypal/.npmignore rename to ios/.npmignore diff --git a/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.h b/ios/Example/MFLReactNativePayPal/MFLReactNativePayPal.h similarity index 100% rename from ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.h rename to ios/Example/MFLReactNativePayPal/MFLReactNativePayPal.h diff --git a/ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m b/ios/Example/MFLReactNativePayPal/MFLReactNativePayPal.m similarity index 100% rename from ReactPaypal/MFLReactNativePayPal/MFLReactNativePayPal.m rename to ios/Example/MFLReactNativePayPal/MFLReactNativePayPal.m diff --git a/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj b/ios/Example/ReactPaypal.xcodeproj/project.pbxproj similarity index 63% rename from ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj rename to ios/Example/ReactPaypal.xcodeproj/project.pbxproj index f2d4e9e..84fc497 100644 --- a/ReactPaypal/ReactPaypal.xcodeproj/project.pbxproj +++ b/ios/Example/ReactPaypal.xcodeproj/project.pbxproj @@ -8,21 +8,21 @@ /* Begin PBXBuildFile section */ 008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 008F07F21AC5B25A0029DE68 /* main.jsbundle */; }; - 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; - 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; - 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; - 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; - 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; - 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; - 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; - 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; - 32A2D8201B38C9820037584B /* MFLReactNativePayPal.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A2D81F1B38C9820037584B /* MFLReactNativePayPal.m */; }; - 32A2D8321B38C9C30037584B /* libPayPalMobile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D82A1B38C9C30037584B /* libPayPalMobile.a */; }; + 32396B021D6126F900149C3C /* MFLReactNativePayPal.m in Sources */ = {isa = PBXBuildFile; fileRef = 32396B011D6126F900149C3C /* MFLReactNativePayPal.m */; }; + 32396B531D612AF400149C3C /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32396B0E1D612A7C00149C3C /* libRCTActionSheet.a */; }; + 32396B541D612AF400149C3C /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32396B141D612A8700149C3C /* libRCTGeolocation.a */; }; + 32396B551D612AF400149C3C /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32396B1A1D612A9000149C3C /* libRCTImage.a */; }; + 32396B561D612AF400149C3C /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32396B201D612A9800149C3C /* libRCTLinking.a */; }; + 32396B571D612AF400149C3C /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32396B261D612AA000149C3C /* libRCTNetwork.a */; }; + 32396B581D612AF400149C3C /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32396B2C1D612AA600149C3C /* libRCTSettings.a */; }; + 32396B591D612AF400149C3C /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32396B321D612AAD00149C3C /* libRCTText.a */; }; + 32396B5A1D612AF400149C3C /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32396B381D612AB300149C3C /* libRCTVibration.a */; }; + 32396B5B1D612AF400149C3C /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32396B3E1D612AB700149C3C /* libRCTWebSocket.a */; }; + 32396B5C1D612AF400149C3C /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32396B081D612A6D00149C3C /* libReact.a */; }; 32A2D8341B38D0900037584B /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D8331B38D0900037584B /* Accelerate.framework */; }; 32A2D8361B38D0950037584B /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D8351B38D0950037584B /* AudioToolbox.framework */; }; 32A2D8381B38D09A0037584B /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D8371B38D09A0037584B /* AVFoundation.framework */; }; @@ -31,159 +31,157 @@ 32A2D83E1B38D0A70037584B /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D83D1B38D0A70037584B /* MessageUI.framework */; }; 32A2D8401B38D0AC0037584B /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D83F1B38D0AC0037584B /* MobileCoreServices.framework */; }; 32A2D8421B38D0B20037584B /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32A2D8411B38D0B20037584B /* SystemConfiguration.framework */; }; - 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; - D9E324A61C4ED4BB00337CDA /* libCardIO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D9E324A31C4ED4BB00337CDA /* libCardIO.a */; }; - D9E324A71C4ED4BB00337CDA /* libopencv_core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D9E324A41C4ED4BB00337CDA /* libopencv_core.a */; }; - D9E324A81C4ED4BB00337CDA /* libopencv_imgproc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D9E324A51C4ED4BB00337CDA /* libopencv_imgproc.a */; }; + 32E28E1D1D6123A4001919A5 /* libCardIO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32E28E1A1D6123A4001919A5 /* libCardIO.a */; }; + 32E28E1E1D6123A4001919A5 /* libopencv_core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32E28E1B1D6123A4001919A5 /* libopencv_core.a */; }; + 32E28E1F1D6123A4001919A5 /* libopencv_imgproc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32E28E1C1D6123A4001919A5 /* libopencv_imgproc.a */; }; + 32E28E291D6123A9001919A5 /* libPayPalMobile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 32E28E211D6123A9001919A5 /* libPayPalMobile.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { + 32396B071D612A6D00149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; + containerPortal = 32396B031D612A6D00149C3C /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; + remoteInfo = React; + }; + 32396B0D1D612A7C00149C3C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 32396B091D612A7C00149C3C /* RCTActionSheet.xcodeproj */; proxyType = 2; remoteGlobalIDString = 134814201AA4EA6300B7C361; remoteInfo = RCTActionSheet; }; - 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { + 32396B131D612A8700149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; + containerPortal = 32396B0F1D612A8700149C3C /* RCTGeolocation.xcodeproj */; proxyType = 2; remoteGlobalIDString = 134814201AA4EA6300B7C361; remoteInfo = RCTGeolocation; }; - 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { + 32396B191D612A9000149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; + containerPortal = 32396B151D612A9000149C3C /* RCTImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = 58B5115D1A9E6B3D00147676; remoteInfo = RCTImage; }; - 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { + 32396B1F1D612A9800149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; + containerPortal = 32396B1B1D612A9800149C3C /* RCTLinking.xcodeproj */; proxyType = 2; - remoteGlobalIDString = 58B511DB1A9E6C8500147676; - remoteInfo = RCTNetwork; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RCTLinking; }; - 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { + 32396B251D612AA000149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; + containerPortal = 32396B211D612A9F00149C3C /* RCTNetwork.xcodeproj */; proxyType = 2; - remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; - remoteInfo = RCTVibration; + remoteGlobalIDString = 58B511DB1A9E6C8500147676; + remoteInfo = RCTNetwork; }; - 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { + 32396B2B1D612AA600149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; + containerPortal = 32396B271D612AA600149C3C /* RCTSettings.xcodeproj */; proxyType = 2; remoteGlobalIDString = 134814201AA4EA6300B7C361; remoteInfo = RCTSettings; }; - 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 3C86DF461ADF2C930047B81A; - remoteInfo = RCTWebSocket; - }; - 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { + 32396B311D612AAD00149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + containerPortal = 32396B2D1D612AAD00149C3C /* RCTText.xcodeproj */; proxyType = 2; - remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; - remoteInfo = React; + remoteGlobalIDString = 58B5119B1A9E6C1200147676; + remoteInfo = RCTText; }; - 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { + 32396B371D612AB300149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; + containerPortal = 32396B331D612AB300149C3C /* RCTVibration.xcodeproj */; proxyType = 2; - remoteGlobalIDString = 134814201AA4EA6300B7C361; - remoteInfo = RCTLinking; + remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; + remoteInfo = RCTVibration; }; - 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { + 32396B3D1D612AB700149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; + containerPortal = 32396B391D612AB700149C3C /* RCTWebSocket.xcodeproj */; proxyType = 2; - remoteGlobalIDString = 58B5119B1A9E6C1200147676; - remoteInfo = RCTText; + remoteGlobalIDString = 3C86DF461ADF2C930047B81A; + remoteInfo = RCTWebSocket; }; - D9E3247E1C4ECF3600337CDA /* PBXContainerItemProxy */ = { + 32396B3F1D612AED00149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + containerPortal = 32396B031D612A6D00149C3C /* React.xcodeproj */; proxyType = 1; remoteGlobalIDString = 83CBBA2D1A601D0E00E9B192; remoteInfo = React; }; - D9E324801C4ECF3600337CDA /* PBXContainerItemProxy */ = { + 32396B411D612AED00149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; + containerPortal = 32396B091D612A7C00149C3C /* RCTActionSheet.xcodeproj */; proxyType = 1; remoteGlobalIDString = 58B511DA1A9E6C8500147676; remoteInfo = RCTActionSheet; }; - D9E324821C4ECF3600337CDA /* PBXContainerItemProxy */ = { + 32396B431D612AED00149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; + containerPortal = 32396B0F1D612A8700149C3C /* RCTGeolocation.xcodeproj */; proxyType = 1; remoteGlobalIDString = 58B511DA1A9E6C8500147676; remoteInfo = RCTGeolocation; }; - D9E324841C4ECF3600337CDA /* PBXContainerItemProxy */ = { + 32396B451D612AED00149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; + containerPortal = 32396B151D612A9000149C3C /* RCTImage.xcodeproj */; proxyType = 1; remoteGlobalIDString = 58B5115C1A9E6B3D00147676; remoteInfo = RCTImage; }; - D9E324861C4ECF3600337CDA /* PBXContainerItemProxy */ = { + 32396B471D612AED00149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; + containerPortal = 32396B1B1D612A9800149C3C /* RCTLinking.xcodeproj */; proxyType = 1; remoteGlobalIDString = 58B511DA1A9E6C8500147676; remoteInfo = RCTLinking; }; - D9E324881C4ECF3600337CDA /* PBXContainerItemProxy */ = { + 32396B491D612AED00149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; + containerPortal = 32396B211D612A9F00149C3C /* RCTNetwork.xcodeproj */; proxyType = 1; remoteGlobalIDString = 58B511DA1A9E6C8500147676; remoteInfo = RCTNetwork; }; - D9E3248A1C4ECF3600337CDA /* PBXContainerItemProxy */ = { + 32396B4B1D612AED00149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; + containerPortal = 32396B271D612AA600149C3C /* RCTSettings.xcodeproj */; proxyType = 1; remoteGlobalIDString = 58B511DA1A9E6C8500147676; remoteInfo = RCTSettings; }; - D9E3248C1C4ECF3600337CDA /* PBXContainerItemProxy */ = { + 32396B4D1D612AED00149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; + containerPortal = 32396B2D1D612AAD00149C3C /* RCTText.xcodeproj */; proxyType = 1; remoteGlobalIDString = 58B5119A1A9E6C1200147676; remoteInfo = RCTText; }; - D9E3248E1C4ECF3600337CDA /* PBXContainerItemProxy */ = { + 32396B4F1D612AED00149C3C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; + containerPortal = 32396B331D612AB300149C3C /* RCTVibration.xcodeproj */; proxyType = 1; remoteGlobalIDString = 832C817F1AAF6DEF007FA2F7; remoteInfo = RCTVibration; }; + 32396B511D612AED00149C3C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 32396B391D612AB700149C3C /* RCTWebSocket.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 3C86DF451ADF2C930047B81A; + remoteInfo = RCTWebSocket; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = iOS/main.jsbundle; sourceTree = ""; }; - 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; - 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; - 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; - 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; - 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; - 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 00E356F21AD99517003FC87E /* ReactPaypalTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactPaypalTests.m; sourceTree = ""; }; - 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; - 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* ReactPaypal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReactPaypal.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = iOS/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = iOS/AppDelegate.m; sourceTree = ""; }; @@ -191,17 +189,18 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = iOS/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = iOS/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = iOS/main.m; sourceTree = ""; }; - 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; - 32A2D81E1B38C9820037584B /* MFLReactNativePayPal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFLReactNativePayPal.h; sourceTree = ""; }; - 32A2D81F1B38C9820037584B /* MFLReactNativePayPal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFLReactNativePayPal.m; sourceTree = ""; }; - 32A2D82A1B38C9C30037584B /* libPayPalMobile.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libPayPalMobile.a; sourceTree = ""; }; - 32A2D82B1B38C9C30037584B /* PayPalConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalConfiguration.h; sourceTree = ""; }; - 32A2D82C1B38C9C30037584B /* PayPalFuturePaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalFuturePaymentViewController.h; sourceTree = ""; }; - 32A2D82D1B38C9C30037584B /* PayPalMobile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalMobile.h; sourceTree = ""; }; - 32A2D82E1B38C9C30037584B /* PayPalOAuthScopes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalOAuthScopes.h; sourceTree = ""; }; - 32A2D82F1B38C9C30037584B /* PayPalPayment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalPayment.h; sourceTree = ""; }; - 32A2D8301B38C9C30037584B /* PayPalPaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalPaymentViewController.h; sourceTree = ""; }; - 32A2D8311B38C9C30037584B /* PayPalProfileSharingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalProfileSharingViewController.h; sourceTree = ""; }; + 32396B001D6126F900149C3C /* MFLReactNativePayPal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFLReactNativePayPal.h; sourceTree = ""; }; + 32396B011D6126F900149C3C /* MFLReactNativePayPal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFLReactNativePayPal.m; sourceTree = ""; }; + 32396B031D612A6D00149C3C /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; + 32396B091D612A7C00149C3C /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; + 32396B0F1D612A8700149C3C /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; + 32396B151D612A9000149C3C /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; + 32396B1B1D612A9800149C3C /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; + 32396B211D612A9F00149C3C /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; + 32396B271D612AA600149C3C /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; + 32396B2D1D612AAD00149C3C /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; + 32396B331D612AB300149C3C /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; + 32396B391D612AB700149C3C /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 32A2D8331B38D0900037584B /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; 32A2D8351B38D0950037584B /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 32A2D8371B38D09A0037584B /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; @@ -210,19 +209,25 @@ 32A2D83D1B38D0A70037584B /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; 32A2D83F1B38D0AC0037584B /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; 32A2D8411B38D0B20037584B /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; - 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; - 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; - D9E3249B1C4ED4BB00337CDA /* CardIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIO.h; sourceTree = ""; }; - D9E3249C1C4ED4BB00337CDA /* CardIOCreditCardInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOCreditCardInfo.h; sourceTree = ""; }; - D9E3249D1C4ED4BB00337CDA /* CardIODetectionMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIODetectionMode.h; sourceTree = ""; }; - D9E3249E1C4ED4BB00337CDA /* CardIOPaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOPaymentViewController.h; sourceTree = ""; }; - D9E3249F1C4ED4BB00337CDA /* CardIOPaymentViewControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOPaymentViewControllerDelegate.h; sourceTree = ""; }; - D9E324A01C4ED4BB00337CDA /* CardIOUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOUtilities.h; sourceTree = ""; }; - D9E324A11C4ED4BB00337CDA /* CardIOView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOView.h; sourceTree = ""; }; - D9E324A21C4ED4BB00337CDA /* CardIOViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOViewDelegate.h; sourceTree = ""; }; - D9E324A31C4ED4BB00337CDA /* libCardIO.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libCardIO.a; sourceTree = ""; }; - D9E324A41C4ED4BB00337CDA /* libopencv_core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopencv_core.a; sourceTree = ""; }; - D9E324A51C4ED4BB00337CDA /* libopencv_imgproc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopencv_imgproc.a; sourceTree = ""; }; + 32E28E121D6123A4001919A5 /* CardIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIO.h; sourceTree = ""; }; + 32E28E131D6123A4001919A5 /* CardIOCreditCardInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOCreditCardInfo.h; sourceTree = ""; }; + 32E28E141D6123A4001919A5 /* CardIODetectionMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIODetectionMode.h; sourceTree = ""; }; + 32E28E151D6123A4001919A5 /* CardIOPaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOPaymentViewController.h; sourceTree = ""; }; + 32E28E161D6123A4001919A5 /* CardIOPaymentViewControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOPaymentViewControllerDelegate.h; sourceTree = ""; }; + 32E28E171D6123A4001919A5 /* CardIOUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOUtilities.h; sourceTree = ""; }; + 32E28E181D6123A4001919A5 /* CardIOView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOView.h; sourceTree = ""; }; + 32E28E191D6123A4001919A5 /* CardIOViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOViewDelegate.h; sourceTree = ""; }; + 32E28E1A1D6123A4001919A5 /* libCardIO.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libCardIO.a; sourceTree = ""; }; + 32E28E1B1D6123A4001919A5 /* libopencv_core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopencv_core.a; sourceTree = ""; }; + 32E28E1C1D6123A4001919A5 /* libopencv_imgproc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopencv_imgproc.a; sourceTree = ""; }; + 32E28E211D6123A9001919A5 /* libPayPalMobile.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libPayPalMobile.a; sourceTree = ""; }; + 32E28E221D6123A9001919A5 /* PayPalConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalConfiguration.h; sourceTree = ""; }; + 32E28E231D6123A9001919A5 /* PayPalFuturePaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalFuturePaymentViewController.h; sourceTree = ""; }; + 32E28E241D6123A9001919A5 /* PayPalMobile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalMobile.h; sourceTree = ""; }; + 32E28E251D6123A9001919A5 /* PayPalOAuthScopes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalOAuthScopes.h; sourceTree = ""; }; + 32E28E261D6123A9001919A5 /* PayPalPayment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalPayment.h; sourceTree = ""; }; + 32E28E271D6123A9001919A5 /* PayPalPaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalPaymentViewController.h; sourceTree = ""; }; + 32E28E281D6123A9001919A5 /* PayPalProfileSharingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalProfileSharingViewController.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -230,6 +235,17 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 32396B531D612AF400149C3C /* libRCTActionSheet.a in Frameworks */, + 32396B541D612AF400149C3C /* libRCTGeolocation.a in Frameworks */, + 32396B551D612AF400149C3C /* libRCTImage.a in Frameworks */, + 32396B561D612AF400149C3C /* libRCTLinking.a in Frameworks */, + 32396B571D612AF400149C3C /* libRCTNetwork.a in Frameworks */, + 32396B581D612AF400149C3C /* libRCTSettings.a in Frameworks */, + 32396B591D612AF400149C3C /* libRCTText.a in Frameworks */, + 32396B5A1D612AF400149C3C /* libRCTVibration.a in Frameworks */, + 32396B5B1D612AF400149C3C /* libRCTWebSocket.a in Frameworks */, + 32396B5C1D612AF400149C3C /* libReact.a in Frameworks */, + 32E28E1D1D6123A4001919A5 /* libCardIO.a in Frameworks */, 32A2D8421B38D0B20037584B /* SystemConfiguration.framework in Frameworks */, 32A2D8401B38D0AC0037584B /* MobileCoreServices.framework in Frameworks */, 32A2D83E1B38D0A70037584B /* MessageUI.framework in Frameworks */, @@ -237,186 +253,171 @@ 32A2D83A1B38D09E0037584B /* CoreLocation.framework in Frameworks */, 32A2D8381B38D09A0037584B /* AVFoundation.framework in Frameworks */, 32A2D8361B38D0950037584B /* AudioToolbox.framework in Frameworks */, - D9E324A61C4ED4BB00337CDA /* libCardIO.a in Frameworks */, + 32E28E291D6123A9001919A5 /* libPayPalMobile.a in Frameworks */, 32A2D8341B38D0900037584B /* Accelerate.framework in Frameworks */, - 146834051AC3E58100842450 /* libReact.a in Frameworks */, - 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, - D9E324A71C4ED4BB00337CDA /* libopencv_core.a in Frameworks */, - 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, - 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, - D9E324A81C4ED4BB00337CDA /* libopencv_imgproc.a in Frameworks */, - 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, - 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, - 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, - 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, - 32A2D8321B38C9C30037584B /* libPayPalMobile.a in Frameworks */, - 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, - 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, + 32E28E1E1D6123A4001919A5 /* libopencv_core.a in Frameworks */, + 32E28E1F1D6123A4001919A5 /* libopencv_imgproc.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 00C302A81ABCB8CE00DB3ED1 /* Products */ = { + 13B07FAE1A68108700A75B9A /* ReactPaypal */ = { isa = PBXGroup; children = ( - 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, + 008F07F21AC5B25A0029DE68 /* main.jsbundle */, + 13B07FAF1A68108700A75B9A /* AppDelegate.h */, + 13B07FB01A68108700A75B9A /* AppDelegate.m */, + 13B07FB51A68108700A75B9A /* Images.xcassets */, + 13B07FB61A68108700A75B9A /* Info.plist */, + 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, + 13B07FB71A68108700A75B9A /* main.m */, + 32396AFF1D6126F900149C3C /* MFLReactNativePayPal */, ); - name = Products; + name = ReactPaypal; sourceTree = ""; }; - 00C302B61ABCB90400DB3ED1 /* Products */ = { + 32396AFF1D6126F900149C3C /* MFLReactNativePayPal */ = { isa = PBXGroup; children = ( - 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, + 32396B001D6126F900149C3C /* MFLReactNativePayPal.h */, + 32396B011D6126F900149C3C /* MFLReactNativePayPal.m */, ); - name = Products; + name = MFLReactNativePayPal; + path = ../MFLReactNativePayPal; sourceTree = ""; }; - 00C302BC1ABCB91800DB3ED1 /* Products */ = { + 32396B041D612A6D00149C3C /* Products */ = { isa = PBXGroup; children = ( - 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, + 32396B081D612A6D00149C3C /* libReact.a */, ); name = Products; sourceTree = ""; }; - 00C302D41ABCB9D200DB3ED1 /* Products */ = { + 32396B0A1D612A7C00149C3C /* Products */ = { isa = PBXGroup; children = ( - 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, + 32396B0E1D612A7C00149C3C /* libRCTActionSheet.a */, ); name = Products; sourceTree = ""; }; - 00C302E01ABCB9EE00DB3ED1 /* Products */ = { + 32396B101D612A8700149C3C /* Products */ = { isa = PBXGroup; children = ( - 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, + 32396B141D612A8700149C3C /* libRCTGeolocation.a */, ); name = Products; sourceTree = ""; }; - 00E356EF1AD99517003FC87E /* ReactPaypalTests */ = { - isa = PBXGroup; - children = ( - 00E356F21AD99517003FC87E /* ReactPaypalTests.m */, - 00E356F01AD99517003FC87E /* Supporting Files */, - ); - path = ReactPaypalTests; - sourceTree = ""; - }; - 00E356F01AD99517003FC87E /* Supporting Files */ = { + 32396B161D612A9000149C3C /* Products */ = { isa = PBXGroup; children = ( - 00E356F11AD99517003FC87E /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 139105B71AF99BAD00B5F7CC /* Products */ = { - isa = PBXGroup; - children = ( - 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, + 32396B1A1D612A9000149C3C /* libRCTImage.a */, ); name = Products; sourceTree = ""; }; - 139FDEE71B06529A00C62182 /* Products */ = { + 32396B1C1D612A9800149C3C /* Products */ = { isa = PBXGroup; children = ( - 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, + 32396B201D612A9800149C3C /* libRCTLinking.a */, ); name = Products; sourceTree = ""; }; - 13B07FAE1A68108700A75B9A /* ReactPaypal */ = { + 32396B221D612A9F00149C3C /* Products */ = { isa = PBXGroup; children = ( - 008F07F21AC5B25A0029DE68 /* main.jsbundle */, - 13B07FAF1A68108700A75B9A /* AppDelegate.h */, - 13B07FB01A68108700A75B9A /* AppDelegate.m */, - 13B07FB51A68108700A75B9A /* Images.xcassets */, - 13B07FB61A68108700A75B9A /* Info.plist */, - 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, - 13B07FB71A68108700A75B9A /* main.m */, - 32A2D8131B38C96C0037584B /* MFLReactNativePayPal */, + 32396B261D612AA000149C3C /* libRCTNetwork.a */, ); - name = ReactPaypal; + name = Products; sourceTree = ""; }; - 146834001AC3E56700842450 /* Products */ = { + 32396B281D612AA600149C3C /* Products */ = { isa = PBXGroup; children = ( - 146834041AC3E56700842450 /* libReact.a */, + 32396B2C1D612AA600149C3C /* libRCTSettings.a */, ); name = Products; sourceTree = ""; }; - 32A2D8131B38C96C0037584B /* MFLReactNativePayPal */ = { + 32396B2E1D612AAD00149C3C /* Products */ = { isa = PBXGroup; children = ( - 32A2D81E1B38C9820037584B /* MFLReactNativePayPal.h */, - 32A2D81F1B38C9820037584B /* MFLReactNativePayPal.m */, + 32396B321D612AAD00149C3C /* libRCTText.a */, ); - path = MFLReactNativePayPal; + name = Products; sourceTree = ""; }; - 32A2D8211B38C9C30037584B /* PayPalMobile */ = { + 32396B341D612AB300149C3C /* Products */ = { isa = PBXGroup; children = ( - 32A2D82A1B38C9C30037584B /* libPayPalMobile.a */, - 32A2D82B1B38C9C30037584B /* PayPalConfiguration.h */, - 32A2D82C1B38C9C30037584B /* PayPalFuturePaymentViewController.h */, - 32A2D82D1B38C9C30037584B /* PayPalMobile.h */, - 32A2D82E1B38C9C30037584B /* PayPalOAuthScopes.h */, - 32A2D82F1B38C9C30037584B /* PayPalPayment.h */, - 32A2D8301B38C9C30037584B /* PayPalPaymentViewController.h */, - 32A2D8311B38C9C30037584B /* PayPalProfileSharingViewController.h */, + 32396B381D612AB300149C3C /* libRCTVibration.a */, ); - name = PayPalMobile; - path = lib/Paypal/PayPalMobile; + name = Products; sourceTree = ""; }; - 78C398B11ACF4ADC00677621 /* Products */ = { + 32396B3A1D612AB700149C3C /* Products */ = { isa = PBXGroup; children = ( - 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, + 32396B3E1D612AB700149C3C /* libRCTWebSocket.a */, ); name = Products; sourceTree = ""; }; - 832341AE1AAA6A7D00B99B32 /* Libraries */ = { + 32E28E111D6123A4001919A5 /* CardIO */ = { isa = PBXGroup; children = ( - D9E3249A1C4ED4BB00337CDA /* CardIO */, - 32A2D8211B38C9C30037584B /* PayPalMobile */, - 146833FF1AC3E56700842450 /* React.xcodeproj */, - 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, - 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, - 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, - 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, - 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, - 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, - 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, - 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, - 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, + 32E28E121D6123A4001919A5 /* CardIO.h */, + 32E28E131D6123A4001919A5 /* CardIOCreditCardInfo.h */, + 32E28E141D6123A4001919A5 /* CardIODetectionMode.h */, + 32E28E151D6123A4001919A5 /* CardIOPaymentViewController.h */, + 32E28E161D6123A4001919A5 /* CardIOPaymentViewControllerDelegate.h */, + 32E28E171D6123A4001919A5 /* CardIOUtilities.h */, + 32E28E181D6123A4001919A5 /* CardIOView.h */, + 32E28E191D6123A4001919A5 /* CardIOViewDelegate.h */, + 32E28E1A1D6123A4001919A5 /* libCardIO.a */, + 32E28E1B1D6123A4001919A5 /* libopencv_core.a */, + 32E28E1C1D6123A4001919A5 /* libopencv_imgproc.a */, ); - name = Libraries; + name = CardIO; + path = ../lib/Paypal/CardIO; sourceTree = ""; }; - 832341B11AAA6A8300B99B32 /* Products */ = { + 32E28E201D6123A9001919A5 /* PayPalMobile */ = { isa = PBXGroup; children = ( - 832341B51AAA6A8300B99B32 /* libRCTText.a */, + 32E28E211D6123A9001919A5 /* libPayPalMobile.a */, + 32E28E221D6123A9001919A5 /* PayPalConfiguration.h */, + 32E28E231D6123A9001919A5 /* PayPalFuturePaymentViewController.h */, + 32E28E241D6123A9001919A5 /* PayPalMobile.h */, + 32E28E251D6123A9001919A5 /* PayPalOAuthScopes.h */, + 32E28E261D6123A9001919A5 /* PayPalPayment.h */, + 32E28E271D6123A9001919A5 /* PayPalPaymentViewController.h */, + 32E28E281D6123A9001919A5 /* PayPalProfileSharingViewController.h */, ); - name = Products; + name = PayPalMobile; + path = ../lib/Paypal/PayPalMobile; sourceTree = ""; }; - 83CBB9F61A601CBA00E9B192 = { + 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( + 32E28E201D6123A9001919A5 /* PayPalMobile */, + 32E28E111D6123A4001919A5 /* CardIO */, + 32396B031D612A6D00149C3C /* React.xcodeproj */, + 32396B091D612A7C00149C3C /* RCTActionSheet.xcodeproj */, + 32396B0F1D612A8700149C3C /* RCTGeolocation.xcodeproj */, + 32396B151D612A9000149C3C /* RCTImage.xcodeproj */, + 32396B1B1D612A9800149C3C /* RCTLinking.xcodeproj */, + 32396B211D612A9F00149C3C /* RCTNetwork.xcodeproj */, + 32396B271D612AA600149C3C /* RCTSettings.xcodeproj */, + 32396B2D1D612AAD00149C3C /* RCTText.xcodeproj */, + 32396B331D612AB300149C3C /* RCTVibration.xcodeproj */, + 32396B391D612AB700149C3C /* RCTWebSocket.xcodeproj */, 32A2D8411B38D0B20037584B /* SystemConfiguration.framework */, 32A2D83F1B38D0AC0037584B /* MobileCoreServices.framework */, 32A2D83D1B38D0A70037584B /* MessageUI.framework */, @@ -425,9 +426,15 @@ 32A2D8371B38D09A0037584B /* AVFoundation.framework */, 32A2D8351B38D0950037584B /* AudioToolbox.framework */, 32A2D8331B38D0900037584B /* Accelerate.framework */, + ); + name = Libraries; + sourceTree = ""; + }; + 83CBB9F61A601CBA00E9B192 = { + isa = PBXGroup; + children = ( 13B07FAE1A68108700A75B9A /* ReactPaypal */, 832341AE1AAA6A7D00B99B32 /* Libraries */, - 00E356EF1AD99517003FC87E /* ReactPaypalTests */, 83CBBA001A601CBA00E9B192 /* Products */, ); indentWidth = 2; @@ -442,25 +449,6 @@ name = Products; sourceTree = ""; }; - D9E3249A1C4ED4BB00337CDA /* CardIO */ = { - isa = PBXGroup; - children = ( - D9E3249B1C4ED4BB00337CDA /* CardIO.h */, - D9E3249C1C4ED4BB00337CDA /* CardIOCreditCardInfo.h */, - D9E3249D1C4ED4BB00337CDA /* CardIODetectionMode.h */, - D9E3249E1C4ED4BB00337CDA /* CardIOPaymentViewController.h */, - D9E3249F1C4ED4BB00337CDA /* CardIOPaymentViewControllerDelegate.h */, - D9E324A01C4ED4BB00337CDA /* CardIOUtilities.h */, - D9E324A11C4ED4BB00337CDA /* CardIOView.h */, - D9E324A21C4ED4BB00337CDA /* CardIOViewDelegate.h */, - D9E324A31C4ED4BB00337CDA /* libCardIO.a */, - D9E324A41C4ED4BB00337CDA /* libopencv_core.a */, - D9E324A51C4ED4BB00337CDA /* libopencv_imgproc.a */, - ); - name = CardIO; - path = lib/Paypal/CardIO; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -475,15 +463,16 @@ buildRules = ( ); dependencies = ( - D9E3247F1C4ECF3600337CDA /* PBXTargetDependency */, - D9E324811C4ECF3600337CDA /* PBXTargetDependency */, - D9E324831C4ECF3600337CDA /* PBXTargetDependency */, - D9E324851C4ECF3600337CDA /* PBXTargetDependency */, - D9E324871C4ECF3600337CDA /* PBXTargetDependency */, - D9E324891C4ECF3600337CDA /* PBXTargetDependency */, - D9E3248B1C4ECF3600337CDA /* PBXTargetDependency */, - D9E3248D1C4ECF3600337CDA /* PBXTargetDependency */, - D9E3248F1C4ECF3600337CDA /* PBXTargetDependency */, + 32396B401D612AED00149C3C /* PBXTargetDependency */, + 32396B421D612AED00149C3C /* PBXTargetDependency */, + 32396B441D612AED00149C3C /* PBXTargetDependency */, + 32396B461D612AED00149C3C /* PBXTargetDependency */, + 32396B481D612AED00149C3C /* PBXTargetDependency */, + 32396B4A1D612AED00149C3C /* PBXTargetDependency */, + 32396B4C1D612AED00149C3C /* PBXTargetDependency */, + 32396B4E1D612AED00149C3C /* PBXTargetDependency */, + 32396B501D612AED00149C3C /* PBXTargetDependency */, + 32396B521D612AED00149C3C /* PBXTargetDependency */, ); name = ReactPaypal; productName = "Hello World"; @@ -512,44 +501,44 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; - ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; + ProductGroup = 32396B0A1D612A7C00149C3C /* Products */; + ProjectRef = 32396B091D612A7C00149C3C /* RCTActionSheet.xcodeproj */; }, { - ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; - ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; + ProductGroup = 32396B101D612A8700149C3C /* Products */; + ProjectRef = 32396B0F1D612A8700149C3C /* RCTGeolocation.xcodeproj */; }, { - ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; - ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; + ProductGroup = 32396B161D612A9000149C3C /* Products */; + ProjectRef = 32396B151D612A9000149C3C /* RCTImage.xcodeproj */; }, { - ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; - ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; + ProductGroup = 32396B1C1D612A9800149C3C /* Products */; + ProjectRef = 32396B1B1D612A9800149C3C /* RCTLinking.xcodeproj */; }, { - ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; - ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; + ProductGroup = 32396B221D612A9F00149C3C /* Products */; + ProjectRef = 32396B211D612A9F00149C3C /* RCTNetwork.xcodeproj */; }, { - ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; - ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; + ProductGroup = 32396B281D612AA600149C3C /* Products */; + ProjectRef = 32396B271D612AA600149C3C /* RCTSettings.xcodeproj */; }, { - ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; - ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; + ProductGroup = 32396B2E1D612AAD00149C3C /* Products */; + ProjectRef = 32396B2D1D612AAD00149C3C /* RCTText.xcodeproj */; }, { - ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; - ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; + ProductGroup = 32396B341D612AB300149C3C /* Products */; + ProjectRef = 32396B331D612AB300149C3C /* RCTVibration.xcodeproj */; }, { - ProductGroup = 139FDEE71B06529A00C62182 /* Products */; - ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; + ProductGroup = 32396B3A1D612AB700149C3C /* Products */; + ProjectRef = 32396B391D612AB700149C3C /* RCTWebSocket.xcodeproj */; }, { - ProductGroup = 146834001AC3E56700842450 /* Products */; - ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; + ProductGroup = 32396B041D612A6D00149C3C /* Products */; + ProjectRef = 32396B031D612A6D00149C3C /* React.xcodeproj */; }, ); projectRoot = ""; @@ -560,74 +549,74 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { + 32396B081D612A6D00149C3C /* libReact.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libRCTActionSheet.a; - remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; + path = libReact.a; + remoteRef = 32396B071D612A6D00149C3C /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { + 32396B0E1D612A7C00149C3C /* libRCTActionSheet.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libRCTGeolocation.a; - remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; + path = libRCTActionSheet.a; + remoteRef = 32396B0D1D612A7C00149C3C /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { + 32396B141D612A8700149C3C /* libRCTGeolocation.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libRCTImage.a; - remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; + path = libRCTGeolocation.a; + remoteRef = 32396B131D612A8700149C3C /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { + 32396B1A1D612A9000149C3C /* libRCTImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libRCTNetwork.a; - remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; + path = libRCTImage.a; + remoteRef = 32396B191D612A9000149C3C /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { + 32396B201D612A9800149C3C /* libRCTLinking.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libRCTVibration.a; - remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; + path = libRCTLinking.a; + remoteRef = 32396B1F1D612A9800149C3C /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { + 32396B261D612AA000149C3C /* libRCTNetwork.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libRCTSettings.a; - remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; + path = libRCTNetwork.a; + remoteRef = 32396B251D612AA000149C3C /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { + 32396B2C1D612AA600149C3C /* libRCTSettings.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libRCTWebSocket.a; - remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; + path = libRCTSettings.a; + remoteRef = 32396B2B1D612AA600149C3C /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 146834041AC3E56700842450 /* libReact.a */ = { + 32396B321D612AAD00149C3C /* libRCTText.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libReact.a; - remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; + path = libRCTText.a; + remoteRef = 32396B311D612AAD00149C3C /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { + 32396B381D612AB300149C3C /* libRCTVibration.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libRCTLinking.a; - remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; + path = libRCTVibration.a; + remoteRef = 32396B371D612AB300149C3C /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { + 32396B3E1D612AB700149C3C /* libRCTWebSocket.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libRCTText.a; - remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; + path = libRCTWebSocket.a; + remoteRef = 32396B3D1D612AB700149C3C /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -650,7 +639,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 32A2D8201B38C9820037584B /* MFLReactNativePayPal.m in Sources */, + 32396B021D6126F900149C3C /* MFLReactNativePayPal.m in Sources */, 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 13B07FC11A68108700A75B9A /* main.m in Sources */, ); @@ -659,50 +648,55 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - D9E3247F1C4ECF3600337CDA /* PBXTargetDependency */ = { + 32396B401D612AED00149C3C /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = React; - targetProxy = D9E3247E1C4ECF3600337CDA /* PBXContainerItemProxy */; + targetProxy = 32396B3F1D612AED00149C3C /* PBXContainerItemProxy */; }; - D9E324811C4ECF3600337CDA /* PBXTargetDependency */ = { + 32396B421D612AED00149C3C /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = RCTActionSheet; - targetProxy = D9E324801C4ECF3600337CDA /* PBXContainerItemProxy */; + targetProxy = 32396B411D612AED00149C3C /* PBXContainerItemProxy */; }; - D9E324831C4ECF3600337CDA /* PBXTargetDependency */ = { + 32396B441D612AED00149C3C /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = RCTGeolocation; - targetProxy = D9E324821C4ECF3600337CDA /* PBXContainerItemProxy */; + targetProxy = 32396B431D612AED00149C3C /* PBXContainerItemProxy */; }; - D9E324851C4ECF3600337CDA /* PBXTargetDependency */ = { + 32396B461D612AED00149C3C /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = RCTImage; - targetProxy = D9E324841C4ECF3600337CDA /* PBXContainerItemProxy */; + targetProxy = 32396B451D612AED00149C3C /* PBXContainerItemProxy */; }; - D9E324871C4ECF3600337CDA /* PBXTargetDependency */ = { + 32396B481D612AED00149C3C /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = RCTLinking; - targetProxy = D9E324861C4ECF3600337CDA /* PBXContainerItemProxy */; + targetProxy = 32396B471D612AED00149C3C /* PBXContainerItemProxy */; }; - D9E324891C4ECF3600337CDA /* PBXTargetDependency */ = { + 32396B4A1D612AED00149C3C /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = RCTNetwork; - targetProxy = D9E324881C4ECF3600337CDA /* PBXContainerItemProxy */; + targetProxy = 32396B491D612AED00149C3C /* PBXContainerItemProxy */; }; - D9E3248B1C4ECF3600337CDA /* PBXTargetDependency */ = { + 32396B4C1D612AED00149C3C /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = RCTSettings; - targetProxy = D9E3248A1C4ECF3600337CDA /* PBXContainerItemProxy */; + targetProxy = 32396B4B1D612AED00149C3C /* PBXContainerItemProxy */; }; - D9E3248D1C4ECF3600337CDA /* PBXTargetDependency */ = { + 32396B4E1D612AED00149C3C /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = RCTText; - targetProxy = D9E3248C1C4ECF3600337CDA /* PBXContainerItemProxy */; + targetProxy = 32396B4D1D612AED00149C3C /* PBXContainerItemProxy */; }; - D9E3248F1C4ECF3600337CDA /* PBXTargetDependency */ = { + 32396B501D612AED00149C3C /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = RCTVibration; - targetProxy = D9E3248E1C4ECF3600337CDA /* PBXContainerItemProxy */; + targetProxy = 32396B4F1D612AED00149C3C /* PBXContainerItemProxy */; + }; + 32396B521D612AED00149C3C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = RCTWebSocket; + targetProxy = 32396B511D612AED00149C3C /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -724,6 +718,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)/node_modules/react-native/React\"/**", "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "\"$(SRCROOT)/node_modules/react-native/React\"/**", @@ -732,8 +727,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/lib/Paypal/PayPalMobile", - "$(PROJECT_DIR)/lib/Paypal/CardIO", + "$(PROJECT_DIR)/../lib/Paypal/PayPalMobile", + "$(PROJECT_DIR)/../lib/Paypal/CardIO", ); OTHER_LDFLAGS = ( "-ObjC", @@ -748,6 +743,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)/node_modules/react-native/React\"/**", "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "\"$(SRCROOT)/node_modules/react-native/React\"/**", @@ -756,8 +752,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/lib/Paypal/PayPalMobile", - "$(PROJECT_DIR)/lib/Paypal/CardIO", + "$(PROJECT_DIR)/../lib/Paypal/PayPalMobile", + "$(PROJECT_DIR)/../lib/Paypal/CardIO", ); OTHER_LDFLAGS = ( "-ObjC", diff --git a/ReactPaypal/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme b/ios/Example/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme similarity index 100% rename from ReactPaypal/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme rename to ios/Example/ReactPaypal.xcodeproj/xcshareddata/xcschemes/ReactPaypal.xcscheme diff --git a/ReactPaypal/iOS/AppDelegate.h b/ios/Example/iOS/AppDelegate.h similarity index 100% rename from ReactPaypal/iOS/AppDelegate.h rename to ios/Example/iOS/AppDelegate.h diff --git a/ReactPaypal/iOS/AppDelegate.m b/ios/Example/iOS/AppDelegate.m similarity index 100% rename from ReactPaypal/iOS/AppDelegate.m rename to ios/Example/iOS/AppDelegate.m diff --git a/ReactPaypal/iOS/Base.lproj/LaunchScreen.xib b/ios/Example/iOS/Base.lproj/LaunchScreen.xib similarity index 100% rename from ReactPaypal/iOS/Base.lproj/LaunchScreen.xib rename to ios/Example/iOS/Base.lproj/LaunchScreen.xib diff --git a/ReactPaypal/iOS/Images.xcassets/AppIcon.appiconset/Contents.json b/ios/Example/iOS/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from ReactPaypal/iOS/Images.xcassets/AppIcon.appiconset/Contents.json rename to ios/Example/iOS/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/ReactPaypal/iOS/Info.plist b/ios/Example/iOS/Info.plist similarity index 100% rename from ReactPaypal/iOS/Info.plist rename to ios/Example/iOS/Info.plist diff --git a/ReactPaypal/iOS/main.jsbundle b/ios/Example/iOS/main.jsbundle similarity index 100% rename from ReactPaypal/iOS/main.jsbundle rename to ios/Example/iOS/main.jsbundle diff --git a/ReactPaypal/iOS/main.m b/ios/Example/iOS/main.m similarity index 100% rename from ReactPaypal/iOS/main.m rename to ios/Example/iOS/main.m diff --git a/ReactPaypal/index.ios.js b/ios/Example/index.ios.js similarity index 84% rename from ReactPaypal/index.ios.js rename to ios/Example/index.ios.js index 4181134..b1d6e3b 100644 --- a/ReactPaypal/index.ios.js +++ b/ios/Example/index.ios.js @@ -4,18 +4,24 @@ */ 'use strict'; -var React = require('react-native'); -var MFLReactNativePayPal = React.NativeModules.MFLReactNativePayPal; +import React from 'react'; -var { +import { + Component +} from 'react'; + +import { AppRegistry, StyleSheet, Text, View, - TouchableHighlight -} = React; + TouchableHighlight, + NativeModules +} from 'react-native'; + +var MFLReactNativePayPal = NativeModules.MFLReactNativePayPal; -class ReactPaypal extends React.Component { +class ReactPaypal extends Component { componentDidMount() { console.log("Component did mount"); MFLReactNativePayPal.initializePaypalEnvironment(0, @@ -23,7 +29,7 @@ class ReactPaypal extends React.Component { } _onPressButton() { - MFLReactNativePayPal.preparePaymentOfAmount(100.00, "USD", "Bacon"); + MFLReactNativePayPal.preparePaymentOfAmount("100.00", "USD", "Bacon"); MFLReactNativePayPal.prepareConfigurationForMerchant("Bacon Truck", true, "bacon@bacon.com"); MFLReactNativePayPal.presentPaymentViewControllerForPreparedPurchase((error, payload) => { if (error) { diff --git a/ios/Example/package.json b/ios/Example/package.json new file mode 100644 index 0000000..b5da48d --- /dev/null +++ b/ios/Example/package.json @@ -0,0 +1,12 @@ +{ + "name": "ExampleiOS", + "version": "0.0.1", + "private": true, + "scripts": { + "start": "node node_modules/react-native/local-cli/cli.js start" + }, + "devDependencies": { + "react-native": ">=0.18.0", + "react": "15.2.1" + } +} diff --git a/LICENSE.md b/ios/LICENSE.md similarity index 100% rename from LICENSE.md rename to ios/LICENSE.md diff --git a/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj b/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6b8f36e --- /dev/null +++ b/ios/MFLReactNativePayPal.xcodeproj/project.pbxproj @@ -0,0 +1,344 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 64976FFC1C47962B00C0178E /* libCardIO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64976FF01C47962B00C0178E /* libCardIO.a */; }; + 64976FFD1C47962B00C0178E /* libopencv_core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64976FF11C47962B00C0178E /* libopencv_core.a */; }; + 64976FFE1C47962B00C0178E /* libopencv_imgproc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64976FF21C47962B00C0178E /* libopencv_imgproc.a */; }; + 64976FFF1C47962B00C0178E /* libPayPalMobile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64976FF41C47962B00C0178E /* libPayPalMobile.a */; }; + 64D7A23C1C46907F008FCDA3 /* MFLReactNativePayPal.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 64D7A23B1C46907F008FCDA3 /* MFLReactNativePayPal.h */; }; + 64D7A23E1C46907F008FCDA3 /* MFLReactNativePayPal.m in Sources */ = {isa = PBXBuildFile; fileRef = 64D7A23D1C46907F008FCDA3 /* MFLReactNativePayPal.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 64D7A2361C46907F008FCDA3 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + 64D7A23C1C46907F008FCDA3 /* MFLReactNativePayPal.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 64976FE81C47962B00C0178E /* CardIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIO.h; sourceTree = ""; }; + 64976FE91C47962B00C0178E /* CardIOCreditCardInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOCreditCardInfo.h; sourceTree = ""; }; + 64976FEA1C47962B00C0178E /* CardIODetectionMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIODetectionMode.h; sourceTree = ""; }; + 64976FEB1C47962B00C0178E /* CardIOPaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOPaymentViewController.h; sourceTree = ""; }; + 64976FEC1C47962B00C0178E /* CardIOPaymentViewControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOPaymentViewControllerDelegate.h; sourceTree = ""; }; + 64976FED1C47962B00C0178E /* CardIOUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOUtilities.h; sourceTree = ""; }; + 64976FEE1C47962B00C0178E /* CardIOView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOView.h; sourceTree = ""; }; + 64976FEF1C47962B00C0178E /* CardIOViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardIOViewDelegate.h; sourceTree = ""; }; + 64976FF01C47962B00C0178E /* libCardIO.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libCardIO.a; sourceTree = ""; }; + 64976FF11C47962B00C0178E /* libopencv_core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopencv_core.a; sourceTree = ""; }; + 64976FF21C47962B00C0178E /* libopencv_imgproc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopencv_imgproc.a; sourceTree = ""; }; + 64976FF41C47962B00C0178E /* libPayPalMobile.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libPayPalMobile.a; sourceTree = ""; }; + 64976FF51C47962B00C0178E /* PayPalConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalConfiguration.h; sourceTree = ""; }; + 64976FF61C47962B00C0178E /* PayPalFuturePaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalFuturePaymentViewController.h; sourceTree = ""; }; + 64976FF71C47962B00C0178E /* PayPalMobile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalMobile.h; sourceTree = ""; }; + 64976FF81C47962B00C0178E /* PayPalOAuthScopes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalOAuthScopes.h; sourceTree = ""; }; + 64976FF91C47962B00C0178E /* PayPalPayment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalPayment.h; sourceTree = ""; }; + 64976FFA1C47962B00C0178E /* PayPalPaymentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalPaymentViewController.h; sourceTree = ""; }; + 64976FFB1C47962B00C0178E /* PayPalProfileSharingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PayPalProfileSharingViewController.h; sourceTree = ""; }; + 64D7A2381C46907F008FCDA3 /* libMFLReactNativePayPal.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMFLReactNativePayPal.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 64D7A23B1C46907F008FCDA3 /* MFLReactNativePayPal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MFLReactNativePayPal.h; sourceTree = ""; }; + 64D7A23D1C46907F008FCDA3 /* MFLReactNativePayPal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MFLReactNativePayPal.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 64D7A2351C46907F008FCDA3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 64976FFC1C47962B00C0178E /* libCardIO.a in Frameworks */, + 64976FFD1C47962B00C0178E /* libopencv_core.a in Frameworks */, + 64976FFF1C47962B00C0178E /* libPayPalMobile.a in Frameworks */, + 64976FFE1C47962B00C0178E /* libopencv_imgproc.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 64976FE71C47962B00C0178E /* CardIO */ = { + isa = PBXGroup; + children = ( + 64976FE81C47962B00C0178E /* CardIO.h */, + 64976FE91C47962B00C0178E /* CardIOCreditCardInfo.h */, + 64976FEA1C47962B00C0178E /* CardIODetectionMode.h */, + 64976FEB1C47962B00C0178E /* CardIOPaymentViewController.h */, + 64976FEC1C47962B00C0178E /* CardIOPaymentViewControllerDelegate.h */, + 64976FED1C47962B00C0178E /* CardIOUtilities.h */, + 64976FEE1C47962B00C0178E /* CardIOView.h */, + 64976FEF1C47962B00C0178E /* CardIOViewDelegate.h */, + 64976FF01C47962B00C0178E /* libCardIO.a */, + 64976FF11C47962B00C0178E /* libopencv_core.a */, + 64976FF21C47962B00C0178E /* libopencv_imgproc.a */, + ); + name = CardIO; + path = lib/Paypal/CardIO; + sourceTree = ""; + }; + 64976FF31C47962B00C0178E /* PayPalMobile */ = { + isa = PBXGroup; + children = ( + 64976FF41C47962B00C0178E /* libPayPalMobile.a */, + 64976FF51C47962B00C0178E /* PayPalConfiguration.h */, + 64976FF61C47962B00C0178E /* PayPalFuturePaymentViewController.h */, + 64976FF71C47962B00C0178E /* PayPalMobile.h */, + 64976FF81C47962B00C0178E /* PayPalOAuthScopes.h */, + 64976FF91C47962B00C0178E /* PayPalPayment.h */, + 64976FFA1C47962B00C0178E /* PayPalPaymentViewController.h */, + 64976FFB1C47962B00C0178E /* PayPalProfileSharingViewController.h */, + ); + name = PayPalMobile; + path = lib/Paypal/PayPalMobile; + sourceTree = ""; + }; + 64D7A22F1C46907F008FCDA3 = { + isa = PBXGroup; + children = ( + 64976FE71C47962B00C0178E /* CardIO */, + 64976FF31C47962B00C0178E /* PayPalMobile */, + 64D7A23A1C46907F008FCDA3 /* MFLReactNativePayPal */, + 64D7A2391C46907F008FCDA3 /* Products */, + ); + sourceTree = ""; + }; + 64D7A2391C46907F008FCDA3 /* Products */ = { + isa = PBXGroup; + children = ( + 64D7A2381C46907F008FCDA3 /* libMFLReactNativePayPal.a */, + ); + name = Products; + sourceTree = ""; + }; + 64D7A23A1C46907F008FCDA3 /* MFLReactNativePayPal */ = { + isa = PBXGroup; + children = ( + 64D7A23B1C46907F008FCDA3 /* MFLReactNativePayPal.h */, + 64D7A23D1C46907F008FCDA3 /* MFLReactNativePayPal.m */, + ); + path = MFLReactNativePayPal; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 64D7A2371C46907F008FCDA3 /* MFLReactNativePayPal */ = { + isa = PBXNativeTarget; + buildConfigurationList = 64D7A2411C46907F008FCDA3 /* Build configuration list for PBXNativeTarget "MFLReactNativePayPal" */; + buildPhases = ( + 64D7A2341C46907F008FCDA3 /* Sources */, + 64D7A2351C46907F008FCDA3 /* Frameworks */, + 64D7A2361C46907F008FCDA3 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MFLReactNativePayPal; + productName = MFLReactNativePayPal; + productReference = 64D7A2381C46907F008FCDA3 /* libMFLReactNativePayPal.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 64D7A2301C46907F008FCDA3 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0720; + TargetAttributes = { + 64D7A2371C46907F008FCDA3 = { + CreatedOnToolsVersion = 7.2; + }; + }; + }; + buildConfigurationList = 64D7A2331C46907F008FCDA3 /* Build configuration list for PBXProject "MFLReactNativePayPal" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 64D7A22F1C46907F008FCDA3; + productRefGroup = 64D7A2391C46907F008FCDA3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 64D7A2371C46907F008FCDA3 /* MFLReactNativePayPal */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 64D7A2341C46907F008FCDA3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 64D7A23E1C46907F008FCDA3 /* MFLReactNativePayPal.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 64D7A23F1C46907F008FCDA3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 64D7A2401C46907F008FCDA3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 64D7A2421C46907F008FCDA3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/node_modules/react-native/React/**", + "$(SRCROOT)/../../react-native/React/**", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/lib/Paypal/CardIO", + "$(PROJECT_DIR)/lib/Paypal/PayPalMobile", + ); + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "-lc++", + "-ObjC", + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 64D7A2431C46907F008FCDA3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/node_modules/react-native/React/**", + "$(SRCROOT)/../../react-native/React/**", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/lib/Paypal/CardIO", + "$(PROJECT_DIR)/lib/Paypal/PayPalMobile", + ); + OTHER_LDFLAGS = ( + "-lc++", + "-ObjC", + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 64D7A2331C46907F008FCDA3 /* Build configuration list for PBXProject "MFLReactNativePayPal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 64D7A23F1C46907F008FCDA3 /* Debug */, + 64D7A2401C46907F008FCDA3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 64D7A2411C46907F008FCDA3 /* Build configuration list for PBXNativeTarget "MFLReactNativePayPal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 64D7A2421C46907F008FCDA3 /* Debug */, + 64D7A2431C46907F008FCDA3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 64D7A2301C46907F008FCDA3 /* Project object */; +} diff --git a/ios/MFLReactNativePayPal/MFLReactNativePayPal.h b/ios/MFLReactNativePayPal/MFLReactNativePayPal.h new file mode 100644 index 0000000..f341aaa --- /dev/null +++ b/ios/MFLReactNativePayPal/MFLReactNativePayPal.h @@ -0,0 +1,27 @@ +// +// MFLReactNativePayPal.h +// ReactPaypal +// +// Created by Tj on 6/22/15. +// Copyright (c) 2015 Facebook. All rights reserved. +// + +#import + +typedef NS_ENUM(NSInteger, PayPalEnvironment) +{ + kPayPalEnvironmentSandbox, + kPayPalEnvironmentProduction, + kPayPalEnvironmentSandboxNoNetwork +}; + +typedef NS_ENUM(NSInteger, PaymentCompletionStatus) +{ + kPayPalPaymentCanceled, + kPayPalPaymentCompleted +}; + + +@interface MFLReactNativePayPal : NSObject + +@end diff --git a/ios/MFLReactNativePayPal/MFLReactNativePayPal.m b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m new file mode 100644 index 0000000..609be32 --- /dev/null +++ b/ios/MFLReactNativePayPal/MFLReactNativePayPal.m @@ -0,0 +1,146 @@ +// +// MFLReactNativePayPal.m +// ReactPaypal +// +// Created by Tj on 6/22/15. +// Copyright (c) 2015 Facebook. All rights reserved. +// + +#import "MFLReactNativePayPal.h" +#import "RCTBridge.h" +#import "PayPalMobile.h" +#import "RCTConvert.h" + +NSString * const kPayPalPaymentStatusKey = @"status"; +NSString * const kPayPalPaymentConfirmationKey = @"confirmation"; + +@implementation RCTConvert (PaymentCompletionStatus) + +RCT_ENUM_CONVERTER(PaymentCompletionStatus, (@{ @"Canceled" : @(kPayPalPaymentCompleted), + @"Completed" : @(kPayPalPaymentCanceled)} + ), kPayPalPaymentCanceled, integerValue) + +@end + + +@implementation RCTConvert (PayPalEnvironment) + +RCT_ENUM_CONVERTER(PayPalEnvironment, (@{ @"Sandbox" : @(kPayPalEnvironmentSandbox), + @"Production" : @(kPayPalEnvironmentProduction), + @"NoNetwork" : @(kPayPalEnvironmentSandboxNoNetwork)} + ), kPayPalEnvironmentSandboxNoNetwork, integerValue) + +@end + + +@interface MFLReactNativePayPal () + +@property PayPalPayment *payment; +@property PayPalConfiguration *configuration; +@property (copy) RCTResponseSenderBlock flowCompletedCallback; + +@end + +@implementation MFLReactNativePayPal + +RCT_EXPORT_MODULE(); + +RCT_EXPORT_METHOD(initializePaypalEnvironment:(int)environment + forClientId:(NSString *)clientId ) +{ + dispatch_async(dispatch_get_main_queue(), ^{ + NSString *envString = [self stringFromEnvironmentEnum:environment]; + + [PayPalMobile initializeWithClientIdsForEnvironments:@{envString : clientId}]; + [PayPalMobile preconnectWithEnvironment:envString]; + }); +} + +#pragma mark React Exported Methods + +RCT_EXPORT_METHOD(preparePaymentOfAmount:(NSString *)amount + ofCurrency:(NSString *)currencyCode + withDescription:(NSString *)description) +{ + self.payment = [[PayPalPayment alloc] init]; + [self.payment setAmount:[[NSDecimalNumber alloc] initWithString:amount]]; + [self.payment setCurrencyCode:currencyCode]; + [self.payment setShortDescription:description]; +} + + +RCT_EXPORT_METHOD(prepareConfigurationForMerchant:(NSString *)merchantName + acceptingCreditCards:(BOOL)shouldAcceptCreditCards + withUserEmail:(NSString *)userEmail) +{ + self.configuration = [[PayPalConfiguration alloc] init]; + [self.configuration setMerchantName:merchantName]; + [self.configuration setAcceptCreditCards:shouldAcceptCreditCards]; + [self.configuration setDefaultUserEmail:userEmail]; +} + +RCT_EXPORT_METHOD(presentPaymentViewControllerForPreparedPurchase:(RCTResponseSenderBlock)flowCompletedCallback) +{ + self.flowCompletedCallback = flowCompletedCallback; + + PayPalPaymentViewController *vc = [[PayPalPaymentViewController alloc] initWithPayment:self.payment + configuration:self.configuration + delegate:self]; + + UIViewController *visibleVC = [[[UIApplication sharedApplication] keyWindow] rootViewController]; + do { + if ([visibleVC isKindOfClass:[UINavigationController class]]) { + visibleVC = [(UINavigationController *)visibleVC visibleViewController]; + } else if (visibleVC.presentedViewController) { + visibleVC = visibleVC.presentedViewController; + } + } while (visibleVC.presentedViewController); + dispatch_async(dispatch_get_main_queue(), ^{ + [visibleVC presentViewController:vc animated:YES completion:nil]; + }); +} + +#pragma mark Paypal Delegate + +- (void)payPalPaymentDidCancel:(PayPalPaymentViewController *)paymentViewController +{ + [paymentViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ + if (self.flowCompletedCallback) { + self.flowCompletedCallback(@[[NSNull null], @{kPayPalPaymentStatusKey : @(kPayPalPaymentCanceled)}]); + } + }]; +} + +- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController + didCompletePayment:(PayPalPayment *)completedPayment +{ + [paymentViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ + if (self.flowCompletedCallback) { + self.flowCompletedCallback(@[[NSNull null], @{kPayPalPaymentStatusKey : @(kPayPalPaymentCompleted), + kPayPalPaymentConfirmationKey : completedPayment.confirmation}]); + } + }]; +} + +#pragma mark Utilities + +- (NSDictionary *)constantsToExport +{ + return @{ @"Environment" : @{ + @"Sandbox" : @(kPayPalEnvironmentSandbox), + @"Production" : @(kPayPalEnvironmentProduction), + @"NoNetwork" : @(kPayPalEnvironmentSandboxNoNetwork), + }, + }; +} + +- (NSString *)stringFromEnvironmentEnum:(PayPalEnvironment)env +{ + switch (env) { + case kPayPalEnvironmentProduction: return PayPalEnvironmentProduction; + case kPayPalEnvironmentSandbox: return PayPalEnvironmentSandbox; + case kPayPalEnvironmentSandboxNoNetwork: return PayPalEnvironmentNoNetwork; + } +} + +@end diff --git a/ios/lib/Paypal b/ios/lib/Paypal new file mode 160000 index 0000000..efcfab9 --- /dev/null +++ b/ios/lib/Paypal @@ -0,0 +1 @@ +Subproject commit efcfab9308aba9382b0019ea17196731ba64e1b1 diff --git a/package.json b/package.json new file mode 100644 index 0000000..d5828ea --- /dev/null +++ b/package.json @@ -0,0 +1,31 @@ +{ + "name": "react-native-paypal", + "version": "1.0.4", + "description": "Native PayPal payment screen for React Native", + "main": "index.js", + "repository": { + "type": "git", + "url": "https://github.com/MattFoley/react-native-paypal.git" + }, + "keywords": [ + "react", + "react-component", + "react-native", + "pay-pal", + "android", + "ios" + ], + "author": "iOSGuy (http://github.com/MattFoley)", + "contributors": [ + "contato@vizir.com.br", + "Timo Uhlmann (http://github.com/amiuhle)" + ], + "peerDependencies": { + "react-native": ">=0.18.0" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/vizir/react-native-paypal/issues" + }, + "homepage": "https://github.com/vizir/react-native-paypal" +} diff --git a/react-native-paypal.gif b/react-native-paypal.gif new file mode 100644 index 0000000..cf39391 Binary files /dev/null and b/react-native-paypal.gif differ