diff --git a/.github/workflows/security-code-scanner.yml b/.github/workflows/security-code-scanner.yml new file mode 100644 index 00000000..ced04497 --- /dev/null +++ b/.github/workflows/security-code-scanner.yml @@ -0,0 +1,43 @@ +name: 'MetaMask Security Code Scanner' + +on: + push: + branches: ['main'] + pull_request: + branches: ['main'] + +jobs: + run-security-scan: + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + steps: + - name: MetaMask Security Code Scanner + uses: MetaMask/Security-Code-Scanner@main + with: + repo: ${{ github.repository }} + paths_ignored: | + .storybook/ + '**/__snapshots__/' + '**/*.snap' + '**/*.stories.js' + '**/*.stories.tsx' + '**/*.test.browser.ts*' + '**/*.test.js*' + '**/*.test.ts*' + '**/fixtures/' + '**/jest.config.js' + '**/jest.environment.js' + '**/mocks/' + '**/test*/' + docs/ + e2e/ + merged-packages/ + node_modules + storybook/ + test*/ + rules_excluded: example + project_metrics_token: ${{ secrets.SECURITY_SCAN_METRICS_TOKEN }} + slack_webhook: ${{ secrets.APPSEC_BOT_SLACK_WEBHOOK }} diff --git a/packages/react-native-payments/.npmignore b/.npmignore similarity index 85% rename from packages/react-native-payments/.npmignore rename to .npmignore index 6e616d17..5d4dc2d6 100644 --- a/packages/react-native-payments/.npmignore +++ b/.npmignore @@ -2,7 +2,7 @@ examples .babelrc .flowconfig docs/ -lib/js/__mocks__/ lib/js/__tests__/ lib/js/errors/__tests__/ lib/js/helpers/__tests__/ + diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 00000000..0d066bd1 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,27 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 28 + buildToolsVersion "28.0.3" + + defaultConfig { + minSdkVersion 21 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + ndk { + abiFilters "armeabi-v7a", "x86" + } + } + lintOptions { + warning 'InvalidPackage' + } +} + +dependencies { + implementation 'com.facebook.react:react-native:+' + implementation 'com.google.android.gms:play-services-base:17.0.0' + implementation 'com.google.android.gms:play-services-identity:17.0.0' + implementation 'com.google.android.gms:play-services-wallet:17.0.0' + implementation 'com.android.support:support-v4:23.0.1' +} diff --git a/packages/react-native-payments/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml similarity index 100% rename from packages/react-native-payments/android/src/main/AndroidManifest.xml rename to android/src/main/AndroidManifest.xml diff --git a/packages/react-native-payments/android/src/main/java/com/reactnativepayments/ReactNativePaymentsModule.java b/android/src/main/java/com/reactnativepayments/ReactNativePaymentsModule.java similarity index 99% rename from packages/react-native-payments/android/src/main/java/com/reactnativepayments/ReactNativePaymentsModule.java rename to android/src/main/java/com/reactnativepayments/ReactNativePaymentsModule.java index a47b50d4..f26dd586 100644 --- a/packages/react-native-payments/android/src/main/java/com/reactnativepayments/ReactNativePaymentsModule.java +++ b/android/src/main/java/com/reactnativepayments/ReactNativePaymentsModule.java @@ -5,11 +5,11 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.NonNull; import android.app.Fragment; import android.app.FragmentManager; -import android.support.annotation.RequiresPermission; +import androidx.annotation.RequiresPermission; import android.util.Log; import com.facebook.react.bridge.Callback; diff --git a/packages/react-native-payments/android/src/main/java/com/reactnativepayments/ReactNativePaymentsPackage.java b/android/src/main/java/com/reactnativepayments/ReactNativePaymentsPackage.java similarity index 100% rename from packages/react-native-payments/android/src/main/java/com/reactnativepayments/ReactNativePaymentsPackage.java rename to android/src/main/java/com/reactnativepayments/ReactNativePaymentsPackage.java diff --git a/packages/react-native-payments/docs/ApplePayButton.md b/docs/ApplePayButton.md similarity index 100% rename from packages/react-native-payments/docs/ApplePayButton.md rename to docs/ApplePayButton.md diff --git a/packages/react-native-payments/docs/NativePayments.md b/docs/NativePayments.md similarity index 100% rename from packages/react-native-payments/docs/NativePayments.md rename to docs/NativePayments.md diff --git a/packages/react-native-payments/docs/PaymentRequest.md b/docs/PaymentRequest.md similarity index 100% rename from packages/react-native-payments/docs/PaymentRequest.md rename to docs/PaymentRequest.md diff --git a/packages/react-native-payments/docs/PaymentRequestUpdateEvent.md b/docs/PaymentRequestUpdateEvent.md similarity index 100% rename from packages/react-native-payments/docs/PaymentRequestUpdateEvent.md rename to docs/PaymentRequestUpdateEvent.md diff --git a/packages/react-native-payments/docs/PaymentResponse.md b/docs/PaymentResponse.md similarity index 100% rename from packages/react-native-payments/docs/PaymentResponse.md rename to docs/PaymentResponse.md diff --git a/lerna.json b/lerna.json deleted file mode 100644 index 97f7b9f5..00000000 --- a/lerna.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "lerna": "2.0.0", - "packages": [ - "packages/*", - "packages/react-native-payments/examples/*" - ], - "version": "0.0.0" -} diff --git a/packages/react-native-payments/lib/ios/GatewayManager.h b/lib/ios/GatewayManager.h similarity index 100% rename from packages/react-native-payments/lib/ios/GatewayManager.h rename to lib/ios/GatewayManager.h diff --git a/packages/react-native-payments/lib/ios/GatewayManager.m b/lib/ios/GatewayManager.m similarity index 100% rename from packages/react-native-payments/lib/ios/GatewayManager.m rename to lib/ios/GatewayManager.m diff --git a/packages/react-native-payments/lib/ios/ReactNativePayments.h b/lib/ios/ReactNativePayments.h similarity index 100% rename from packages/react-native-payments/lib/ios/ReactNativePayments.h rename to lib/ios/ReactNativePayments.h diff --git a/packages/react-native-payments/lib/ios/ReactNativePayments.m b/lib/ios/ReactNativePayments.m similarity index 100% rename from packages/react-native-payments/lib/ios/ReactNativePayments.m rename to lib/ios/ReactNativePayments.m diff --git a/packages/react-native-payments/lib/ios/ReactNativePayments.podspec b/lib/ios/ReactNativePayments.podspec similarity index 100% rename from packages/react-native-payments/lib/ios/ReactNativePayments.podspec rename to lib/ios/ReactNativePayments.podspec diff --git a/packages/react-native-payments/lib/ios/ReactNativePayments.xcodeproj/project.pbxproj b/lib/ios/ReactNativePayments.xcodeproj/project.pbxproj similarity index 100% rename from packages/react-native-payments/lib/ios/ReactNativePayments.xcodeproj/project.pbxproj rename to lib/ios/ReactNativePayments.xcodeproj/project.pbxproj diff --git a/packages/react-native-payments/lib/ios/ReactNativePayments.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/lib/ios/ReactNativePayments.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from packages/react-native-payments/lib/ios/ReactNativePayments.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to lib/ios/ReactNativePayments.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/packages/react-native-payments/lib/ios/Views/PKPaymentButtonManager.h b/lib/ios/Views/PKPaymentButtonManager.h similarity index 100% rename from packages/react-native-payments/lib/ios/Views/PKPaymentButtonManager.h rename to lib/ios/Views/PKPaymentButtonManager.h diff --git a/packages/react-native-payments/lib/ios/Views/PKPaymentButtonManager.m b/lib/ios/Views/PKPaymentButtonManager.m similarity index 100% rename from packages/react-native-payments/lib/ios/Views/PKPaymentButtonManager.m rename to lib/ios/Views/PKPaymentButtonManager.m diff --git a/packages/react-native-payments/lib/ios/Views/PKPaymentButtonView.h b/lib/ios/Views/PKPaymentButtonView.h similarity index 100% rename from packages/react-native-payments/lib/ios/Views/PKPaymentButtonView.h rename to lib/ios/Views/PKPaymentButtonView.h diff --git a/packages/react-native-payments/lib/ios/Views/PKPaymentButtonView.m b/lib/ios/Views/PKPaymentButtonView.m similarity index 100% rename from packages/react-native-payments/lib/ios/Views/PKPaymentButtonView.m rename to lib/ios/Views/PKPaymentButtonView.m diff --git a/packages/react-native-payments/lib/js/NativePayments.js b/lib/js/NativePayments.js similarity index 100% rename from packages/react-native-payments/lib/js/NativePayments.js rename to lib/js/NativePayments.js diff --git a/packages/react-native-payments/lib/js/PKPaymentButton.js b/lib/js/PKPaymentButton.js similarity index 100% rename from packages/react-native-payments/lib/js/PKPaymentButton.js rename to lib/js/PKPaymentButton.js diff --git a/packages/react-native-payments/lib/js/PaymentRequest.js b/lib/js/PaymentRequest.js similarity index 97% rename from packages/react-native-payments/lib/js/PaymentRequest.js rename to lib/js/PaymentRequest.js index 0ae7fcd4..08c9dacc 100644 --- a/packages/react-native-payments/lib/js/PaymentRequest.js +++ b/lib/js/PaymentRequest.js @@ -414,16 +414,12 @@ export default class PaymentRequest { _removeEventListeners() { // Internal Events - DeviceEventEmitter.removeSubscription(this._userDismissSubscription); - DeviceEventEmitter.removeSubscription(this._userAcceptSubscription); + this._userDismissSubscription?.remove?.() + this._userAcceptSubscription?.remove?.() if (IS_IOS) { - DeviceEventEmitter.removeSubscription( - this._shippingAddressChangeSubscription - ); - DeviceEventEmitter.removeSubscription( - this._shippingOptionChangeSubscription - ); + this._shippingAddressChangeSubscription?.remove?.() + this._shippingOptionChangeSubscription?.remove?.() } } diff --git a/packages/react-native-payments/lib/js/PaymentRequestUpdateEvent.js b/lib/js/PaymentRequestUpdateEvent.js similarity index 100% rename from packages/react-native-payments/lib/js/PaymentRequestUpdateEvent.js rename to lib/js/PaymentRequestUpdateEvent.js diff --git a/packages/react-native-payments/lib/js/PaymentResponse.js b/lib/js/PaymentResponse.js similarity index 100% rename from packages/react-native-payments/lib/js/PaymentResponse.js rename to lib/js/PaymentResponse.js diff --git a/packages/react-native-payments/lib/js/__mocks__/index.js b/lib/js/__mocks__/index.js similarity index 100% rename from packages/react-native-payments/lib/js/__mocks__/index.js rename to lib/js/__mocks__/index.js diff --git a/packages/react-native-payments/lib/js/__tests__/PaymentRequest-test.js b/lib/js/__tests__/PaymentRequest-test.js similarity index 100% rename from packages/react-native-payments/lib/js/__tests__/PaymentRequest-test.js rename to lib/js/__tests__/PaymentRequest-test.js diff --git a/packages/react-native-payments/lib/js/__tests__/PaymentRequestUpdateEvent-test.js b/lib/js/__tests__/PaymentRequestUpdateEvent-test.js similarity index 100% rename from packages/react-native-payments/lib/js/__tests__/PaymentRequestUpdateEvent-test.js rename to lib/js/__tests__/PaymentRequestUpdateEvent-test.js diff --git a/packages/react-native-payments/lib/js/__tests__/PaymentResponse-test.js b/lib/js/__tests__/PaymentResponse-test.js similarity index 100% rename from packages/react-native-payments/lib/js/__tests__/PaymentResponse-test.js rename to lib/js/__tests__/PaymentResponse-test.js diff --git a/packages/react-native-payments/lib/js/__tests__/constants-test.js b/lib/js/__tests__/constants-test.js similarity index 100% rename from packages/react-native-payments/lib/js/__tests__/constants-test.js rename to lib/js/__tests__/constants-test.js diff --git a/packages/react-native-payments/lib/js/constants.js b/lib/js/constants.js similarity index 100% rename from packages/react-native-payments/lib/js/constants.js rename to lib/js/constants.js diff --git a/packages/react-native-payments/lib/js/errors/__tests__/index-test.js b/lib/js/errors/__tests__/index-test.js similarity index 100% rename from packages/react-native-payments/lib/js/errors/__tests__/index-test.js rename to lib/js/errors/__tests__/index-test.js diff --git a/packages/react-native-payments/lib/js/errors/index.js b/lib/js/errors/index.js similarity index 100% rename from packages/react-native-payments/lib/js/errors/index.js rename to lib/js/errors/index.js diff --git a/packages/react-native-payments/lib/js/helpers/__tests__/index-test.js b/lib/js/helpers/__tests__/index-test.js similarity index 77% rename from packages/react-native-payments/lib/js/helpers/__tests__/index-test.js rename to lib/js/helpers/__tests__/index-test.js index e15a7e3a..5d16ffc6 100644 --- a/packages/react-native-payments/lib/js/helpers/__tests__/index-test.js +++ b/lib/js/helpers/__tests__/index-test.js @@ -1,7 +1,6 @@ const { isValidDecimalMonetaryValue, isValidStringAmount, - toNumber } = require('..'); describe('helpers', () => { @@ -48,22 +47,4 @@ describe('helpers', () => { expect(isValidStringAmount('9.')).toBe(false); }); }); - - describe('toNumber', () => { - it('"9.999" should convert to 9.999', () => { - expect(toNumber('9.999')).toBe(9.999); - }); - - it('"9.99" should convert to 9.99', () => { - expect(toNumber('9.99')).toBe(9.99); - }); - - it('"9.9" should convert to 9.9', () => { - expect(toNumber('9.9')).toBe(9.9); - }); - - it('"9" should convert to 9', () => { - expect(toNumber('9')).toBe(9); - }); - }); }); diff --git a/packages/react-native-payments/lib/js/helpers/index.js b/lib/js/helpers/index.js similarity index 96% rename from packages/react-native-payments/lib/js/helpers/index.js rename to lib/js/helpers/index.js index ba4e7373..b7bdf5c4 100644 --- a/packages/react-native-payments/lib/js/helpers/index.js +++ b/lib/js/helpers/index.js @@ -4,7 +4,6 @@ import type { PaymentShippingOption } from '../types'; -import { isDecimal, isFloat, isInt, toFloat, toInt } from 'validator'; import { DOMException, ConstructorError } from '../errors'; type AmountValue = string | number; @@ -32,21 +31,11 @@ export function isNegative(amountValue: AmountValue): boolean { } export function isValidStringAmount(stringAmount): boolean { - if (stringAmount.endsWith('.')) { - return false; - } - - return isDecimal(stringAmount); -} + if (typeof stringAmount !== 'string') throw new TypeError('Expected a string'); -export function toNumber(string: string): number { - if (isFloat(string)) { - return toFloat(string); - } - - if (isInt(string)) { - return toInt(string); - } + // '9', '.9' and '9.9' are correct + // '9.', '.' and '' are not + return /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]+)?)$/.test(stringAmount); } export function toString(amountValue: AmountValue) { diff --git a/packages/react-native-payments/lib/js/index.js b/lib/js/index.js similarity index 100% rename from packages/react-native-payments/lib/js/index.js rename to lib/js/index.js diff --git a/packages/react-native-payments/lib/js/types.js b/lib/js/types.js similarity index 100% rename from packages/react-native-payments/lib/js/types.js rename to lib/js/types.js diff --git a/package.json b/package.json index 1d4fd2cf..5a0033f9 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,44 @@ { + "name": "@metamask/react-native-payments", + "version": "2.0.1", + "main": "lib/js/index.js", "scripts": { - "precommit": "lint-staged" + "test": "jest" + }, + "repository": "https://github.com/MetaMask/react-native-payments", + "keywords": [ + "react", + "react-native", + "apple-pay", + "stripe", + "braintree", + "payments" + ], + "author": "Naoufal Kadhom", + "license": "MIT", + "dependencies": { + "es6-error": "^4.0.2", + "uuid": "3.3.2" }, "devDependencies": { - "lerna": "^2.0.0", - "lint-staged": "^4.0.0", - "prettier": "^1.4.4" + "babel-jest": "20.0.3", + "babel-preset-react-native": "2.0.0", + "husky": "^0.14.1", + "jest": "20.0.4", + "react-test-renderer": "16.0.0-alpha.12" + }, + "peerDependencies": { + "react": ">=15", + "react-native": ">=0.41" }, - "lint-staged": { - "*.js": [ - "prettier --single-quote --write", - "git add" + "jest": { + "testPathIgnorePatterns": [ + "/node_modules/", + "lib/js/__tests__" ] + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" } } diff --git a/packages/react-native-payments-addon-braintree/.gitignore b/packages/react-native-payments-addon-braintree/.gitignore deleted file mode 100644 index 6af85588..00000000 --- a/packages/react-native-payments-addon-braintree/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Carthage diff --git a/packages/react-native-payments-addon-braintree/.npmignore b/packages/react-native-payments-addon-braintree/.npmignore deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/react-native-payments-addon-braintree/Cartfile b/packages/react-native-payments-addon-braintree/Cartfile deleted file mode 100644 index 176352e6..00000000 --- a/packages/react-native-payments-addon-braintree/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "braintree/braintree_ios" == 4.9.6 diff --git a/packages/react-native-payments-addon-braintree/Cartfile.resolved b/packages/react-native-payments-addon-braintree/Cartfile.resolved deleted file mode 100644 index c0116999..00000000 --- a/packages/react-native-payments-addon-braintree/Cartfile.resolved +++ /dev/null @@ -1 +0,0 @@ -github "braintree/braintree_ios" "4.9.6" diff --git a/packages/react-native-payments-addon-braintree/README.md b/packages/react-native-payments-addon-braintree/README.md deleted file mode 100644 index 3d58d89e..00000000 --- a/packages/react-native-payments-addon-braintree/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# react-native-payments-addon-braintree -React Native Payments add-on for processing payments with Braintree. - -## Installation -First, download the package: - -```bash -$ yarn add react-native-payments-addon-braintree -``` - -Second, install the [React Native Payments CLI](https://www.npmjs.com/package/react-native-payments-cli): -```bash -$ yarn add react-native-payments-cli -``` - -Lastly, link the native dependencies with the React Native Payments CLI: -```bash -$ yarn react-native-payments-cli -- link braintree -``` - -_NOTE: `react-native-payments-cli` adds a Build Phase Script to your Xcode project that depends on Carthage._ - -## Usage -In order to receive chargeable Braintree tokens as part of your `PaymentResponse`, you'll need to add some Braintree specific parameters to your `PaymentMethodData`. - -Here's an example of a Braintree enabled Payment Method Data: - -```diff -const METHOD_DATA = [{ - supportedMethods: ['apple-pay'], - data: { - merchantIdentifier: 'merchant.com.your-app.namespace', - supportedNetworks: ['visa', 'mastercard', 'amex'], - countryCode: 'US', - currencyCode: 'USD', -+ paymentMethodTokenizationParameters: { -+ parameters: { -+ gateway: 'braintree', -+ 'braintree:tokenizationKey': 'your_tokenization_key' -+ } -+ } - } -}]; -``` - -## Resources -- [Creating an Apple Pay Certificate](https://developers.braintreepayments.com/guides/apple-pay/configuration/ios/v4#apple-pay-certificate-request-and-provisioning) -- [Obtaining a Tokentization Key](https://developers.braintreepayments.com/guides/authorization/tokenization-key/ios/v4#obtaining-a-tokenization-key) \ No newline at end of file diff --git a/packages/react-native-payments-addon-braintree/package.json b/packages/react-native-payments-addon-braintree/package.json deleted file mode 100644 index caee634d..00000000 --- a/packages/react-native-payments-addon-braintree/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@react-native-payments/braintree", - "version": "0.4.0", - "description": "React Native Payments add-on for processing payments with Braintree.", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "prepublish": "carthage update --platform ios" - }, - "repository": "https://github.com/naoufal/react-native-payments/tree/master/packages/react-native-payments-addon-braintree", - "keywords": [ - "react", - "react-native", - "react-native-payments", - "payments", - "braintree" - ], - "author": "Naoufal Kadhom", - "license": "MIT", - "reactNativePaymentsAddonConfig": { - "frameworks": ["BraintreeCore", "BraintreeApplePay"] - } -} diff --git a/packages/react-native-payments-addon-stripe/.gitignore b/packages/react-native-payments-addon-stripe/.gitignore deleted file mode 100644 index 6af85588..00000000 --- a/packages/react-native-payments-addon-stripe/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Carthage diff --git a/packages/react-native-payments-addon-stripe/Cartfile b/packages/react-native-payments-addon-stripe/Cartfile deleted file mode 100644 index 74ea5d67..00000000 --- a/packages/react-native-payments-addon-stripe/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "stripe/stripe-ios" == 11.1.0 diff --git a/packages/react-native-payments-addon-stripe/Cartfile.resolved b/packages/react-native-payments-addon-stripe/Cartfile.resolved deleted file mode 100644 index 50eb84fa..00000000 --- a/packages/react-native-payments-addon-stripe/Cartfile.resolved +++ /dev/null @@ -1 +0,0 @@ -github "stripe/stripe-ios" "v11.1.0" diff --git a/packages/react-native-payments-addon-stripe/README.md b/packages/react-native-payments-addon-stripe/README.md deleted file mode 100644 index d0dc9fa6..00000000 --- a/packages/react-native-payments-addon-stripe/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# react-native-payments-addon-stripe -React Native Payments add-on for processing payments with Stripe. - -## Installation -First, download the package: - -```bash -$ yarn add react-native-payments-addon-stripe -``` - -Second, install the [React Native Payments CLI](https://www.npmjs.com/package/react-native-payments-cli): -```bash -$ yarn add react-native-payments-cli -``` - -Lastly, link the native dependencies with the React Native Payments CLI: -```bash -$ yarn react-native-payments-cli -- link stripe -``` - -_NOTE: `react-native-payments-cli` adds a Build Phase Script to your Xcode project that depends on Carthage._ - -## Usage -In order to receive chargeable Stripe tokens as part of your `PaymentResponse`, you'll need to add some Stripe specific parameters to your `PaymentMethodData`. - -Here's an example of a Stripe enabled Payment Method Data: - -```diff -const METHOD_DATA = [{ - supportedMethods: ['apple-pay'], - data: { - merchantIdentifier: 'merchant.com.your-app.namespace', - supportedNetworks: ['visa', 'mastercard', 'amex'], - countryCode: 'US', - currencyCode: 'USD', -+ paymentMethodTokenizationParameters: { -+ parameters: { -+ gateway: 'stripe', -+ 'stripe:publishableKey': 'your_publishable_key', -+ 'stripe:version': '5.0.0' // Only required on Android -+ } -+ } - } -}]; -``` - -## Resources -- [Creating an Apple Pay Certificate](https://stripe.com/docs/apple-pay/apps#csr) -- [About Publishable Keys](https://stripe.com/docs/dashboard#api-keys) \ No newline at end of file diff --git a/packages/react-native-payments-addon-stripe/package.json b/packages/react-native-payments-addon-stripe/package.json deleted file mode 100644 index 9ddce910..00000000 --- a/packages/react-native-payments-addon-stripe/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@react-native-payments/stripe", - "version": "0.4.0", - "description": "React Native Payments add-on for processing payments with Stripe.", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "prepublish": "carthage update --platform ios" - }, - "repository": "https://github.com/naoufal/react-native-payments/tree/master/packages/react-native-payments-addon-stripe", - "keywords": [ - "react", - "react-native", - "react-native-payments", - "payments", - "stripe" - ], - "author": "Naoufal Kadhom", - "license": "MIT", - "reactNativePaymentsAddonConfig": { - "frameworks": ["Stripe"] - } -} diff --git a/packages/react-native-payments-cli/.npmignore b/packages/react-native-payments-cli/.npmignore deleted file mode 100644 index b66d03a6..00000000 --- a/packages/react-native-payments-cli/.npmignore +++ /dev/null @@ -1 +0,0 @@ -ios/ diff --git a/packages/react-native-payments-cli/README.md b/packages/react-native-payments-cli/README.md deleted file mode 100644 index 33632d40..00000000 --- a/packages/react-native-payments-cli/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# react-native-payments-cli - -## Installation -First, install [Carthage](https://github.com/Carthage/Carthage) (if you don't already have it installed): - -```bash -$ brew install carthage -``` - -Second, install the package: - -```bash -$ yarn add react-native-payments-cli -``` - -## Commands -### list -Outputs a list of installed add-ons that can be linked. - -#### Example -```bash -$ react-native-payments-cli list -``` ---- - -### link -Links an add-ons native dependencies to your project. - -#### Example -```bash -$ react-native-payments-cli link stripe -``` diff --git a/packages/react-native-payments-cli/index.js b/packages/react-native-payments-cli/index.js deleted file mode 100755 index bab02c34..00000000 --- a/packages/react-native-payments-cli/index.js +++ /dev/null @@ -1,225 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -const path = require('path'); -const fs = require('fs'); -const meow = require('meow'); -const chalk = require('chalk'); -const inquirer = require('inquirer'); -const Table = require('cli-table'); -const { log } = console; - -const { setupAddon } = require('./lib/commands'); - -const cli = meow(` - Usage: react-native-payments [command] - - Commands: - - link links an add-ons native dependencies to your project - list lists all available add-ons - \n -`); - -function convertAddOnToPackageName(addon = '') { - const RNP_ADDON_PREFIX = 'react-native-payments-addon'; - - return addon.startsWith(RNP_ADDON_PREFIX) - ? addon - : `${RNP_ADDON_PREFIX}-${addon}`; -} - -function getRNPProjectPath() { - return path.resolve(__dirname, '../react-native-payments/lib/ios/ReactNativePayments.xcodeproj/project.pbxproj'); -} - -function getUserProjectPath(relativeIOSPath) { - const iosPath = path.resolve(__dirname, `../../${relativeIOSPath}`) - let userProjectPath; - if (fs.existsSync(iosPath)) { - const projectFileName = fs.readdirSync(`${iosPath}`).find( - fileName => fileName.endsWith('.xcodeproj') - ); - - userProjectPath = `${iosPath}/${projectFileName}`; - } - - return userProjectPath; -} - -function removeLeadingSlash(input = '') { - return input.startsWith('/') - ? input.slice(1) - : input; -} - -function buildQuestions(maybeUserProject) { - let questions = [{ - name: 'userProjectPath', - type: 'input', - message: 'What is the relative path to your ios directory?', - when: ({ isUserPath }) => !isUserPath, - validate: (input) => { - return getUserProjectPath(removeLeadingSlash(input)) ? true : false; - } - }]; - - if (maybeUserProject) { - questions.unshift({ - name: 'isUserPath', - type: 'confirm', - message: `Is this the path to your Xcode project "${maybeUserProject}"?` - }); - } - - return questions; -} - -function interactiveGetUserProjectPath(maybeUserProject) { - // /project.pbxproj - return inquirer.prompt(buildQuestions(maybeUserProject)) - .then(({ isUserPath, userProjectPath }) => { - return isUserPath - ? `${maybeUserProject}/project.pbxproj` - : `${getUserProjectPath(removeLeadingSlash(userProjectPath))}/project.pbxproj`; - }) - .catch(e => { - console.log(e.stack); - }); -} - -function getPackagePath(packageName) { - return path.resolve(__dirname, `../${packageName}/package.json`); -} -function getPackageConfig(packageName) { - const config = require(getPackagePath(packageName)); - - return config; -} - -function isValidAddon(addon) { - if (!addon) { - log(chalk.yellow(` - You need to pass an option with this command. - - For example, "react-native-payments link stripe". - `)); - - return false; - } - - if (addon === true) { - log(chalk.yellow(` - You need to pass a valid option with this command. - - To see the full list of addons, go to https://goo.gl/ZC7jgf. - `)); - - return false; - } - - return true; -} - -function isPackageInstalled(packageName) { - const packageExists = fs.existsSync(getPackagePath(packageName)); - - if (!packageExists) { - log(chalk.yellow(` - "${packageName}" is not installed. Install it with "npm" or "yarn" and try again. - - To see the full list of addons, go to https://goo.gl/ZC7jgf. - `)); - - return false; - } - - return true; -} - -function link(addon) { - // Check if `addon` flag exists - if (!isValidAddon(addon)) { - return; - } - - // Check if `react-native-payments` is installed - if (!isPackageInstalled('react-native-payments')) { - return; - }; - - // Check if `addon` is installed - const packageName = convertAddOnToPackageName(addon); - if (!isPackageInstalled(packageName)) { - return; - } - - const packageConfig = getPackageConfig(packageName); - - const rnpProjectPath = getRNPProjectPath(); - return (interactiveGetUserProjectPath(getUserProjectPath('ios'))) - .then(userProjectPath => { - setupAddon( - userProjectPath, - rnpProjectPath, - packageConfig - ); - }) - .then(() => { - log(chalk.green(` - ✅ Successfully linked "${addon}". - `)); - }) - .catch(() => { - log(chalk.red(` - ⛔️ Something went wrong, could not link "${addon}". - `)); - }); -} - -function unlink(addon) { - if (!isValidAddon(addon)) { - return; - } -} - -function list() { - const availableAddons = fs.readdirSync(path.resolve(__dirname, '..')) - .filter(packageName => packageName.startsWith('react-native-payments-addon')); - - if (availableAddons.length === 0) { - log(chalk.yellow(` - No addons are available for linking. - - You can install addons with "npm" or "yarn". To see the full list of addons, go to https://goo.gl/ZC7jgf. - `)); - return; - } - - const addonsTable = new Table({ - head: ['name', 'package'], - style: { head: [] } - }); - - availableAddons.forEach(name => { - addonsTable.push([name.replace('react-native-payments-addon-', ''), name]); - }); - - log('\n' + addonsTable.toString()); - return; -} - -function main(input, addon){ - switch (input) { - case 'link': - return link(addon); - // case 'unlink': - // return unlink(addon); - case 'list': - return list(); - default: - return; - } -} - -main(cli.input[0], cli.input[1]); diff --git a/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/project.pbxproj b/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/project.pbxproj deleted file mode 100644 index 1eab52db..00000000 --- a/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/project.pbxproj +++ /dev/null @@ -1,321 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - AD1980401F210B7E0070AFE8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AD19803F1F210B7E0070AFE8 /* main.m */; }; - AD1980431F210B7E0070AFE8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AD1980421F210B7E0070AFE8 /* AppDelegate.m */; }; - AD1980461F210B7E0070AFE8 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AD1980451F210B7E0070AFE8 /* ViewController.m */; }; - AD1980491F210B7E0070AFE8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AD1980471F210B7E0070AFE8 /* Main.storyboard */; }; - AD19804B1F210B7E0070AFE8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AD19804A1F210B7E0070AFE8 /* Assets.xcassets */; }; - AD19804E1F210B7E0070AFE8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AD19804C1F210B7E0070AFE8 /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - AD19803B1F210B7E0070AFE8 /* RNPCLIProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RNPCLIProject.app; sourceTree = BUILT_PRODUCTS_DIR; }; - AD19803F1F210B7E0070AFE8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - AD1980411F210B7E0070AFE8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - AD1980421F210B7E0070AFE8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - AD1980441F210B7E0070AFE8 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - AD1980451F210B7E0070AFE8 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - AD1980481F210B7E0070AFE8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - AD19804A1F210B7E0070AFE8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - AD19804D1F210B7E0070AFE8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - AD19804F1F210B7E0070AFE8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - AD1980381F210B7E0070AFE8 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - AD1980321F210B7E0070AFE8 = { - isa = PBXGroup; - children = ( - AD19803D1F210B7E0070AFE8 /* RNPCLIProject */, - AD19803C1F210B7E0070AFE8 /* Products */, - ); - sourceTree = ""; - }; - AD19803C1F210B7E0070AFE8 /* Products */ = { - isa = PBXGroup; - children = ( - AD19803B1F210B7E0070AFE8 /* RNPCLIProject.app */, - ); - name = Products; - sourceTree = ""; - }; - AD19803D1F210B7E0070AFE8 /* RNPCLIProject */ = { - isa = PBXGroup; - children = ( - AD1980411F210B7E0070AFE8 /* AppDelegate.h */, - AD1980421F210B7E0070AFE8 /* AppDelegate.m */, - AD1980441F210B7E0070AFE8 /* ViewController.h */, - AD1980451F210B7E0070AFE8 /* ViewController.m */, - AD1980471F210B7E0070AFE8 /* Main.storyboard */, - AD19804A1F210B7E0070AFE8 /* Assets.xcassets */, - AD19804C1F210B7E0070AFE8 /* LaunchScreen.storyboard */, - AD19804F1F210B7E0070AFE8 /* Info.plist */, - AD19803E1F210B7E0070AFE8 /* Supporting Files */, - ); - path = RNPCLIProject; - sourceTree = ""; - }; - AD19803E1F210B7E0070AFE8 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - AD19803F1F210B7E0070AFE8 /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - AD19803A1F210B7E0070AFE8 /* RNPCLIProject */ = { - isa = PBXNativeTarget; - buildConfigurationList = AD1980521F210B7E0070AFE8 /* Build configuration list for PBXNativeTarget "RNPCLIProject" */; - buildPhases = ( - AD1980371F210B7E0070AFE8 /* Sources */, - AD1980381F210B7E0070AFE8 /* Frameworks */, - AD1980391F210B7E0070AFE8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = RNPCLIProject; - productName = RNPCLIProject; - productReference = AD19803B1F210B7E0070AFE8 /* RNPCLIProject.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - AD1980331F210B7E0070AFE8 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0830; - ORGANIZATIONNAME = "Naoufal Kadhom"; - TargetAttributes = { - AD19803A1F210B7E0070AFE8 = { - CreatedOnToolsVersion = 8.3.3; - DevelopmentTeam = 9P2TV6375M; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = AD1980361F210B7E0070AFE8 /* Build configuration list for PBXProject "RNPCLIProject" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = AD1980321F210B7E0070AFE8; - productRefGroup = AD19803C1F210B7E0070AFE8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - AD19803A1F210B7E0070AFE8 /* RNPCLIProject */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - AD1980391F210B7E0070AFE8 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - AD19804E1F210B7E0070AFE8 /* LaunchScreen.storyboard in Resources */, - AD19804B1F210B7E0070AFE8 /* Assets.xcassets in Resources */, - AD1980491F210B7E0070AFE8 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - AD1980371F210B7E0070AFE8 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - AD1980461F210B7E0070AFE8 /* ViewController.m in Sources */, - AD1980431F210B7E0070AFE8 /* AppDelegate.m in Sources */, - AD1980401F210B7E0070AFE8 /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - AD1980471F210B7E0070AFE8 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - AD1980481F210B7E0070AFE8 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - AD19804C1F210B7E0070AFE8 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - AD19804D1F210B7E0070AFE8 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - AD1980501F210B7E0070AFE8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - 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_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - 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 = 10.3; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - AD1980511F210B7E0070AFE8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - 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_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - 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 = 10.3; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - AD1980531F210B7E0070AFE8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 9P2TV6375M; - INFOPLIST_FILE = RNPCLIProject/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.naoufal.RNPCLIProject; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - AD1980541F210B7E0070AFE8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 9P2TV6375M; - INFOPLIST_FILE = RNPCLIProject/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.naoufal.RNPCLIProject; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - AD1980361F210B7E0070AFE8 /* Build configuration list for PBXProject "RNPCLIProject" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AD1980501F210B7E0070AFE8 /* Debug */, - AD1980511F210B7E0070AFE8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - AD1980521F210B7E0070AFE8 /* Build configuration list for PBXNativeTarget "RNPCLIProject" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AD1980531F210B7E0070AFE8 /* Debug */, - AD1980541F210B7E0070AFE8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - }; -/* End XCConfigurationList section */ - }; - rootObject = AD1980331F210B7E0070AFE8 /* Project object */; -} diff --git a/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index f0507831..00000000 --- a/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/project.xcworkspace/xcuserdata/naoufal.xcuserdatad/UserInterfaceState.xcuserstate b/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/project.xcworkspace/xcuserdata/naoufal.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 6ee9134a..00000000 Binary files a/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/project.xcworkspace/xcuserdata/naoufal.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/xcuserdata/naoufal.xcuserdatad/xcschemes/RNPCLIProject.xcscheme b/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/xcuserdata/naoufal.xcuserdatad/xcschemes/RNPCLIProject.xcscheme deleted file mode 100644 index 1ffec594..00000000 --- a/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/xcuserdata/naoufal.xcuserdatad/xcschemes/RNPCLIProject.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/xcuserdata/naoufal.xcuserdatad/xcschemes/xcschememanagement.plist b/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/xcuserdata/naoufal.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 9307c5a5..00000000 --- a/packages/react-native-payments-cli/ios/RNPCLIProject.xcodeproj/xcuserdata/naoufal.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SchemeUserState - - RNPCLIProject.xcscheme - - orderHint - 0 - - - SuppressBuildableAutocreation - - AD19803A1F210B7E0070AFE8 - - primary - - - - - diff --git a/packages/react-native-payments-cli/ios/RNPCLIProject/AppDelegate.h b/packages/react-native-payments-cli/ios/RNPCLIProject/AppDelegate.h deleted file mode 100644 index 37ea4024..00000000 --- a/packages/react-native-payments-cli/ios/RNPCLIProject/AppDelegate.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// AppDelegate.h -// RNPCLIProject -// -// Created by Naoufal Kadhom on 7/20/17. -// Copyright © 2017 Naoufal Kadhom. All rights reserved. -// - -#import - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - - -@end - diff --git a/packages/react-native-payments-cli/ios/RNPCLIProject/AppDelegate.m b/packages/react-native-payments-cli/ios/RNPCLIProject/AppDelegate.m deleted file mode 100644 index 405a5aa0..00000000 --- a/packages/react-native-payments-cli/ios/RNPCLIProject/AppDelegate.m +++ /dev/null @@ -1,51 +0,0 @@ -// -// AppDelegate.m -// RNPCLIProject -// -// Created by Naoufal Kadhom on 7/20/17. -// Copyright © 2017 Naoufal Kadhom. All rights reserved. -// - -#import "AppDelegate.h" - -@interface AppDelegate () - -@end - -@implementation AppDelegate - - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. -} - - -- (void)applicationDidEnterBackground:(UIApplication *)application { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. -} - - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - - -@end diff --git a/packages/react-native-payments-cli/ios/RNPCLIProject/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/react-native-payments-cli/ios/RNPCLIProject/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 36d2c80d..00000000 --- a/packages/react-native-payments-cli/ios/RNPCLIProject/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/packages/react-native-payments-cli/ios/RNPCLIProject/Base.lproj/LaunchScreen.storyboard b/packages/react-native-payments-cli/ios/RNPCLIProject/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index fdf3f97d..00000000 --- a/packages/react-native-payments-cli/ios/RNPCLIProject/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/react-native-payments-cli/ios/RNPCLIProject/Base.lproj/Main.storyboard b/packages/react-native-payments-cli/ios/RNPCLIProject/Base.lproj/Main.storyboard deleted file mode 100644 index 4529698c..00000000 --- a/packages/react-native-payments-cli/ios/RNPCLIProject/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/react-native-payments-cli/ios/RNPCLIProject/Info.plist b/packages/react-native-payments-cli/ios/RNPCLIProject/Info.plist deleted file mode 100644 index d0524738..00000000 --- a/packages/react-native-payments-cli/ios/RNPCLIProject/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/packages/react-native-payments-cli/ios/RNPCLIProject/ViewController.h b/packages/react-native-payments-cli/ios/RNPCLIProject/ViewController.h deleted file mode 100644 index 3a435dee..00000000 --- a/packages/react-native-payments-cli/ios/RNPCLIProject/ViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ViewController.h -// RNPCLIProject -// -// Created by Naoufal Kadhom on 7/20/17. -// Copyright © 2017 Naoufal Kadhom. All rights reserved. -// - -#import - -@interface ViewController : UIViewController - - -@end - diff --git a/packages/react-native-payments-cli/ios/RNPCLIProject/ViewController.m b/packages/react-native-payments-cli/ios/RNPCLIProject/ViewController.m deleted file mode 100644 index cac5b18e..00000000 --- a/packages/react-native-payments-cli/ios/RNPCLIProject/ViewController.m +++ /dev/null @@ -1,29 +0,0 @@ -// -// ViewController.m -// RNPCLIProject -// -// Created by Naoufal Kadhom on 7/20/17. -// Copyright © 2017 Naoufal Kadhom. All rights reserved. -// - -#import "ViewController.h" - -@interface ViewController () - -@end - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. -} - - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - - -@end diff --git a/packages/react-native-payments-cli/ios/RNPCLIProject/main.m b/packages/react-native-payments-cli/ios/RNPCLIProject/main.m deleted file mode 100644 index 230a6887..00000000 --- a/packages/react-native-payments-cli/ios/RNPCLIProject/main.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.m -// RNPCLIProject -// -// Created by Naoufal Kadhom on 7/20/17. -// Copyright © 2017 Naoufal Kadhom. All rights reserved. -// - -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/react-native-payments-cli/lib/commands.js b/packages/react-native-payments-cli/lib/commands.js deleted file mode 100644 index ae679bd3..00000000 --- a/packages/react-native-payments-cli/lib/commands.js +++ /dev/null @@ -1,79 +0,0 @@ -const Promise = require('bluebird'); -const fs = require('fs'); -const path = require('path'); -const xcode = require('xcode'); -const pbxFile = require('xcode/lib/pbxFile'); - -const { addFrameworkSearchPaths, addFrameworks, addCarthageRunScriptPhase } = require('./helpers'); - -function setupAddon(projectPath, rnpPath, addOnConfig) { - const addOnName = addOnConfig.name; - const addOnFrameworks = addOnConfig.reactNativePaymentsAddonConfig.frameworks; - - Promise.all([ - addToProject(projectPath, addOnName, addOnFrameworks), - addToRNP(rnpPath, addOnName) - ]) - .catch(e => { - throw new Error('Error setting up Stripe', e); - }) -} - -function addToProject(projectPath, addOnName, addOnFrameworks) { - const project = xcode.project(projectPath); - project.parseAsync = Promise.promisify(project.parse); - - return project.parseAsync(() => { - // Add Framework Search Paths - addFrameworkSearchPaths( - project, - [`"$(SRCROOT)/../node_modules/${addOnName}/Carthage/Build/iOS/"`] - ); - - // Add and link Framework - const frameworksWithExtension = addOnFrameworks.map(name => `${name}.framework`); - addFrameworks( - project, - path.resolve(__dirname, `../../${addOnName}/Carthage/Build/iOS`), - frameworksWithExtension - ); - - // Add Run Script Phase - const inputPaths = frameworksWithExtension.map( - frameworkFile => `"$(SRCROOT)/../node_modules/${addOnName}/Carthage/Build/iOS/${frameworkFile}"` - ); - const outputPaths = frameworksWithExtension.map( - frameworkFile => `"$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/${frameworkFile}"` - ); - addCarthageRunScriptPhase( - project, - inputPaths, - outputPaths - ); - - fs.writeFileSync( - projectPath, - project.writeSync() - ); - }); -} - -function addToRNP(projectPath, addOnName) { - const project = xcode.project(projectPath); - project.parseAsync = Promise.promisify(project.parse); - - return project.parseAsync(() => { - // Add Framework Search Paths - addFrameworkSearchPaths( - project, - [`"$(SRCROOT)/../../../${addOnName}/Carthage/Build/iOS/"`] - ); - - fs.writeFileSync( - projectPath, - project.writeSync() - ); - }); -} - -module.exports = { setupAddon }; diff --git a/packages/react-native-payments-cli/lib/helpers.js b/packages/react-native-payments-cli/lib/helpers.js deleted file mode 100644 index 7af4552a..00000000 --- a/packages/react-native-payments-cli/lib/helpers.js +++ /dev/null @@ -1,104 +0,0 @@ -function filterOutCommentKeys(key) { - return !key.endsWith('_comment'); -} - -function addFrameworks(project, frameworkDirPath, frameworkFileNames = []) { - // Add frameworks pbx - project.addPbxGroup( - [], - 'Frameworks', - frameworkDirPath - ); - - - frameworkFileNames.forEach(frameworkFileName => { - project.addFramework(`${frameworkDirPath}/${frameworkFileName}`) - }); -} - -function addPathsToBuildScriptPhase(project, buildPhaseName, inputPaths, outputPaths) { - const buildScriptPhases = project.hash.project.objects['PBXShellScriptBuildPhase'] || {}; - - Object.keys(buildScriptPhases) - .forEach(buildPhaseKey => { - const buildScriptPhase = buildScriptPhases[buildPhaseKey]; - if (buildScriptPhase.name === `"${buildPhaseName}"`) { - const newInputPaths = inputPaths - .filter(inputPath => !buildScriptPhase.inputPaths.includes(inputPath)) - const newOutputPaths = outputPaths - .filter(outputPath => !buildScriptPhase.outputPaths.includes(outputPath)) - - buildScriptPhase.inputPaths = [...buildScriptPhase.inputPaths, ...newInputPaths]; - buildScriptPhase.outputPaths = [...buildScriptPhase.outputPaths, ...newOutputPaths]; - } - }); -} - -function buildScriptPhaseExists(project, name) { - const buildScriptPhases = project.hash.project.objects['PBXShellScriptBuildPhase'] || {}; - - return Object.keys(buildScriptPhases) - .reduce((acc, buildScriptPhaseKey) => { - if (!acc) { - return buildScriptPhases[buildScriptPhaseKey].name === `"${name}"` - } - - return acc; - }, false); -} - -function addCarthageRunScriptPhase(project, inputPaths, outputPaths) { - const buildPhaseName = 'Copy Carthage Frameworks (Generated by react-native-payments-cli)'; - const buildScriptPhases = project.hash.project.objects['PBXShellScriptBuildPhase'] || {}; - - if (buildScriptPhaseExists(project, buildPhaseName)) { - addPathsToBuildScriptPhase(project, buildPhaseName, inputPaths, outputPaths); - return; - } - - project.addBuildPhase( - [], - 'PBXShellScriptBuildPhase', - buildPhaseName, - undefined, - { - shellPath: '/bin/sh', - shellScript: '/usr/local/bin/carthage copy-frameworks', - inputPaths, - outputPaths - } - ); -} - -function addFrameworkSearchPaths(project, filePaths) { - const config = project.pbxXCBuildConfigurationSection(); - - Object.keys(config) - .filter(filterOutCommentKeys) - .forEach(key => { - const buildSettings = config[key].buildSettings; - const hasFrameworkSearchPaths = buildSettings.hasOwnProperty('FRAMEWORK_SEARCH_PATHS'); - - // If there's only one path, the frameworkSearchPaths is a string, so we - // normalize it here. - const frameworkSearchPaths = buildSettings.FRAMEWORK_SEARCH_PATHS || []; - const normalizedFrameworkSearchPaths = Array.isArray(frameworkSearchPaths) - ? frameworkSearchPaths - : [frameworkSearchPaths]; - - const pathsToAdd = filePaths - .filter(filePath => !normalizedFrameworkSearchPaths.includes(filePath)); - - const nextFrameworkSearchPaths = [...normalizedFrameworkSearchPaths, ...pathsToAdd]; - - buildSettings.FRAMEWORK_SEARCH_PATHS = nextFrameworkSearchPaths.length > 1 - ? nextFrameworkSearchPaths - : nextFrameworkSearchPaths.join(''); - }); -} - -module.exports = { - addFrameworks, - addFrameworkSearchPaths, - addCarthageRunScriptPhase -}; \ No newline at end of file diff --git a/packages/react-native-payments-cli/package.json b/packages/react-native-payments-cli/package.json deleted file mode 100644 index c27a5231..00000000 --- a/packages/react-native-payments-cli/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@react-native-payments/cli", - "version": "0.4.0", - "bin": "index.js", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": "https://github.com/naoufal/react-native-payments/tree/master/packages/react-native-payments-cli", - "keywords": [ - "react-native-payments", - "cli" - ], - "author": "Naoufal Kadhom", - "license": "MIT", - "dependencies": { - "bluebird": "^3.5.0", - "chalk": "^2.0.1", - "cli-table": "^0.3.1", - "inquirer": "^3.2.0", - "meow": "^3.7.0", - "xcode": "^0.9.3" - }, - "devDependencies": { - "react-native-payments": "^0.1.2", - "react-native-payments-addon-braintree": "4.8.4", - "react-native-payments-addon-stripe": "11.1.0" - } -} diff --git a/packages/react-native-payments-cli/yarn.lock b/packages/react-native-payments-cli/yarn.lock deleted file mode 100644 index d9e69b21..00000000 --- a/packages/react-native-payments-cli/yarn.lock +++ /dev/null @@ -1,526 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -ansi-escapes@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b" - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - -ansi-styles@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.1.0.tgz#09c202d5c917ec23188caa5c9cb9179cd9547750" - dependencies: - color-convert "^1.0.0" - -array-find-index@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" - -base64-js@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.1.2.tgz#d6400cac1c4c660976d90d07a04351d89395f5e8" - -big-integer@^1.6.7: - version "1.6.23" - resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.23.tgz#e85d508220c74e3f43a4ce72eed51f3da4db94d1" - -bluebird@^3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" - -bplist-creator@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/bplist-creator/-/bplist-creator-0.0.7.tgz#37df1536092824b87c42f957b01344117372ae45" - dependencies: - stream-buffers "~2.2.0" - -bplist-parser@0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/bplist-parser/-/bplist-parser-0.1.1.tgz#d60d5dcc20cba6dc7e1f299b35d3e1f95dafbae6" - dependencies: - big-integer "^1.6.7" - -builtin-modules@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - -camelcase-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" - dependencies: - camelcase "^2.0.0" - map-obj "^1.0.0" - -camelcase@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - -chalk@^2.0.0, chalk@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.0.1.tgz#dbec49436d2ae15f536114e76d14656cdbc0f44d" - dependencies: - ansi-styles "^3.1.0" - escape-string-regexp "^1.0.5" - supports-color "^4.0.0" - -cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - dependencies: - restore-cursor "^2.0.0" - -cli-table@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.1.tgz#f53b05266a8b1a0b934b3d0821e6e2dc5914ae23" - dependencies: - colors "1.0.3" - -cli-width@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" - -color-convert@^1.0.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" - dependencies: - color-name "^1.1.1" - -color-name@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - -colors@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" - -currently-unhandled@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" - dependencies: - array-find-index "^1.0.1" - -decamelize@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -error-ex@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" - dependencies: - is-arrayish "^0.2.1" - -es6-error@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.0.2.tgz#eec5c726eacef51b7f6b73c20db6e1b13b069c98" - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - -external-editor@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.0.4.tgz#1ed9199da9cbfe2ef2f7a31b2fde8b0d12368972" - dependencies: - iconv-lite "^0.4.17" - jschardet "^1.4.2" - tmp "^0.0.31" - -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - dependencies: - escape-string-regexp "^1.0.5" - -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" - -get-stdin@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" - -graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - -hosted-git-info@^2.1.4: - version "2.5.0" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" - -iconv-lite@^0.4.17: - version "0.4.18" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.18.tgz#23d8656b16aae6742ac29732ea8f0336a4789cf2" - -indent-string@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" - dependencies: - repeating "^2.0.0" - -inquirer@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.2.0.tgz#45b44c2160c729d7578c54060b3eed94487bb42b" - dependencies: - ansi-escapes "^2.0.0" - chalk "^2.0.0" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^2.0.4" - figures "^2.0.0" - lodash "^4.3.0" - mute-stream "0.0.7" - run-async "^2.2.0" - rx-lite "^4.0.8" - rx-lite-aggregates "^4.0.8" - string-width "^2.1.0" - strip-ansi "^4.0.0" - through "^2.3.6" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - -is-builtin-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - dependencies: - builtin-modules "^1.0.0" - -is-finite@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - -is-promise@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - -is-utf8@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - -jschardet@^1.4.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.5.0.tgz#a61f310306a5a71188e1b1acd08add3cfbb08b1e" - -load-json-file@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - pinkie-promise "^2.0.0" - strip-bom "^2.0.0" - -lodash@^4.3.0: - version "4.17.4" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" - -loud-rejection@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" - dependencies: - currently-unhandled "^0.4.1" - signal-exit "^3.0.0" - -map-obj@^1.0.0, map-obj@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" - -meow@^3.7.0: - version "3.7.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" - dependencies: - camelcase-keys "^2.0.0" - decamelize "^1.1.2" - loud-rejection "^1.0.0" - map-obj "^1.0.1" - minimist "^1.1.3" - normalize-package-data "^2.3.4" - object-assign "^4.0.1" - read-pkg-up "^1.0.1" - redent "^1.0.0" - trim-newlines "^1.0.0" - -mimic-fn@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" - -minimist@^1.1.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -mute-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - -normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: - version "2.4.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" - dependencies: - hosted-git-info "^2.1.4" - is-builtin-module "^1.0.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -object-assign@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - dependencies: - mimic-fn "^1.0.0" - -os-tmpdir@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - dependencies: - error-ex "^1.2.0" - -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - dependencies: - pinkie-promise "^2.0.0" - -path-type@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - dependencies: - graceful-fs "^4.1.2" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -pegjs@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/pegjs/-/pegjs-0.10.0.tgz#cf8bafae6eddff4b5a7efb185269eaaf4610ddbd" - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - -plist@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/plist/-/plist-2.0.1.tgz#0a32ca9481b1c364e92e18dc55c876de9d01da8b" - dependencies: - base64-js "1.1.2" - xmlbuilder "8.2.2" - xmldom "0.1.x" - -react-native-payments-addon-braintree@4.8.4: - version "4.8.4" - resolved "https://registry.yarnpkg.com/react-native-payments-addon-braintree/-/react-native-payments-addon-braintree-4.8.4.tgz#f6b1fac554ec05c75af4669b071735104f1b8559" - -react-native-payments-addon-stripe@11.1.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/react-native-payments-addon-stripe/-/react-native-payments-addon-stripe-11.1.0.tgz#4aec32549fe745a77b8aaf8a5ac46201e427d12b" - -react-native-payments@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/react-native-payments/-/react-native-payments-0.1.2.tgz#442be4a927bc9790aa42da5c33560b14109ca832" - dependencies: - es6-error "^4.0.2" - uuid "^3.1.0" - validator "^7.0.0" - -read-pkg-up@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" - dependencies: - find-up "^1.0.0" - read-pkg "^1.0.0" - -read-pkg@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - dependencies: - load-json-file "^1.0.0" - normalize-package-data "^2.3.2" - path-type "^1.0.0" - -redent@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" - dependencies: - indent-string "^2.1.0" - strip-indent "^1.0.1" - -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - dependencies: - is-finite "^1.0.0" - -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - -run-async@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" - dependencies: - is-promise "^2.1.0" - -rx-lite-aggregates@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" - dependencies: - rx-lite "*" - -rx-lite@*, rx-lite@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" - -"semver@2 || 3 || 4 || 5": - version "5.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" - -signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - -simple-plist@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/simple-plist/-/simple-plist-0.2.1.tgz#71766db352326928cf3a807242ba762322636723" - dependencies: - bplist-creator "0.0.7" - bplist-parser "0.1.1" - plist "2.0.1" - -spdx-correct@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" - dependencies: - spdx-license-ids "^1.0.2" - -spdx-expression-parse@~1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" - -spdx-license-ids@^1.0.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" - -stream-buffers@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4" - -string-width@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - dependencies: - ansi-regex "^3.0.0" - -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - dependencies: - is-utf8 "^0.2.0" - -strip-indent@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" - dependencies: - get-stdin "^4.0.1" - -supports-color@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.2.0.tgz#ad986dc7eb2315d009b4d77c8169c2231a684037" - dependencies: - has-flag "^2.0.0" - -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - -tmp@^0.0.31: - version "0.0.31" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7" - dependencies: - os-tmpdir "~1.0.1" - -trim-newlines@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" - -uuid@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -uuid@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" - -validate-npm-package-license@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" - dependencies: - spdx-correct "~1.0.0" - spdx-expression-parse "~1.0.0" - -validator@^7.0.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/validator/-/validator-7.2.0.tgz#a63dcbaba51d4350bf8df20988e0d5a54d711791" - -xcode@^0.9.3: - version "0.9.3" - resolved "https://registry.yarnpkg.com/xcode/-/xcode-0.9.3.tgz#910a89c16aee6cc0b42ca805a6d0b4cf87211cf3" - dependencies: - pegjs "^0.10.0" - simple-plist "^0.2.1" - uuid "3.0.1" - -xmlbuilder@8.2.2: - version "8.2.2" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-8.2.2.tgz#69248673410b4ba42e1a6136551d2922335aa773" - -xmldom@0.1.x: - version "0.1.27" - resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.27.tgz#d501f97b3bdb403af8ef9ecc20573187aadac0e9" diff --git a/packages/react-native-payments/.babelrc b/packages/react-native-payments/.babelrc deleted file mode 100644 index c5863787..00000000 --- a/packages/react-native-payments/.babelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "plugins": [ - "transform-class-properties" - ], - "presets": ["react-native"] -} diff --git a/packages/react-native-payments/.flowconfig b/packages/react-native-payments/.flowconfig deleted file mode 100644 index aa1fd35f..00000000 --- a/packages/react-native-payments/.flowconfig +++ /dev/null @@ -1,8 +0,0 @@ -[ignore] - -[include] - -[libs] - -[options] -unsafe.enable_getters_and_setters=true \ No newline at end of file diff --git a/packages/react-native-payments/.gitignore b/packages/react-native-payments/.gitignore deleted file mode 100644 index 67847ad5..00000000 --- a/packages/react-native-payments/.gitignore +++ /dev/null @@ -1,35 +0,0 @@ -# System -# -.DS_Store - -# Xcode -# -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate - -# npm -# -node_modules/ - -# editors -# -jsconfig.json -.vscode/* - -# project -# -coverage diff --git a/packages/react-native-payments/android/build.gradle b/packages/react-native-payments/android/build.gradle deleted file mode 100644 index 2dac59c2..00000000 --- a/packages/react-native-payments/android/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -apply plugin: 'com.android.library' - -android { - compileSdkVersion 23 - buildToolsVersion "23.0.1" - - defaultConfig { - minSdkVersion 16 - targetSdkVersion 22 - versionCode 1 - versionName "1.0" - ndk { - abiFilters "armeabi-v7a", "x86" - } - } - lintOptions { - warning 'InvalidPackage' - } -} - -dependencies { - compile 'com.facebook.react:react-native:+' - compile 'com.google.android.gms:play-services-wallet:11.0.4' - compile 'com.android.support:support-v4:23.0.1' -} diff --git a/packages/react-native-payments/examples/braintree/.babelrc b/packages/react-native-payments/examples/braintree/.babelrc deleted file mode 100644 index 8df53fe4..00000000 --- a/packages/react-native-payments/examples/braintree/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ -"presets": ["react-native"] -} \ No newline at end of file diff --git a/packages/react-native-payments/examples/braintree/.buckconfig b/packages/react-native-payments/examples/braintree/.buckconfig deleted file mode 100644 index 934256cb..00000000 --- a/packages/react-native-payments/examples/braintree/.buckconfig +++ /dev/null @@ -1,6 +0,0 @@ - -[android] - target = Google Inc.:Google APIs:23 - -[maven_repositories] - central = https://repo1.maven.org/maven2 diff --git a/packages/react-native-payments/examples/braintree/.flowconfig b/packages/react-native-payments/examples/braintree/.flowconfig deleted file mode 100644 index b38ea97e..00000000 --- a/packages/react-native-payments/examples/braintree/.flowconfig +++ /dev/null @@ -1,44 +0,0 @@ -[ignore] -; We fork some components by platform -.*/*[.]android.js - -; Ignore "BUCK" generated dirs -/\.buckd/ - -; Ignore unexpected extra "@providesModule" -.*/node_modules/.*/node_modules/fbjs/.* - -; Ignore duplicate module providers -; For RN Apps installed via npm, "Libraries" folder is inside -; "node_modules/react-native" but in the source repo it is in the root -.*/Libraries/react-native/React.js -.*/Libraries/react-native/ReactNative.js - -[include] - -[libs] -node_modules/react-native/Libraries/react-native/react-native-interface.js -node_modules/react-native/flow -flow/ - -[options] -module.system=haste - -experimental.strict_type_args=true - -munge_underscores=true - -module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' - -suppress_type=$FlowIssue -suppress_type=$FlowFixMe -suppress_type=$FixMe - -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-7]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-7]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ -suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy - -unsafe.enable_getters_and_setters=true - -[version] -^0.37.0 diff --git a/packages/react-native-payments/examples/braintree/.gitattributes b/packages/react-native-payments/examples/braintree/.gitattributes deleted file mode 100644 index d42ff183..00000000 --- a/packages/react-native-payments/examples/braintree/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.pbxproj -text diff --git a/packages/react-native-payments/examples/braintree/.gitignore b/packages/react-native-payments/examples/braintree/.gitignore deleted file mode 100644 index 989e1e64..00000000 --- a/packages/react-native-payments/examples/braintree/.gitignore +++ /dev/null @@ -1,59 +0,0 @@ -# OSX -# -.DS_Store - -# Xcode -# -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate -project.xcworkspace - -# Android/IntelliJ -# -build/ -.idea -.gradle -local.properties -*.iml - -# node.js -# -node_modules/ -npm-debug.log -yarn-error.log - -# BUCK -buck-out/ -\.buckd/ -android/app/libs -*.keystore - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots - -# Haul -# -haul-debug.log -.happypack diff --git a/packages/react-native-payments/examples/braintree/.watchmanconfig b/packages/react-native-payments/examples/braintree/.watchmanconfig deleted file mode 100644 index 9e26dfee..00000000 --- a/packages/react-native-payments/examples/braintree/.watchmanconfig +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/packages/react-native-payments/examples/braintree/__tests__/index.android.js b/packages/react-native-payments/examples/braintree/__tests__/index.android.js deleted file mode 100644 index a49559bf..00000000 --- a/packages/react-native-payments/examples/braintree/__tests__/index.android.js +++ /dev/null @@ -1,10 +0,0 @@ -import 'react-native'; -import React from 'react'; -import Index from '../index.android.js'; - -// Note: test renderer must be required after react-native. -import renderer from 'react-test-renderer'; - -it('renders correctly', () => { - const tree = renderer.create(); -}); diff --git a/packages/react-native-payments/examples/braintree/__tests__/index.ios.js b/packages/react-native-payments/examples/braintree/__tests__/index.ios.js deleted file mode 100644 index a21e84c1..00000000 --- a/packages/react-native-payments/examples/braintree/__tests__/index.ios.js +++ /dev/null @@ -1,10 +0,0 @@ -import 'react-native'; -import React from 'react'; -import Index from '../index.ios.js'; - -// Note: test renderer must be required after react-native. -import renderer from 'react-test-renderer'; - -it('renders correctly', () => { - const tree = renderer.create(); -}); diff --git a/packages/react-native-payments/examples/braintree/android/app/BUCK b/packages/react-native-payments/examples/braintree/android/app/BUCK deleted file mode 100644 index a9fd5dd4..00000000 --- a/packages/react-native-payments/examples/braintree/android/app/BUCK +++ /dev/null @@ -1,66 +0,0 @@ -import re - -# To learn about Buck see [Docs](https://buckbuild.com/). -# To run your application with Buck: -# - install Buck -# - `npm start` - to start the packager -# - `cd android` -# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` -# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck -# - `buck install -r android/app` - compile, install and run application -# - -lib_deps = [] -for jarfile in glob(['libs/*.jar']): - name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) - lib_deps.append(':' + name) - prebuilt_jar( - name = name, - binary_jar = jarfile, - ) - -for aarfile in glob(['libs/*.aar']): - name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) - lib_deps.append(':' + name) - android_prebuilt_aar( - name = name, - aar = aarfile, - ) - -android_library( - name = 'all-libs', - exported_deps = lib_deps -) - -android_library( - name = 'app-code', - srcs = glob([ - 'src/main/java/**/*.java', - ]), - deps = [ - ':all-libs', - ':build_config', - ':res', - ], -) - -android_build_config( - name = 'build_config', - package = 'com.braintreeexample', -) - -android_resource( - name = 'res', - res = 'src/main/res', - package = 'com.braintreeexample', -) - -android_binary( - name = 'app', - package_type = 'debug', - manifest = 'src/main/AndroidManifest.xml', - keystore = '//android/keystores:debug', - deps = [ - ':app-code', - ], -) diff --git a/packages/react-native-payments/examples/braintree/android/app/build.gradle b/packages/react-native-payments/examples/braintree/android/app/build.gradle deleted file mode 100644 index c9e8581f..00000000 --- a/packages/react-native-payments/examples/braintree/android/app/build.gradle +++ /dev/null @@ -1,139 +0,0 @@ -apply plugin: "com.android.application" - -import com.android.build.OutputFile - -/** - * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets - * and bundleReleaseJsAndAssets). - * These basically call `react-native bundle` with the correct arguments during the Android build - * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the - * bundle directly from the development server. Below you can see all the possible configurations - * and their defaults. If you decide to add a configuration block, make sure to add it before the - * `apply from: "../../node_modules/react-native/react.gradle"` line. - * - * project.ext.react = [ - * // the name of the generated asset file containing your JS bundle - * bundleAssetName: "index.android.bundle", - * - * // the entry file for bundle generation - * entryFile: "index.android.js", - * - * // whether to bundle JS and assets in debug mode - * bundleInDebug: false, - * - * // whether to bundle JS and assets in release mode - * bundleInRelease: true, - * - * // whether to bundle JS and assets in another build variant (if configured). - * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants - * // The configuration property can be in the following formats - * // 'bundleIn${productFlavor}${buildType}' - * // 'bundleIn${buildType}' - * // bundleInFreeDebug: true, - * // bundleInPaidRelease: true, - * // bundleInBeta: true, - * - * // the root of your project, i.e. where "package.json" lives - * root: "../../", - * - * // where to put the JS bundle asset in debug mode - * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", - * - * // where to put the JS bundle asset in release mode - * jsBundleDirRelease: "$buildDir/intermediates/assets/release", - * - * // where to put drawable resources / React Native assets, e.g. the ones you use via - * // require('./image.png')), in debug mode - * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", - * - * // where to put drawable resources / React Native assets, e.g. the ones you use via - * // require('./image.png')), in release mode - * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", - * - * // by default the gradle tasks are skipped if none of the JS files or assets change; this means - * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to - * // date; if you have any other folders that you want to ignore for performance reasons (gradle - * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ - * // for example, you might want to remove it from here. - * inputExcludes: ["android/**", "ios/**"], - * - * // override which node gets called and with what additional arguments - * nodeExecutableAndArgs: ["node"] - * - * // supply additional arguments to the packager - * extraPackagerArgs: [] - * ] - */ - -apply from: "../../node_modules/react-native/react.gradle" - -/** - * Set this to true to create two separate APKs instead of one: - * - An APK that only works on ARM devices - * - An APK that only works on x86 devices - * The advantage is the size of the APK is reduced by about 4MB. - * Upload all the APKs to the Play Store and people will download - * the correct one based on the CPU architecture of their device. - */ -def enableSeparateBuildPerCPUArchitecture = false - -/** - * Run Proguard to shrink the Java bytecode in release builds. - */ -def enableProguardInReleaseBuilds = false - -android { - compileSdkVersion 23 - buildToolsVersion "23.0.1" - - defaultConfig { - applicationId "com.braintreeexample" - minSdkVersion 16 - targetSdkVersion 22 - versionCode 1 - versionName "1.0" - ndk { - abiFilters "armeabi-v7a", "x86" - } - } - splits { - abi { - reset() - enable enableSeparateBuildPerCPUArchitecture - universalApk false // If true, also generate a universal APK - include "armeabi-v7a", "x86" - } - } - buildTypes { - release { - minifyEnabled enableProguardInReleaseBuilds - proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" - } - } - // applicationVariants are e.g. debug, release - applicationVariants.all { variant -> - variant.outputs.each { output -> - // For each separate APK per architecture, set a unique version code as described here: - // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits - def versionCodes = ["armeabi-v7a":1, "x86":2] - def abi = output.getFilter(OutputFile.ABI) - if (abi != null) { // null for the universal-debug, universal-release variants - output.versionCodeOverride = - versionCodes.get(abi) * 1048576 + defaultConfig.versionCode - } - } - } -} - -dependencies { - compile fileTree(dir: "libs", include: ["*.jar"]) - compile "com.android.support:appcompat-v7:23.0.1" - compile "com.facebook.react:react-native:+" // From node_modules -} - -// Run this once to be able to run the application with BUCK -// puts all compile dependencies into folder libs for BUCK to use -task copyDownloadableDepsToLibs(type: Copy) { - from configurations.compile - into 'libs' -} diff --git a/packages/react-native-payments/examples/braintree/android/app/proguard-rules.pro b/packages/react-native-payments/examples/braintree/android/app/proguard-rules.pro deleted file mode 100644 index 48361a90..00000000 --- a/packages/react-native-payments/examples/braintree/android/app/proguard-rules.pro +++ /dev/null @@ -1,66 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Disabling obfuscation is useful if you collect stack traces from production crashes -# (unless you are using a system that supports de-obfuscate the stack traces). --dontobfuscate - -# React Native - -# Keep our interfaces so they can be used by other ProGuard rules. -# See http://sourceforge.net/p/proguard/bugs/466/ --keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip --keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters --keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip - -# Do not strip any method/class that is annotated with @DoNotStrip --keep @com.facebook.proguard.annotations.DoNotStrip class * --keep @com.facebook.common.internal.DoNotStrip class * --keepclassmembers class * { - @com.facebook.proguard.annotations.DoNotStrip *; - @com.facebook.common.internal.DoNotStrip *; -} - --keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { - void set*(***); - *** get*(); -} - --keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } --keep class * extends com.facebook.react.bridge.NativeModule { *; } --keepclassmembers,includedescriptorclasses class * { native ; } --keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } --keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } --keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } - --dontwarn com.facebook.react.** - -# okhttp - --keepattributes Signature --keepattributes *Annotation* --keep class okhttp3.** { *; } --keep interface okhttp3.** { *; } --dontwarn okhttp3.** - -# okio - --keep class sun.misc.Unsafe { *; } --dontwarn java.nio.file.* --dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement --dontwarn okio.** diff --git a/packages/react-native-payments/examples/braintree/android/app/src/main/AndroidManifest.xml b/packages/react-native-payments/examples/braintree/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 0426380a..00000000 --- a/packages/react-native-payments/examples/braintree/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/packages/react-native-payments/examples/braintree/android/app/src/main/java/com/braintreeexample/MainActivity.java b/packages/react-native-payments/examples/braintree/android/app/src/main/java/com/braintreeexample/MainActivity.java deleted file mode 100644 index 84efe53b..00000000 --- a/packages/react-native-payments/examples/braintree/android/app/src/main/java/com/braintreeexample/MainActivity.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.braintreeexample; - -import com.facebook.react.ReactActivity; - -public class MainActivity extends ReactActivity { - - /** - * Returns the name of the main component registered from JavaScript. - * This is used to schedule rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "BraintreeExample"; - } -} diff --git a/packages/react-native-payments/examples/braintree/android/app/src/main/java/com/braintreeexample/MainApplication.java b/packages/react-native-payments/examples/braintree/android/app/src/main/java/com/braintreeexample/MainApplication.java deleted file mode 100644 index b0934bc9..00000000 --- a/packages/react-native-payments/examples/braintree/android/app/src/main/java/com/braintreeexample/MainApplication.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.braintreeexample; - -import android.app.Application; -import android.util.Log; - -import com.facebook.react.ReactApplication; -import com.facebook.react.ReactInstanceManager; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.react.shell.MainReactPackage; -import com.facebook.soloader.SoLoader; - -import java.util.Arrays; -import java.util.List; - -public class MainApplication extends Application implements ReactApplication { - - private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - return Arrays.asList( - new MainReactPackage() - ); - } - }; - - @Override - public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; - } - - @Override - public void onCreate() { - super.onCreate(); - SoLoader.init(this, /* native exopackage */ false); - } -} diff --git a/packages/react-native-payments/examples/braintree/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/react-native-payments/examples/braintree/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index cde69bcc..00000000 Binary files a/packages/react-native-payments/examples/braintree/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/react-native-payments/examples/braintree/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/react-native-payments/examples/braintree/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index c133a0cb..00000000 Binary files a/packages/react-native-payments/examples/braintree/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/react-native-payments/examples/braintree/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/react-native-payments/examples/braintree/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index bfa42f0e..00000000 Binary files a/packages/react-native-payments/examples/braintree/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/react-native-payments/examples/braintree/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/react-native-payments/examples/braintree/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 324e72cd..00000000 Binary files a/packages/react-native-payments/examples/braintree/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/react-native-payments/examples/braintree/android/app/src/main/res/values/strings.xml b/packages/react-native-payments/examples/braintree/android/app/src/main/res/values/strings.xml deleted file mode 100644 index 3f66f6e9..00000000 --- a/packages/react-native-payments/examples/braintree/android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - BraintreeExample - diff --git a/packages/react-native-payments/examples/braintree/android/app/src/main/res/values/styles.xml b/packages/react-native-payments/examples/braintree/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 319eb0ca..00000000 --- a/packages/react-native-payments/examples/braintree/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/packages/react-native-payments/examples/braintree/android/build.gradle b/packages/react-native-payments/examples/braintree/android/build.gradle deleted file mode 100644 index fcba4c58..00000000 --- a/packages/react-native-payments/examples/braintree/android/build.gradle +++ /dev/null @@ -1,24 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:1.3.1' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenLocal() - jcenter() - maven { - // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url "$rootDir/../node_modules/react-native/android" - } - } -} diff --git a/packages/react-native-payments/examples/braintree/android/gradle.properties b/packages/react-native-payments/examples/braintree/android/gradle.properties deleted file mode 100644 index 1fd964e9..00000000 --- a/packages/react-native-payments/examples/braintree/android/gradle.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -XX:MaxPermSize=256m -# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true - -android.useDeprecatedNdk=true diff --git a/packages/react-native-payments/examples/braintree/android/gradle/wrapper/gradle-wrapper.jar b/packages/react-native-payments/examples/braintree/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index b5166dad..00000000 Binary files a/packages/react-native-payments/examples/braintree/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/packages/react-native-payments/examples/braintree/android/gradle/wrapper/gradle-wrapper.properties b/packages/react-native-payments/examples/braintree/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index b9fbfaba..00000000 --- a/packages/react-native-payments/examples/braintree/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip diff --git a/packages/react-native-payments/examples/braintree/android/gradlew b/packages/react-native-payments/examples/braintree/android/gradlew deleted file mode 100755 index 91a7e269..00000000 --- a/packages/react-native-payments/examples/braintree/android/gradlew +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/packages/react-native-payments/examples/braintree/android/gradlew.bat b/packages/react-native-payments/examples/braintree/android/gradlew.bat deleted file mode 100644 index aec99730..00000000 --- a/packages/react-native-payments/examples/braintree/android/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/packages/react-native-payments/examples/braintree/android/keystores/BUCK b/packages/react-native-payments/examples/braintree/android/keystores/BUCK deleted file mode 100644 index 15da20e6..00000000 --- a/packages/react-native-payments/examples/braintree/android/keystores/BUCK +++ /dev/null @@ -1,8 +0,0 @@ -keystore( - name = 'debug', - store = 'debug.keystore', - properties = 'debug.keystore.properties', - visibility = [ - 'PUBLIC', - ], -) diff --git a/packages/react-native-payments/examples/braintree/android/keystores/debug.keystore.properties b/packages/react-native-payments/examples/braintree/android/keystores/debug.keystore.properties deleted file mode 100644 index 121bfb49..00000000 --- a/packages/react-native-payments/examples/braintree/android/keystores/debug.keystore.properties +++ /dev/null @@ -1,4 +0,0 @@ -key.store=debug.keystore -key.alias=androiddebugkey -key.store.password=android -key.alias.password=android diff --git a/packages/react-native-payments/examples/braintree/android/settings.gradle b/packages/react-native-payments/examples/braintree/android/settings.gradle deleted file mode 100644 index ed24c202..00000000 --- a/packages/react-native-payments/examples/braintree/android/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -rootProject.name = 'BraintreeExample' - -include ':app' diff --git a/packages/react-native-payments/examples/braintree/index.android.js b/packages/react-native-payments/examples/braintree/index.android.js deleted file mode 100644 index a220f41b..00000000 --- a/packages/react-native-payments/examples/braintree/index.android.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Sample React Native App - * https://github.com/facebook/react-native - * @flow - */ - -import React, { Component } from 'react'; -import { AppRegistry, StyleSheet, Text, View } from 'react-native'; - -export default class BraintreeExample extends Component { - render() { - return ( - - Welcome to React Native! - - To get started, edit index.android.js - - - Double tap R on your keyboard to reload,{'\n'} - Shake or press menu button for dev menu - - - ); - } -} - -const styles = StyleSheet.create({ - container: { - flex: 1, - justifyContent: 'center', - alignItems: 'center', - backgroundColor: '#F5FCFF' - }, - welcome: { - fontSize: 20, - textAlign: 'center', - margin: 10 - }, - instructions: { - textAlign: 'center', - color: '#333333', - marginBottom: 5 - } -}); - -AppRegistry.registerComponent('BraintreeExample', () => BraintreeExample); diff --git a/packages/react-native-payments/examples/braintree/index.ios.js b/packages/react-native-payments/examples/braintree/index.ios.js deleted file mode 100644 index f222c913..00000000 --- a/packages/react-native-payments/examples/braintree/index.ios.js +++ /dev/null @@ -1,103 +0,0 @@ -import React, { Component } from 'react'; -import { AppRegistry, StyleSheet, Text, View, Button } from 'react-native'; - -global.PaymentRequest = require('react-native-payments').PaymentRequest; -const ReactNativePaymentsVersion = require('react-native-payments/package.json') - .version; - -import Header from '../common/components/Header'; - -export default class BraintreeExample extends Component { - constructor() { - super(); - - this.state = { - text: null - }; - } - - handlePress() { - const supportedMethods = [ - { - supportedMethods: ['apple-pay'], - data: { - merchantIdentifier: 'merchant.com.react-native-payments.naoufal', - supportedNetworks: ['visa', 'mastercard'], - countryCode: 'US', - currencyCode: 'USD', - paymentMethodTokenizationParameters: { - parameters: { - gateway: 'braintree', - 'braintree:tokenizationKey': 'sandbox_np7393pq_sh6czsvsq9nvjc3j' - } - } - } - } - ]; - - const details = { - id: 'basic-example', - displayItems: [ - { - label: 'Movie Ticket', - amount: { currency: 'USD', value: '15.00' } - } - ], - total: { - label: 'Merchant Name', - amount: { currency: 'USD', value: '15.00' } - } - }; - - const pr = new PaymentRequest(supportedMethods, details); - - pr - .show() - .then(paymentResponse => { - this.setState({ - text: paymentResponse.details.paymentToken - }); - - paymentResponse.complete('success'); - }) - .catch(e => { - pr.abort(); - - this.setState({ - text: e.message - }); - }); - } - - render() { - return ( - -
- -