Skip to content

Commit

Permalink
chore(deps): replace tipsi with official stripe lib (#10451)
Browse files Browse the repository at this point in the history
* remove old tipsi stripe dep

* add new stripe dep

* remove troubleshooting docs

* update bid flow test and setup.jest

* update credit card form

* update payment info test

* update payment info

* update confirm bid test

* update confirm bid

* registration updates

* more updates

* first pass creating token with new input

* get rid of now unnecessary useRef

* basic styling

* start moving field to shared component

* minor changes

* first pass replacing credit card field in bid registration

* working animated border with moti

* remove old credit card input dep and related hacks

* remove missed import and now unused typings

* fix failing test

* update compile sdk to 34 for stripe

* update stripe to latest patch

* remove now unused default vals code

* remove now unused default vals code

* remove unused import

* try bumping android build cache

* downgrade to latest stripe compatible with compileVersion 33

* Revert "update compile sdk to 34 for stripe"

This reverts commit 5b5965c.

* don't store sensitive vals, use palette styling

Co-authored-by: Carlos <[email protected]>

* remove unnecessary hard coded currency

* update token format in test

* try removing jetifier from install

* try removing jetifier from android command

* bump android cache

* remove jetifier dep

* remove explicit jetifier commands

* add a describe block scope

* refactor the credit card form tests

* less silly valid card logic

---------

Co-authored-by: Carlos <[email protected]>
  • Loading branch information
brainbicycle and araujobarret committed Jul 11, 2024
1 parent 6c412f5 commit 6f3234d
Show file tree
Hide file tree
Showing 26 changed files with 502 additions and 995 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ commands:
at: ../workspace
- restore_cache:
keys:
- v10-test-success-{{ checksum "../workspace/.manifests/android_native" }}
- v12-test-success-{{ checksum "../workspace/.manifests/android_native" }}
- android/change-java-version:
java-version: 11
- run:
Expand Down Expand Up @@ -148,7 +148,7 @@ commands:
steps:
- restore_cache:
keys:
- v4-app_build_android-{{ checksum "../workspace/.manifests/app_build" }}
- v6-app_build_android-{{ checksum "../workspace/.manifests/app_build" }}
- generate-query-map
- run:
name: Download fonts from s3
Expand All @@ -160,7 +160,7 @@ commands:
name: Build App
command: ./scripts/ci/ci-android
- save_cache:
key: v4-app_build_android-{{ checksum "../workspace/.manifests/app_build" }}
key: v6-app_build_android-{{ checksum "../workspace/.manifests/app_build" }}
paths:
- android/build
- android/app/build
Expand Down Expand Up @@ -454,7 +454,7 @@ jobs:
prefix: android-build

- save_cache:
key: v10-test-success-{{ checksum "../workspace/.manifests/android_native" }}
key: v12-test-success-{{ checksum "../workspace/.manifests/android_native" }}
paths:
- build-success.log
- run:
Expand Down
26 changes: 0 additions & 26 deletions HACKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,6 @@ When we upgrade our deps to a version of react-native that includes removal of d

When updating to rn-0.69.10 we had to patch this due to deprecation of PropTypes. For this reason we also installed `deprecated-react-native-prop-types` to avoid errors and we patched the `react-native` package to use the deprecated PropTypes coming from the `deprecated-react-native-prop-types` package.

## react-native-credit-card-input

#### When can we remove this:

When we upgrade our deps to a version of react-native that includes removal of deprecated PropTypes.

#### Explanation/Context:

When updating to rn-0.69.10 we had to patch this due to deprecation of PropTypes. For this reason we also installed `deprecated-react-native-prop-types` to avoid errors and we patched the `react-native` package to use the deprecated PropTypes coming from the `deprecated-react-native-prop-types` package.

## react-native-image-crop-picker getRootVC patch

#### When can we remove this:
Expand Down Expand Up @@ -163,22 +153,6 @@ There are two hacks here:
- We hack the output of the compiler to provide clickable links for error messages. Relay assumes that you put your `__generated__` folder in the root of your project, but we put it in `src`.
- We make sure that files which do not change are not overwritten. This prevents excessive reloading by metro.

## react-native-credit-card-input

#### When can we remove this:

We can remove these hacks once we switch to Stripe's forthcoming official react-native library.

#### Explanation/Context:

These are fairly superficial styling hacks for

- focused/error border states
- shrinking the icon size to work nicely with our inputs
- aligning inner inputs nicely
- icon animation to work properly on android
- palette v3 colors

# android Input placeholder measuring hack

#### When can we remove this:
Expand Down
23 changes: 0 additions & 23 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,29 +96,6 @@ Make sure you are on proper node version and then do a
yarn install
```

- Issue with installing `tipsi-stripe`

```
[!] CocoaPods could not find compatible versions for pod "tipsi-stripe":
```

You need to run

```
bundle exec pod update tipsi-stripe
```

- Error during `bundle exec pod update tipsi-stripe`

```
checking whether the C compiler works... no
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
```

You need to go to Xcode -> Preferences -> Locations and select Command Line Tools from the dropdown

- Failed `./scripts/setup/setup-env-for-artsy` with

```
Expand Down
64 changes: 55 additions & 9 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -879,12 +879,44 @@ PODS:
- Specta (2.0.0)
- SSZipArchive (2.2.3)
- Starscream (4.0.8)
- Stripe (14.0.2)
- Stripe (23.21.2):
- StripeApplePay (= 23.21.2)
- StripeCore (= 23.21.2)
- StripePayments (= 23.21.2)
- StripePaymentsUI (= 23.21.2)
- StripeUICore (= 23.21.2)
- stripe-react-native (0.36.0):
- React-Core
- Stripe (~> 23.21.0)
- StripeApplePay (~> 23.21.0)
- StripeFinancialConnections (~> 23.21.0)
- StripePayments (~> 23.21.0)
- StripePaymentSheet (~> 23.21.0)
- StripePaymentsUI (~> 23.21.0)
- StripeApplePay (23.21.2):
- StripeCore (= 23.21.2)
- StripeCore (23.21.2)
- StripeFinancialConnections (23.21.2):
- StripeCore (= 23.21.2)
- StripeUICore (= 23.21.2)
- StripePayments (23.21.2):
- StripeCore (= 23.21.2)
- StripePayments/Stripe3DS2 (= 23.21.2)
- StripePayments/Stripe3DS2 (23.21.2):
- StripeCore (= 23.21.2)
- StripePaymentSheet (23.21.2):
- StripeApplePay (= 23.21.2)
- StripeCore (= 23.21.2)
- StripePayments (= 23.21.2)
- StripePaymentsUI (= 23.21.2)
- StripePaymentsUI (23.21.2):
- StripeCore (= 23.21.2)
- StripePayments (= 23.21.2)
- StripeUICore (= 23.21.2)
- StripeUICore (23.21.2):
- StripeCore (= 23.21.2)
- SwiftyJSON (5.0.2)
- Then (2.3.0)
- tipsi-stripe (7.5.0):
- React
- Stripe (~> 14.0.0)
- TOCropViewController (2.6.1)
- UICKeyChainStore (2.2.1)
- "UIView+BooleanAnimations (1.0.2)"
Expand Down Expand Up @@ -1044,9 +1076,9 @@ DEPENDENCIES:
- "sovran-react-native (from `../node_modules/@segment/sovran-react-native`)"
- Specta (~> 2.0)
- Starscream (= 4.0.8)
- "stripe-react-native (from `../node_modules/@stripe/stripe-react-native`)"
- SwiftyJSON (from `https://github.com/SwiftyJSON/SwiftyJSON/`, commit `af76cf3ef710b6ca5f8c05f3a31307d44a3c5828`)
- Then (= 2.3.0)
- tipsi-stripe (from `../node_modules/tipsi-stripe`)
- UICKeyChainStore
- "UIView+BooleanAnimations"
- "XCTest+OHHTTPStubSuiteCleanUp"
Expand Down Expand Up @@ -1138,6 +1170,13 @@ SPEC REPOS:
- SSZipArchive
- Starscream
- Stripe
- StripeApplePay
- StripeCore
- StripeFinancialConnections
- StripePayments
- StripePaymentSheet
- StripePaymentsUI
- StripeUICore
- Then
- TOCropViewController
- UICKeyChainStore
Expand Down Expand Up @@ -1325,11 +1364,11 @@ EXTERNAL SOURCES:
:path: "../node_modules/sift-react-native"
sovran-react-native:
:path: "../node_modules/@segment/sovran-react-native"
stripe-react-native:
:path: "../node_modules/@stripe/stripe-react-native"
SwiftyJSON:
:commit: af76cf3ef710b6ca5f8c05f3a31307d44a3c5828
:git: https://github.com/SwiftyJSON/SwiftyJSON/
tipsi-stripe:
:path: "../node_modules/tipsi-stripe"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"

Expand Down Expand Up @@ -1521,10 +1560,17 @@ SPEC CHECKSUMS:
Specta: b79d84043684b35ffdc2680df578dc318ec2efc2
SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9
Starscream: 19b5533ddb925208db698f0ac508a100b884a1b9
Stripe: 25c07000e7e86ffc53da0e41a5dd1bce30470fe0
Stripe: 1ac988b21653854f79d0e55c0cb68c67022534a0
stripe-react-native: ee7309aeca7aeb9cabeec8e1434c84f114fdf74b
StripeApplePay: d47882e5de82480cc536dc63d1403a1efdb9de7b
StripeCore: 04ae691ead0c8e03acfe2c935867a55459cc98e6
StripeFinancialConnections: 1f53e55955f2cd27a426a9934cc8630274b9860d
StripePayments: 9853e83478decbb6f4fd721e4271336d73ac8d11
StripePaymentSheet: 5b1d25eab80059cedfbee49fe7f30c34b703be89
StripePaymentsUI: 2d1a2bd3c88735e003342f4c8d9d7aa25d7613c0
StripeUICore: d8d6fdcbc77bd8697052501452cbb0fcf1bc6840
SwiftyJSON: 576fbf26942d5ef414daad8870b1642413ecc00c
Then: ee21c97b85ff6062b9b0080c9abb1eea46743345
tipsi-stripe: 8aaaa6f5e4cfea5c35be3affbb616c4e6cfafa5f
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
UICKeyChainStore: ba3bff2c762b12db1e516f395c837dd25298b05e
"UIView+BooleanAnimations": a760be9a066036e55f298b7b7350a6cb14cfcd97
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"main": "index-common.js",
"scripts": {
"android": "yarn jetifier && react-native run-android",
"android": "react-native run-android",
"bundle:android": "yarn bundle:android:js && yarn bundle:android:hermes && yarn bundle:android:sourcemap",
"bundle:android:js": "./scripts/hermes/hermes-android-bundle.sh",
"bundle:android:sourcemap": "./scripts/hermes/hermes-android-sourcemap.sh",
Expand Down Expand Up @@ -103,7 +103,7 @@
],
"dependenciesComments": {
"react-native": "Try running `npx @rnx-kit/align-deps --requirements [email protected]` when upgrading to a version, here 0.66.5",
"deprecated-react-native-prop-types": "Needed for patching react-native and react-native-credit-card-input due to rn removing the proptypes from their repo",
"deprecated-react-native-prop-types": "Needed for patching react-native due to rn removing the proptypes from their repo",
"@babel/plugin-transform-named-capturing-groups-regex": "Needed for compiling android with hermes enabled",
"braces": "in the resolutions - needed to resolve a security dependency issue - need to remove this when the issue is resolved and packages are updated"
},
Expand Down Expand Up @@ -134,6 +134,7 @@
"@segment/sovran-react-native": "1.1.1",
"@sentry/react-native": "5.20.0",
"@shopify/flash-list": "1.6.4",
"@stripe/stripe-react-native": "0.36.0",
"@styled-system/theme-get": "5.1.2",
"autosuggest-highlight": "3.3.4",
"deprecated-react-native-prop-types": "4.1.0",
Expand Down Expand Up @@ -161,7 +162,6 @@
"react-native-code-push": "8.1.0",
"react-native-config": "https://github.com/artsy/react-native-config.git#v1.4.12-artsy",
"react-native-context-menu-view": "git+https://github.com/artsy/react-native-context-menu-view.git#v1.10.10-artsy",
"react-native-credit-card-input": "0.4.1",
"react-native-dev-menu-android": "1.0.10",
"react-native-device-info": "10.3.0",
"react-native-fast-image": "8.6.3",
Expand Down Expand Up @@ -201,7 +201,6 @@
"styled-components": "5.3.6",
"styled-system": "5.1.5",
"supercluster": "7.1.5",
"tipsi-stripe": "https://github.com/artsy/tipsi-stripe.git#fix-infinite-loop",
"unleash-proxy-client": "3.1.1",
"url": "0.11.3",
"victory-native": "36.6.8",
Expand Down Expand Up @@ -294,7 +293,6 @@
"jest-junit": "15.0.0",
"jest-raw-loader": "1.0.1",
"jest-watch-typeahead": "0.6.1",
"jetifier": "1.6.6",
"json5": "2.2.3",
"lint-staged": "13.2.3",
"metro-react-native-babel-preset": "0.77.0",
Expand Down
Loading

0 comments on commit 6f3234d

Please sign in to comment.